Game Development Community

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:

/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...
Page «Previous 1 2 3 Last »
#1
11/25/2005 (9:31 am)
Hey just curious on how you did get it to build, I haven't been able to do it.
Thanks!
#2
11/25/2005 (10:34 am)
That depends; what step are you on? I know there are lots of errors that you'll encounter, but they occur in a specific order.

Is it the Xcode project?
resManager.h?
event.h?
t2dUtility.cc?
libvorbis?

Something else I've missed?
#3
11/25/2005 (11:11 am)
I'm getting:

Missing file or directory: ../engine/T2D/fxAnimatedSprite2D.cc
Missing file or directory: ../engine/T2D/fxAnimationController2D.cc
Missing file or directory: ../engine/T2D/fxBaseDatablock2D.cc
Missing file or directory: ../engine/T2D/fxChunkedImageDatablock2D.cc
Missing file or directory: ../engine/T2D/fxChunkedSprite2D.cc
Missing file or directory: ../engine/T2D/fxGraphField2D.cc
Missing file or directory: ../engine/T2D/fxImageMapDatablock2D.cc
Missing file or directory: ../engine/T2D/fxParticleEffect2D.cc
Missing file or directory: ../engine/T2D/fxParticleEmitter2D.cc
Missing file or directory: ../engine/T2D/fxPhysics2D.cc
Missing file or directory: ../engine/T2D/fxSceneContainer2D.cc
Missing file or directory: ../engine/T2D/fxSceneGraph2D.cc
Missing file or directory: ../engine/T2D/fxSceneObject2D.cc
Missing file or directory: ../engine/T2D/fxSceneWindow2D.cc
Missing file or directory: ../engine/T2D/fxScroller2D.cc
Missing file or directory: ../engine/T2D/fxStaticSprite2D.cc
Missing file or directory: ../engine/T2D/fxTileMap2D.cc
Missing file or directory: ../engine/T2D/fxUtility2D.cc
Missing file or directory: ../engine/T2D/fxVector2D.cc
Missing file or directory: ../engine/dgl/rectClipper.cc
Missing file or directory: ../engine/T2D/fxGlobals2D.cc

Thanks a lot :-)
#4
11/26/2005 (11:26 am)
That looks like the wrong name problem: the directory was named t2d instead of T2D IIRC which causes problems with case sensitive file systems.

Second, there files are named wrong. For example, fxAnimatedSprite2D.cc should be t2dAnimatedSprite.cc
#5
11/26/2005 (6:12 pm)
Easiest way to update this is to find the fx*.cc and fx*.h files in Xcode which are colored red. Highlight and delete them. Right-click on the Torque2D Group and select Add | Existing Files. Then, in the panel that opens up, go over to engine/T2D, highlight all the t2d*.cc and t2d*.h files and click Add.

When presented with the list of the targets, add the files to both of them (check the boxes on the left), and click Add. This will add everything properly.

Now you should be able to continue the build.
#6
11/26/2005 (6:13 pm)
@Tim: No, this is more of an Xcode project problem. GG has already said it was out of whack.
#7
11/26/2005 (6:14 pm)
Thanks so much Scott!
#8
11/26/2005 (6:15 pm)
@Bob: You're very welcome. Hit me when you get to the next error.
#9
11/26/2005 (7:18 pm)
Hehe... Now I'm getting this:
Missing file or directory: ../engine/dgl/rectClipper.cc
Thanks so much!
#10
11/26/2005 (9:17 pm)
Just remove that reference. I found that file in the 1.0.2 release as well as TGE 1.3. There are no references in the code for it in 1.1a - I just removed it from the project and it built through. It looks to be removed in the 1.4 tree.
#11
11/26/2005 (9:55 pm)
Cool, once again thank you so much!
#12
11/26/2005 (10:05 pm)
Hehe, more fun errors!
../engine/core/resManager.h: In member function 'void Resource<T>::unlock()':
../engine/core/resManager.h:255: error: invalid use of undefined type 'struct ResManager'
../engine/core/resManager.h:38: error: forward declaration of 'struct ResManager'
../engine/core/resManager.h: In member function 'void Resource<T>::purge()':
../engine/core/resManager.h:263: error: invalid use of undefined type 'struct ResManager'
../engine/core/resManager.h:38: error: forward declaration of 'struct ResManager'
../engine/core/resManager.h:265: error: invalid use of undefined type 'struct ResManager'
../engine/core/resManager.h:38: error: forward declaration of 'struct ResManager'
../engine/core/resManager.h: In member function 'void Resource<T>::_unlock()':
../engine/core/resManager.h:278: error: invalid use of undefined type 'struct ResManager'
../engine/core/resManager.h:38: error: forward declaration of 'struct ResManager'
...failed CompileCplusplus /Users/max/Desktop/GarageGames Stuff/T2D Stuff/ALPHA_T2D-SDK_1-1/pb/build/Torque2D.build/Development/Torque2D-MacCarb-Debug.build/Objects-normal/ppc/compiledEval.o ...
Would it be same to assume to delete resManager.h?
#13
11/26/2005 (10:39 pm)
Heh. This is a cool error.

