Game Development Community

Error from linker.

by Rob Stiles · in iTorque 2D · 08/21/2009 (8:28 pm) · 5 replies

Hi,

I've just bought iTGB and I thought I'd first load up one of the example projects (iPhoneTest) and try and install it on my iPhone. I already have my own code signing certificates. I generated the XCode project from iTGB but when I attempt to build it in XCode I get this error from the linker:

cd /Applications/iTGB_1_2/engine/compilers/Xcode_iPhone
setenv IPHONEOS_DEPLOYMENT_TARGET 3.0
setenv MACOSX_DEPLOYMENT_TARGET 10.5
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 -arch armv6 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk -L/Applications/iTGB_1_2/engine/compilers/Xcode_iPhone/build/Release-iphoneos -L"/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/System/Library/Frameworks/CoreGraphics.framework" -F/Applications/iTGB_1_2/engine/compilers/Xcode_iPhone/build/Release-iphoneos "-F\"/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks\"
" -F"/Applications/iTGB_1_2/engine/compilers/Xcode_iPhone/../../lib/xiph/iPhone" -filelist /Applications/iTGB_1_2/engine/compilers/Xcode_iPhone/build/Torque2D.build/Release-iphoneos/iTGB.build/Objects-normal/armv6/iPhoneTest.LinkFileList -mmacosx-version-min=10.5 -Wl,-dead_strip -miphoneos-version-min=3.0 -framework Foundation -framework UIKit -framework OpenGLES -framework QuartzCore -lz -framework CoreGraphics -framework AudioToolbox -framework OpenAL -framework CoreAudio -shared-libgcc -lstdc++-static -prebind -o /Applications/iTGB_1_2/engine/compilers/Xcode_iPhone/build/Release-iphoneos/iPhoneTest.app/iPhoneTest
ld: library not found for -lstdc++-static
collect2: ld returned 1 exit status
ld: library not found for -lstdc++-static
collect2: ld returned 1 exit status

Sorry if this is a noob question but I don't know what I'm doing wrong.

Thanks,

Rob.

#1
08/21/2009 (8:34 pm)
Aha! It *is* a noob question. Sorry!

I just switched it to version 2.0 of the SDK via the menu and it's built and installed on my phone perfectly.

Project -> Set Active SDK -> iPhone Device 2.0

:)
#2
11/28/2009 (2:15 pm)
Did anyone determine the specific answer for handling this with Device 3.0 and up? You've bypassed the problem but it will return with 1.3 iTGB.

Looks like that issue is referenced in this thread: http://www.garagegames.com/community/forums/viewthread/90557/2
#3
11/28/2009 (2:22 pm)
After a lot of digging, I have figured out that the static stdc++ libraries are no longer found in the 3.0 SDK - you can get around this by copying them from 2.2.1 or switching to Dynamic but I can see even in a compile for Mac there is a framerate hit from dynamic and don't know if you can do this for iPhone distro.
#4
11/28/2009 (6:11 pm)
Static/dynamic shouldn't affect framerate at all. You should always use dynamic, and if there are framerate issues, check that Thumb code isn't selected.
#5
11/29/2009 (4:41 pm)
Note on use of static - that is how 1.3 Beta iTGB creates the project and this issue is introduced by the iTGB product. If dynamic is vetted as correct and performance validated, the 1.3 product should generate XCode make files with this specified.

A manual workaround (not a fix) is to right-click on the Target iTGB (and iTGB_Script_Optimize), scroll down to / Linking, click C++ Standard Library Type, change this to Dynamic.

Alternatively, the setenv PATH should include the 2.2.1 sdk in secondary priority to pick up the 2.2.1 static library.

UPDATE: a retest shows no degradation on the framerate this time using the dynamic linking. Unsure why it showed on the first test run, possibly some other setting.