From: Erik T. <eh....@gm...> - 2011-01-19 12:14:27
|
2011/1/17 Nat! <na...@mu...> > Hi > > My basic question is, how am I supposed to invoke the Objective-C compiler > on MinGW? > > [...] > > C:\MinGW\bin>"mingw32-gcc.exe" -x objc c:\src\gcc_in_vs\gcc_in_vs\foo.m > mingw32-gcc.exe: language objc not recognized > mingw32-gcc.exe: language objc not recognized > c:\src\gcc_in_vs\gcc_in_vs\foo.m: file not recognized: File format not > recognize > d > collect2: ld returned 1 exit status > > And ObjC doesn't show up in the list of languages: > > -x <language> Specify the language of the following input files > Permissible languages include: c c++ assembler > none > 'none' means revert to the default behavior of > guessing the language based on the file's > extension > > Looking at the online documentation shows that this list isn't exhaustive. The correct option would be: -x objective-c From http://gcc.gnu.org/onlinedocs/gcc-4.5.2/gcc/Overall-Options.html#Overall-Options (if all else fails, read the manual): You can specify the input language explicitly with the -x option: -x languageSpecify explicitly the language for the following input files (rather than letting the compiler choose a default based on the file name suffix). This option applies to all following input files until the next -xoption. Possible values for language are: c c-header c-cpp-output c++ c++-header c++-cpp-output objective-c objective-c-header objective-c-cpp-output objective-c++ objective-c++-header objective-c++-cpp-output assembler assembler-with-cpp ada f77 f77-cpp-input f95 f95-cpp-input java -x noneTurn off any specification of a language, so that subsequent files are handled according to their file name suffixes (as they are if -x has not been used at all). Erik. |