Do NOT delete the resManager.h.

Open up the resManager.h. Move lines 252 through 279 to the end of the file, just before the #endif.

So, you'll be moving everything from "template inline void Resource::unlock()" down to a "}".
#14
11/26/2005 (10:54 pm)
Ok cool!
Now on to the event.h error!
../engine/platform/event.h:137: error: a cast to a type other than an integral or enumeration type cannot appear in a constant-expression
../engine/platform/event.h:137: error: '->' cannot appear in a constant-expression
../engine/platform/event.h:137: error: '&' cannot appear in a constant-expression
../engine/platform/event.h:137: error: a cast to a type other than an integral or enumeration type cannot appear in a constant-expression
../engine/platform/event.h:137: error: a cast to a type other than an integral or enumeration type cannot appear in a constant-expression
../engine/platform/event.h:140: error: a cast to a type other than an integral or enumeration type cannot appear in a constant-expression
../engine/platform/event.h:140: error: '->' cannot appear in a constant-expression
../engine/platform/event.h:140: error: '&' cannot appear in a constant-expression
../engine/platform/event.h:140: error: a cast to a type other than an integral or enumeration type cannot appear in a constant-expression
../engine/platform/event.h:140: error: a cast to a type other than an integral or enumeration type cannot appear in a constant-expression
../engine/platform/event.h:143: error: a cast to a type other than an integral or enumeration type cannot appear in a constant-expression
../engine/platform/event.h:143: error: '->' cannot appear in a constant-expression
../engine/platform/event.h:143: error: '&' cannot appear in a constant-expression
../engine/platform/event.h:143: error: a cast to a type other than an integral or enumeration type cannot appear in a constant-expression
../engine/platform/event.h:143: error: a cast to a type other than an integral or enumeration type cannot appear in a constant-expression
hehe, by the time I get this working version 1.1 is gonna be final lol
Thanks a ton!
#15
11/26/2005 (11:20 pm)
The block from 133 to 145, replace the code with this:

/// Header sizes for events defined later on.
/// Byte offset to payload of a PacketReceiveEvent
const U32 PacketReceiveEventHeaderSize = Offset(data,PacketReceiveEvent);
/// Byte offset to payload of a ConnectedReceiveEvent
const U32 ConnectedReceiveEventHeaderSize = Offset(data,ConnectedReceiveEvent);
/// Byte offset to payload of a ConsoleEvent
const U32 ConsoleEventHeaderSize = Offset(data,ConsoleEvent);
#16
11/26/2005 (11:21 pm)
Other than the vorbis error (just run "ranlib *.a" inside lib/vorbis/macosx), I'm not sure what's next.
#17
11/27/2005 (8:58 am)
Almost there!
../engine/platformMacCarb/macCarbFileio.cc:850: error: prototype for 'bool Platform::dumpPath(const char*, Vector<Platform::FileInfo>&)' does not match any in class 'Platform'
../engine/platform/platform.h:337: error: candidate is: static bool Platform::dumpPath(const char*, Vector<Platform::FileInfo>&, S32)
...failed CompileCplusplus /Users/max/Desktop/GarageGames Stuff/T2D Stuff/ALPHA_T2D-SDK_1-1/pb/build/Torque2D.build/Development/Torque2D-MacCarb-Debug.build/Objects-normal/ppc/macCarbFileio.o ...
Thanks again Scott! You are so helpful!
#18
11/27/2005 (9:11 am)
Hm. Let's see...

In engine/platformMacCarb/macCarbFileio.cc, change line 850 to read:

static bool Platform::dumpPath(const char *in_pBasePath, Vector<FileInfo>& out_rFileVector, S32 recurseDepth = -1)

I'm glad you're getting it this far, and we're recording it for anyone else to use.
#19
11/27/2005 (9:19 am)
Ok, on to the next one!
../engine/T2D/t2dAnimatedSprite.cc:365:1: error: pasting "loadStream_4" and "," does not give a valid preprocessing token
../engine/T2D/t2dAnimatedSprite.cc:365:1: error: pasting "saveStream_4" and "}" does not give a valid preprocessing token
...failed CompileCplusplus /Users/max/Desktop/GarageGames Stuff/T2D Stuff/ALPHA_T2D-SDK_1-1/pb/build/Torque2D.build/Development/Torque2D-MacCarb-Debug.build/Objects-normal/ppc/t2dAnimatedSprite.o ...
Yet again thanks for the awesomely fast replies!
#20
11/27/2005 (9:52 am)
Right now, my fast replies are because I'm unloading my memory cards for my digicam and recharging the batteries (wife and youngest son are napping, so I get online =)

David Bunt already found the solution for that one when he was working on a build for Linux. His response to my query of the exact same problem can be found in this article.
Page «Previous 1 2 3 Last »