creating MyGui static library for iphone

metaldev

11-10-2010 20:11:19

I have been having a hellacious time trying to get a static library to build MyGUI for the iphone... admittedly I am not very experienced with Xcode however.

is anybody else trying to build a static library? or are you just including mygui into your projects?

If i change the settings to what i think are the appropriate architectures (armv6 and armv7) the flags in the project seem to break the build:
unrecognized flag -msse

removing -msse or other flags still breaks the build:
error: macro names must be identifiers

if you have an xcode project lying around that builds mygui static library for the iphone it would be greatly appreciated.
Thanks for any help.

Altren

11-10-2010 21:56:22

First - you should set CMake property MYGUI_STATIC to true.
Also try to remove add_definitions(-msse) line from CMakeLists.txt in root directory of MyGUI sources.

metaldev

11-10-2010 22:54:44

Thanks for your help Altren,

I did what you said and recreated the xcode project using cmake, and then i rebuilt MyGUI, and then linked it in with my project (which works fine on PC).

Things seem to be working now except for 1 linker error:
"vtable for MyGUI::Exception", referenced from:
__ZTVN5MyGUI9ExceptionE$non_lazy_ptr in myApplication.o
(maybe you meant: __ZTVN5MyGUI9ExceptionE$non_lazy_ptr)
ld: symbol(s) not found
collect2: ld returned 1 exit status


MyGUI::Exception seems to be almost all virtual, do you think this is something i need to fix in my code or modify in mygui? am i doing something wrong?

Altren

12-10-2010 00:31:27

Well, I think you can't do something wrong to cause such linker error. Looks like gcc that comes with xcode is slightly different or simply old.
Try to do next thing: move definition of Exception destructor from cpp to header (MyGUI_Exception.h / .cpp) and definition of "const char* what() const throw();".
If this won't work try to move all methods and constructors of MyGUI::Exception into header too.

metaldev

12-10-2010 04:22:50

Altren, thanks for your help!

I am onto runtime errors now.

Altren

12-10-2010 16:15:57

So what you did to fix linker error? I need to know and fix that in sources.

metaldev

13-10-2010 02:45:49

Altren, I thought I fixed it but actually i didnt. :(

I am sorry, I am not a very experienced programmer.
As soon as I changed an include in one of my .h files to include myGUI, it exploited all the link errors again.

For now, I just included all the files for MyGUI into my project. I know this is anathema to anyone with even moderate skill but i have to keep moving for now. I have spent too long trying to make an iphone static project for MyGUI and am out of time for now, I will try again later.

I do thank you for your help so far.