Author Topic: Unable to compile in Xcode - FIXED  (Read 8558 times)

0 Members and 1 Guest are viewing this topic.

Offline blowfish

  • 211
  • Join the cult of KILL MY ROUTER!!!!!!!!!!1
Unable to compile in Xcode - FIXED
Well, I recently got the source code from CVS, and tried to compile.  I got a few errors about missing files which I fixed, but now I get 636 warnings and 46 errors when I compile, none of which point to any specific section of code, and none of which I know the source of.  I think it is safe to assume that these errors are all the result of a few basic problems, but does anyone know what these problems are?

Just for reference, some of the warnings and errors:
Code: [Select]
ld: warning gr_set_clip(int, int, int, int, bool)has different visibility (2) in /Users/joeydwong/fs2_open/projects/Xcode/build/Debug/libcode.a(missionweaponchoice.o) and (1) in /Users/joeydwong/fs2_open/projects/Xcode/build/FS2_Open.build/Debug/FS2_Open.build/Objects-normal/ppc/freespace.o

ld: warning gr_set_bitmap(int, int, int, float)has different visibility (2) in /Users/joeydwong/fs2_open/projects/Xcode/build/Debug/libcode.a(missionweaponchoice.o) and (1) in /Users/joeydwong/fs2_open/projects/Xcode/build/FS2_Open.build/Debug/FS2_Open.build/Objects-normal/ppc/freespace.o

...

  "fs2netd_get_valid_missions()", referenced from:
      multi_update_valid_missions()     in libcode.a(multiutil.o)

  "fs2netd_update_ban_list()", referenced from:
      multi_create_game_do()     in libcode.a(multiui.o)
« Last Edit: March 30, 2008, 11:38:48 pm by blowfish »

 

Offline blowfish

  • 211
  • Join the cult of KILL MY ROUTER!!!!!!!!!!1
Re: Unable to compile in Xcode.
I just retried from SVN and I have to ask - When was the last time the XCode project file was updated?  I get a lot of errors regarding files that don't exist and aren't referenced anywhere

 

Offline taylor

  • Super SCP/Linux Guru
  • Moderator
  • 212
    • http://www.icculus.org/~taylor
Re: Unable to compile in Xcode.
It has been quite a while since it was updated actually.  I've got a newer/working project set up, but it's for my Xt tree, which is different from what's in SVN, so it wouldn't work if I committed.

But the main problem with the newer project setup is that I ended up having to modify a couple of buggy Apple system headers to make it all compile correctly (as it compiles 10.3+/PCC and 10.4+/x86 now).  That's the main reason that I haven't committed an updated project file, because I have yet to be able to figure out how to get it building properly without fixing Apple's broken headers first (from the 10.3 SDK specifically).

 

Offline blowfish

  • 211
  • Join the cult of KILL MY ROUTER!!!!!!!!!!1
Re: Unable to compile in Xcode.
All right then ... I guess I'll just have to wait until someone does update it for me to be able to screw around with the code.  There are compile errors other than the ones I mentioned, and I'm not familiar enough with the code to know how to fix them.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Unable to compile in Xcode.
It has been quite a while since it was updated actually.  I've got a newer/working project set up, but it's for my Xt tree, which is different from what's in SVN, so it wouldn't work if I committed.

The current one doesn't work. If the errors would be easier to fix, commit it anyway. :lol:
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline blowfish

  • 211
  • Join the cult of KILL MY ROUTER!!!!!!!!!!1
Re: Unable to compile in Xcode.
The following files appear in the project but do not actually exist and are not referenced anywhere (the last time I checked).  Can they be removed from the project?

client.cpp
client.h
fs2ox.cpp
fs2ox.h
irc.cpp
irc.h
prtocol.h
storybook.cpp
storybook.h
TCP_Client.cpp
TCP_Socket.cpp
TCP_Socket.h
udpsocket.cpp
udpsocket.h

 

Offline Backslash

  • 29
  • Bring Our Might To Bear
Re: Unable to compile in Xcode.
Probably.  Though according to my (admittedly, MSVC) project, a few of those exist under fs2netd -- protocol.h, tcp_client.cpp, tcp_client.h, tcp_socket.cpp, tcp_socket.h .  This section/folder used to be called fs2open_pxo.

You'll probably also need to add:
   lua/linit.c
   lua/loslib.c
   lua/lua.c
   lua/luac.c
   lua/luaconf.h
   lua/print.c
   code/object/objectshield.cpp
   code/object/objectshield.h
   code/object/waypoint.cpp
   code/object/waypoint.h
   code/missionui/fictionviewer.cpp
   code/missionui/fictionviewer.h
   code/io/trackir.cpp
   code/io/trackir.h
depending on what's in there already, and maybe a few more things depending on the age of the project.

Good luck.  I hope you can get it working -- it's not a little frustrating to want to help and yet be stuck with such an issue.  I was like that the year before I joined the SCP ;).

 

Offline blowfish

  • 211
  • Join the cult of KILL MY ROUTER!!!!!!!!!!1
Re: Unable to compile in Xcode.
Thanks for the help.  It seems though, that the list of errors I get is endless (now its complaining about modelread.cpp).  I could post all of the errors I can't fix here, but do you really want me to do that?

 

Offline Backslash

  • 29
  • Bring Our Might To Bear
Re: Unable to compile in Xcode.
Maybe...

I find errors like these end up showing ridiculous numbers of errors, for just one or two little problems like a file missing.  Don't bother pasting the whole thing yet, but do the first few lines -- we want to find something specific about WHY it has problems with modelread.cpp and eliminate such things one by one.  I'm guessing modelread is referring to some other file not in the project yet, or using some function from said other file.  Ignore warnings.

