Author Topic: Compiling Objective-C - A Short Guide  (Read 32262 times)

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Compiling Objective-C - A Short Guide
« Reply #15 on: December 30, 2011, 04:17:23 pm »
Thanks, but he said that "he is compiling using TDM-GCC x64 4.5.1 on Windows 7" for Objective-C
Yes, so then don't use OSX SDK dependencies, cause even if you are using an Objective/C compiler on Windows, this won't work otherwise. Surely you can create any projects that do not depend on the OSX SDK. That wasn't my point.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline uSer

  • Single posting newcomer
  • *
  • Posts: 4
Re: Compiling Objective-C - A Short Guide
« Reply #16 on: January 08, 2012, 07:07:41 pm »
 Oh got your point now, but then what's the alternate of THESE frameworks, because we need them to compile obj C

rro4785

  • Guest
Re: Compiling Objective-C - A Short Guide
« Reply #17 on: March 09, 2013, 05:03:14 am »
Hello! First of all, I would like to thank for the guide. ;D

I would like to clarify that my English is very bad, and try to translate my question here.  ;D

When trying to compile the example of your setup guide, throws me the following error:

 :-\

Code
F:\Proyectos\Otros\CodeBlocks\Objective-C\Test\Test\main.m||In function 'main':|
F:\Proyectos\Otros\CodeBlocks\Objective-C\Test\Test\main.m|5|warning: 'TestObject' may not respond to '+alloc' [enabled by default]|
F:\Proyectos\Otros\CodeBlocks\Objective-C\Test\Test\main.m|5|warning: (Messages without a matching method signature [enabled by default]|
F:\Proyectos\Otros\CodeBlocks\Objective-C\Test\Test\main.m|5|warning: will be assumed to return 'id' and accept [enabled by default]|
F:\Proyectos\Otros\CodeBlocks\Objective-C\Test\Test\main.m|5|warning: '...' as arguments.) [enabled by default]|
F:\Proyectos\Otros\CodeBlocks\Objective-C\Test\Test\main.m|5|warning: no '-init' method found [enabled by default]|
F:\Proyectos\Otros\CodeBlocks\Objective-C\Test\Test\main.m|6|warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration]|
F:\Proyectos\Otros\CodeBlocks\Objective-C\Test\Test\main.m|6|warning: incompatible implicit declaration of built-in function 'printf' [enabled by default]|
F:\Proyectos\Otros\CodeBlocks\Objective-C\Test\Test\TestObject.h|1|warning: #import is a deprecated GCC extension [-Wdeprecated]|
d:\herramientas\mingw\bin\..\lib\gcc\mingw32\4.7.2\include\objc\Object.h|50|error: stray '@' in program|
d:\herramientas\mingw\bin\..\lib\gcc\mingw32\4.7.2\include\objc\Object.h|50|error: unknown type name 'interface'|
d:\herramientas\mingw\bin\..\lib\gcc\mingw32\4.7.2\include\objc\Object.h|51|error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token|
d:\herramientas\mingw\bin\..\lib\gcc\mingw32\4.7.2\include\objc\Object.h|54|error: expected identifier or '(' before '-' token|
d:\herramientas\mingw\bin\..\lib\gcc\mingw32\4.7.2\include\objc\Object.h|55|error: expected identifier or '(' before '-' token|
d:\herramientas\mingw\bin\..\lib\gcc\mingw32\4.7.2\include\objc\Object.h|56|error: stray '@' in program|
F:\Proyectos\Otros\CodeBlocks\Objective-C\Test\Test\TestObject.h|3|error: stray '@' in program|
d:\herramientas\mingw\bin\..\lib\gcc\mingw32\4.7.2\include\objc\Object.h|56|error: unknown type name 'end'|
F:\Proyectos\Otros\CodeBlocks\Objective-C\Test\Test\TestObject.h|3|error: expected '=', ',', ';', 'asm' or '__attribute__' before 'TestObject'|
F:\Proyectos\Otros\CodeBlocks\Objective-C\Test\Test\TestObject.h|7|error: expected identifier or '(' before '-' token|
F:\Proyectos\Otros\CodeBlocks\Objective-C\Test\Test\TestObject.h|8|error: expected identifier or '(' before '-' token|
F:\Proyectos\Otros\CodeBlocks\Objective-C\Test\Test\TestObject.h|9|error: expected identifier or '(' before '-' token|
F:\Proyectos\Otros\CodeBlocks\Objective-C\Test\Test\TestObject.h|11|error: stray '@' in program|
F:\Proyectos\Otros\CodeBlocks\Objective-C\Test\Test\TestObject.h|11|error: expected '=', ',', ';', 'asm' or '__attribute__' at end of input|
||=== Build finished: 14 errors, 8 warnings (0 minutes, 3 seconds) ===|

 ???

No that's what I do, might help me please.

Thanks in advance.  :D

Offline mariusm

  • Multiple posting newcomer
  • *
  • Posts: 46
Re: Compiling Objective-C - A Short Guide
« Reply #18 on: February 16, 2023, 11:58:57 am »
I know it's old but need.

How to add -x objective-c++ on .mm files compilation and -x c++ to .cpp files compilation?

I tried to modify the xml compiler options but I've no success with that.
« Last Edit: February 16, 2023, 12:11:47 pm by mariusm »

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1563
Re: Compiling Objective-C - A Short Guide
« Reply #19 on: February 16, 2023, 01:21:07 pm »
Try in compiler global settings, clicking in the "Advanced options" button.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7589
    • My Best Post
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline mariusm

  • Multiple posting newcomer
  • *
  • Posts: 46
Re: Compiling Objective-C - A Short Guide
« Reply #21 on: February 17, 2023, 12:06:04 pm »
Works even for C files in cpp project, must add an option with -x c.

THANKS  ;D 8)
« Last Edit: February 17, 2023, 12:29:49 pm by mariusm »