ALPHA 1.1: Mac: Undefined symbols
by Scott Coursey · in Torque Game Builder · 11/24/2005 (10:54 pm) · 46 replies
I've successfully gotten T2D to build on my Mac. I could do a write-up on what I did, but most steps are covered elsewhere. The one thing I did find rather odd, and if anyone knows of a better way, then please let me know, was the use of "inline" in engine/T2D/t2dUtility.cc was breaking the final link.
I was getting errors such as:
The mSwap is an inline function inside t2dUtility.cc. I went in and removed all "inline" phrases and rebuilt. Everything worked. The T2D example also comes up nicely.
Now to play...
I was getting errors such as:
/usr/bin/ld: warning prebinding disabled because of undefined symbols /usr/bin/ld: Undefined symbols: mSwap(float&, float&) collect2: ld returned 1 exit status
The mSwap is an inline function inside t2dUtility.cc. I went in and removed all "inline" phrases and rebuilt. Everything worked. The T2D example also comes up nicely.
Now to play...
#22
Then continue the build.
11/27/2005 (11:22 am)
This is a classic TGE/T2D error (of sorts). Go into lib/vorbis/macosx and run:ranlib *.a
Then continue the build.
#23
Thanks
11/27/2005 (11:40 am)
Lol, I can't believe I didn't remember to do that, I've done it quite a few times before.Thanks
#24
yey!
11/27/2005 (12:14 pm)
Ok, I think we're almost there!yey!
/usr/bin/ld: warning prebinding disabled because of undefined symbols /usr/bin/ld: Undefined symbols: Resource<GFont>::_lock() Resource<GFont>::unlock() GameConnection::CurrentProtocolVersion GameConnection::MinRequiredProtocolVersion Resource<GFont>::_unlock() T2DDatablockDropDownCtrl::setFilter(char const*) T2DDatablockDropDownCtrl::T2DDatablockDropDownCtrl() Resource<AudioBuffer>::_lock() Resource<AudioBuffer>::purge() Resource<AudioBuffer>::unlock() Resource<AudioBuffer>::_unlock() mGetT2DRandomF(float, float) mGreaterThanOrEqual(float const&, float const&) mSwap(float&, float&) mNotZero(float const&) mGetMinMax(float const&, float const&, float&, float&) mLessThanZero(float const&) mGreaterThanZero(float const&) mLessThanOrEqual(float const&, float const&) mIsOne(float const&) collect2: ld returned 1 exit status ...failed StandaloneExecutable.LinkUsingFileList /Users/max/Desktop/GarageGames_Stuff/T2D_Stuff/ALPHA_T2D-SDK_1-1/pb/build/Development/T2D-Debug-OSX.app/Contents/MacOS/T2D-Debug-OSX ...Thanks again Scott!
#25
As far as the others, I'm not too sure. I don't recall getting those. Try doing a clean build and see if the errors are any different (after modifying the t2dUtility.cc, that is).
---
Oh, now I remember about the GameConnection errors... Remove the gameConnection.cc from Xcode, then add it back in to both binaries. It's currently not set properly.
11/27/2005 (1:54 pm)
Ah, well, you see all those functions that begin with an "m"? Read the very top of this post. Remove all "inline"s from t2dUtility.cc.As far as the others, I'm not too sure. I don't recall getting those. Try doing a clean build and see if the errors are any different (after modifying the t2dUtility.cc, that is).
---
Oh, now I remember about the GameConnection errors... Remove the gameConnection.cc from Xcode, then add it back in to both binaries. It's currently not set properly.
#26
11/28/2005 (3:35 pm)
Bob, how's the progress? Any more errors?
#28
made a mistake and deleted all lines with inline instead of just the words inline!
thanks Scott
looking to port my game now...
11/28/2005 (5:36 pm)
All works fine nowmade a mistake and deleted all lines with inline instead of just the words inline!
thanks Scott
looking to port my game now...
#30
11/28/2005 (5:52 pm)
Ok, now I'm getting this:/usr/bin/ld: warning prebinding disabled because of undefined symbols /usr/bin/ld: Undefined symbols: Resource<GFont>::_lock() Resource<GFont>::unlock() Resource<GFont>::_unlock() T2DDatablockDropDownCtrl::setFilter(char const*) T2DDatablockDropDownCtrl::T2DDatablockDropDownCtrl() Resource<AudioBuffer>::_lock() Resource<AudioBuffer>::purge() Resource<AudioBuffer>::unlock() Resource<AudioBuffer>::_unlock() collect2: ld returned 1 exit status ...failed StandaloneExecutable.LinkUsingFileList /Users/max/Desktop/GarageGames_Stuff/T2D_Stuff/ALPHA_T2D-SDK_1-1/pb/build/Development/T2D-Debug-OSX.app/Contents/MacOS/T2D-Debug-OSX ...
#31
The T2DDatablockDropDownCtrl is because engine/T2D/sceneedit/gui2DDatablockDropDown.cc is missing from the project.
Add it to Xcode and apply to both targets.
Not too sure about the Resource ones.
11/28/2005 (8:44 pm)
Those are coming from resManager.cc and .h. Check over those files against the ones you downloaded and make sure nothing, other than the changes I suggested, was modified.The T2DDatablockDropDownCtrl is because engine/T2D/sceneedit/gui2DDatablockDropDown.cc is missing from the project.
Add it to Xcode and apply to both targets.
Not too sure about the Resource ones.
#32
I have no idea how to do this. Could you maybe spell this out a little better? Thanks!
-Peter
12/01/2005 (7:34 pm)
I was trying to get my copy to work (great work documenting the whole process guys) until I got to this step...Quote:
This is a classic TGE/T2D error (of sorts). Go into lib/vorbis/macosx and run:
ranlib *.a
I have no idea how to do this. Could you maybe spell this out a little better? Thanks!
-Peter
#33
One must first run "ranlib". So, the lengthy description of a simple problem is this:
1. Open a Terminal.
2. cd into lib/vorbis/macosx
(this is relative to the root of the engine's location. For me, I usually drop it into my
home directory. So, inside Terminal, I'd type: cd ~/projects/torque/t2d_11a1/lib/vorbis/macosx )
3. Enter "ranlib *.a" in Terminal. This will run "ranlib" on both of the ".a" files in there.
After this is done (a second or two of running ranlib), hit Build (CMD-B) in Xcode to complete the build. If everything goes properly, then it should say it succeeded.
Am I leaving this out? If so, I apologize. I come from a UNIX/Linux background, where everyone I spoke to inherently knew the development tools without having to explain them.
12/01/2005 (8:59 pm)
Certainly. The compilation process creates a set of vorbis libraries which, immediately after compile, may not be linked against.One must first run "ranlib". So, the lengthy description of a simple problem is this:
1. Open a Terminal.
2. cd into lib/vorbis/macosx
(this is relative to the root of the engine's location. For me, I usually drop it into my
home directory. So, inside Terminal, I'd type: cd ~/projects/torque/t2d_11a1/lib/vorbis/macosx )
3. Enter "ranlib *.a" in Terminal. This will run "ranlib" on both of the ".a" files in there.
After this is done (a second or two of running ranlib), hit Build (CMD-B) in Xcode to complete the build. If everything goes properly, then it should say it succeeded.
Am I leaving this out? If so, I apologize. I come from a UNIX/Linux background, where everyone I spoke to inherently knew the development tools without having to explain them.
#34
So where do I go from here? Did Bob ever get this working? I'm gonna guess that I need to add another file to the project.
-Peter
12/02/2005 (10:07 am)
Okay. Thanks for breaking that down. I got it! Then I added the file gameconnection and now I'm left with this:/usr/bin/ld: warning prebinding disabled because of undefined symbols /usr/bin/ld: Undefined symbols: Resource<GFont>::_lock() Resource<GFont>::unlock() Resource<GFont>::_unlock() Resource<AudioBuffer>::_lock() Resource<AudioBuffer>::purge() Resource<AudioBuffer>::unlock() Resource<AudioBuffer>::_unlock() collect2: ld returned 1 exit status ...failed StandaloneExecutable.LinkUsingFileList /Users/peterrobinson/Desktop/ALPHA_T2D-SDK_1-1/pb/build/T2D-Debug-OSX.app/Contents/MacOS/T2D-Debug-OSX ...
So where do I go from here? Did Bob ever get this working? I'm gonna guess that I need to add another file to the project.
-Peter
#35
What version of Mac OS are you runing?
What version of GCC do you have?
Try removing the "inline" from the "inline void" declarations on lines 269, 260, 252 and 275.
If you still get some errors, clean the build and try again once more.
12/02/2005 (7:07 pm)
Ok. Really Stupid Question Time (tm).What version of Mac OS are you runing?
What version of GCC do you have?
Try removing the "inline" from the "inline void" declarations on lines 269, 260, 252 and 275.
If you still get some errors, clean the build and try again once more.
#36
GCC?
I already removed a bunch of "inlines". Which file are we talking about?
-Peter
12/02/2005 (7:10 pm)
I'm running 10.4.3GCC?
I already removed a bunch of "inlines". Which file are we talking about?
-Peter
#37
GCC is the compiler on the Mac. If you type "gcc -v" in Terminal, you get the version. Since you said you're running 10.4.3, then you have gcc 4.0.
I find it very odd that you're getting these errors and I am not.
12/02/2005 (7:50 pm)
Oh, I'm sorry I didn't say which file. resManager.hGCC is the compiler on the Mac. If you type "gcc -v" in Terminal, you get the version. Since you said you're running 10.4.3, then you have gcc 4.0.
I find it very odd that you're getting these errors and I am not.
#38
-Peter
12/06/2005 (3:42 pm)
Well I had to go all the way through this post again but I'm happy to announce that it works! Thanks Scott!-Peter
#39
12/06/2005 (6:21 pm)
Excellent news! I'm glad it worked for you!
#40
With a little checking I found that GuiDirectoryTreeCtrl and GuiDirectoryFileListCtrl aren't added to the xcode project. So I add them and compile. And I get... Undefined symbols.
So I'm going to assume something needs to be fixed in these files. But I'm not sure what. Any ideas?
-Peter
12/06/2005 (9:08 pm)
I got the program compiling but I still need to get it working. In particular I can't save tilemaps (amoung other things). So I checked the console and found some errors that look something like this. Loading compiled script common/ui/SaveFileDlg.gui. common/ui/SaveFileDlg.gui (0): Unable to instantiate non-conobject class GuiDirectoryTreeCtrl. common/ui/SaveFileDlg.gui (0): Unable to instantiate non-conobject class GuiDirectoryFileListCtrl.
With a little checking I found that GuiDirectoryTreeCtrl and GuiDirectoryFileListCtrl aren't added to the xcode project. So I add them and compile. And I get... Undefined symbols.
/usr/bin/ld: Undefined symbols: Platform::hasSubDirectory(char const*) collect2: ld returned 1 exit status
So I'm going to assume something needs to be fixed in these files. But I'm not sure what. Any ideas?
-Peter
Torque Owner Bob
Getting closer!