Hmm...model\modelanim.h is not in the project.pbxproj... try adding that.  It's probably more than that ;)

 

Offline blowfish

  • 211
  • Join the cult of KILL MY ROUTER!!!!!!!!!!1
Re: Unable to compile in Xcode.
OK.  Here are the errors I get:

Code: [Select]
error: 'MC_pm' was not declared in this scope [line 5408]
error: 'offset' was not declared in this scope [line 5408]
error: 'mc_check_sldc' was not declared in this scope [line 5438]

Looks like its stuff having to do with shield collision tree.  I've done searches and it doesn't look like is has to do with a missing header or something.


 

Offline Backslash

  • 29
  • Bring Our Might To Bear
Re: Unable to compile in Xcode.
Ack.  That looks like more of a code bug, but one I don't run into (or know anything about) because I'm not on anything BIG_ENDIAN.  Hopefully taylor or Kazan can weigh in here.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Unable to compile in Xcode.
You could try reverting revision 4444 for now and see if that will compile.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline blowfish

  • 211
  • Join the cult of KILL MY ROUTER!!!!!!!!!!1
Re: Unable to compile in Xcode.
Still won't compile.  Looking at the two versions, I don't really see much difference in that particular section of modelread.cpp.  Actually, looking at the revision log, modelread.cpp is the same in both versions.

MC_pm isn't declared anywhere except in modelcollide.cpp.

 

Offline Backslash

  • 29
  • Bring Our Might To Bear
Re: Unable to compile in Xcode.
Yeah it's not that revision, trying to find it.

Of course, afaik that stuff isn't used anyway yet... or rather, no models have been created that have it.  It's crazy and silly, but try commenting out the lines that error.  Only a temporary fix, but if it works...

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Unable to compile in Xcode.
http://svn.icculus.org/fs2open/branches/fs2_open_3_6_9/fs2_open/code/model/modelread.cpp?r1=4444&r2=4443&pathrev=4444

It's that revision that added the changes which seem to be causing your problems. It added the swap_sldc_data() function.

Remove
Code: [Select]
swap_sldc_data(pm->shield_collision_tree);
And add revert the changes here


You can put them back once the code works but for now it probably will cure your problem.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline blowfish

  • 211
  • Join the cult of KILL MY ROUTER!!!!!!!!!!1
Re: Unable to compile in Xcode.
OK after removing swap_sldc_data, it seems to do fine with modelread.cpp, but then I get these two errors:

Code: [Select]
ld: duplicate symbol _main in /Users/joeydwong/fs2_open/projects/Xcode/build/FS2_Open_test.build/Debug/FS2_Open.build/Objects-normal/ppc/lua.o and /Users/joeydwong/fs2_open/projects/Xcode/build/FS2_Open_test.build/Debug/FS2_Open.build/Objects-normal/ppc/SDLMain.o

ld: duplicate symbol _main in /Users/joeydwong/fs2_open/projects/Xcode/build/FS2_Open_test.build/Debug/FS2_Open.build/Objects-normal/i386/lua.o and /Users/joeydwong/fs2_open/projects/Xcode/build/FS2_Open_test.build/Debug/FS2_Open.build/Objects-normal/i386/SDLMain.o

AND

Code: [Select]
ld: duplicate symbol _main in /Users/joeydwong/fs2_open/projects/Xcode/build/FS2_Open_test.build/Debug/FS2_Open.build/Objects-normal/ppc/luac.o and /Users/joeydwong/fs2_open/projects/Xcode/build/FS2_Open_test.build/Debug/FS2_Open.build/Objects-normal/ppc/SDLMain.o

ld: duplicate symbol _main in /Users/joeydwong/fs2_open/projects/Xcode/build/FS2_Open_test.build/Debug/FS2_Open.build/Objects-normal/i386/luac.o and /Users/joeydwong/fs2_open/projects/Xcode/build/FS2_Open_test.build/Debug/FS2_Open.build/Objects-normal/i386/SDLMain.o

If I remove lua.c and luac.c (or just comment out the main() functions in those files), then I get the same type of unidentifiable errors I experienced in my first post.


 

Offline taylor

  • Super SCP/Linux Guru
  • Moderator
  • 212
    • http://www.icculus.org/~taylor
Re: Unable to compile in Xcode.
I just updated all of the OS X stuff, so it should be up to date and working now.  Just grab an update and you should be good to go.

 

Offline blowfish

  • 211
  • Join the cult of KILL MY ROUTER!!!!!!!!!!1
Re: Unable to compile in Xcode.
THANK YOU SO MUCH!!! :nod: :yes:

But I must ask, how did you fix the errors I encountered?

 

Offline taylor

  • Super SCP/Linux Guru
  • Moderator
  • 212
    • http://www.icculus.org/~taylor
Re: Unable to compile in Xcode.
Those modelread.cpp issues appeared to be a copy&paste issue, so I took out the Mc_pm stuff and replaced it with the passed buffer ptr, took out the offset var that wasn't needed, and took out the mc_check_sldc() calls since those aren't needed for serialization.  For the main() stuff I didn't do anything special.  I didn't add in luac.c, but that's about it.  Other than that I just replaced the frameworks with the newer setup I have for the Xt builds, updated the version numbers everywhere, added all new files and removed all old ones, and then did the builds as normal.

I'm pretty used to constantly having to fix the Xcode project setup though, so I'm sure that I can make it look easier than it actually is. :)

 

Offline blowfish

  • 211
  • Join the cult of KILL MY ROUTER!!!!!!!!!!1
Re: Unable to compile in Xcode.
You SCP guys amaze me.