Forum Discussion
hesham
12 years agoProtege
Linking Error on OSX
Any thoughts on this? I've added the headers and link to libovr.a, not sure if this is something missing from the library or I need to rebuild the SDK locally or what...
Error:
Linking command from Xcode:
Error:
Undefined symbols for architecture x86_64:
"typeinfo for OVR::Allocator", referenced from:
typeinfo for OVR::Allocator_SingletonSupport<OVR::DefaultAllocator> in AppDelegate.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Linking command from Xcode:
Ld /Users/hesh/Library/Developer/Xcode/DerivedData/IbexMac-csekgxtfsfhfishdfaqcsplitscj/Build/Products/Debug/IbexMac.app/Contents/MacOS/IbexMac normal x86_64
cd /Users/hesh/Documents/ibex
setenv MACOSX_DEPLOYMENT_TARGET 10.8
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -L/Users/hesh/Library/Developer/Xcode/DerivedData/IbexMac-csekgxtfsfhfishdfaqcsplitscj/Build/Products/Debug -L/usr/local/lib -L/Users/hesh/Documents/ibex/../OculusSDK/LibOVR/Lib/MacOS/Release -F/Users/hesh/Library/Developer/Xcode/DerivedData/IbexMac-csekgxtfsfhfishdfaqcsplitscj/Build/Products/Debug -F/Library/Frameworks -filelist /Users/hesh/Library/Developer/Xcode/DerivedData/IbexMac-csekgxtfsfhfishdfaqcsplitscj/Build/Intermediates/IbexMac.build/Debug/IbexMacRelease.build/Objects-normal/x86_64/IbexMac.LinkFileList -mmacosx-version-min=10.8 -fobjc-arc -fobjc-link-runtime -stdlib=libc++ -framework IOKit -framework BulletCollision -framework BulletDynamics -framework BulletMultiThreaded -framework BulletSoftBody -framework BulletSoftBodySolvers_OpenCL_Mini -framework LinearMath -framework MiniCL -lsixense_utils_x64 -lsixense_x64 -framework CoreFoundation -framework ApplicationServices -framework Carbon -framework QuartzCore -framework CoreVideo -framework GLUT -framework OpenGL -framework Cocoa -lovr -o /Users/hesh/Library/Developer/Xcode/DerivedData/IbexMac-csekgxtfsfhfishdfaqcsplitscj/Build/Products/Debug/IbexMac.app/Contents/MacOS/IbexMac
16 Replies
- cyberealityGrand ChampionNot too familiar with OSX development myself, but I will see if anyone here knows more.
- heshamProtegeThe line causing the error is:
OVR::System::Init(OVR::Log::ConfigureDefaultLog(OVR::LogMask_All));
I've tried recompiling the SDK on my system and the demo apps and they work. The only difference is the demo apps have the initialization occur within the library to create their windows and so on whereas my app creates its own. I haven't checked to see if Windows has the same issue with the updated SDK yet. Hopefully someone writing a Mac app can comment if they've run into this or fixed it :) - heshamProtegeFinal update. Rebuilding the SDK using only 64-bit as a target instead of 32-bit/64-bit and changing my system target to 10.8 as well as changing the C++ Exceptions/Runtime Exceptions to off worked. I could probably get away with doing less, but just making sure that your compiler, your C++ settings match in both the library and your app are what's needed.
- areisseHonored GuestYou should be able to build any configuration as long as runtime type information and exceptions are both off. You should be able to use a deployment target of 10.6 (this is what we aim to support now), unless of course your application needs to use a feature of 10.7 or 10.8.
Since all the source is included, you can also change the configuration and rebuild libovr (in your case you could turn exceptions and runtime type information on in the libovr_With_Samples project). - sthHonored GuestJust for reference: -fno-rtti and -fno-exceptions are the required flags for gcc/clang.
- steeveExplorerI got it building with only -fno-rtti
- FrimHonored GuestHi Guys
I get a similar error and I have set the following properties:
I have set my Header Search Path to:
. . . /OculusSDK/LibOVR/Include/
My Library Search Path (Both Debug and Release) to:
. . . /OculusSDK/LibOVR/Lib/MacOS/$(CONFIGURATION)
I have also set my OS X Deployment Target to OS X 10.8, and Enable C++ Exceptions to NO
and Enable C++ Runtime Types to NO.
The code I'm running:
(Main.cpp)
#include "Main.h"
#include "OVR.h"
using namespace OVR;
Ptr<DeviceManager> pManager;
Ptr<HMDDevice> pHMD;
Ptr<SensorDevice> pSensor;
SensorFusion FusionResult;
int main(){
}
(Main.h)
#ifndef __MinimalOculus__Main__
#define __MinimalOculus__Main__
#include <iostream>
#endif
The error I get:
Undefined symbols for architecture x86_64:
"OVR::SensorFusion::SensorFusion(OVR::SensorDevice*)", referenced from:
___cxx_global_var_init4 in Main.o
"OVR::SensorFusion::~SensorFusion()", referenced from:
___cxx_global_var_init4 in Main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation) - FrimHonored GuestHello again
I have updated to the newest version of the SDK and now I get other linking errors instead.
The settings are as they were set in earlier post, and my code:
Main.cpp
#include "Main.h"
#include "OVR.h"
using namespace OVR;
Ptr<DeviceManager> pManager;
Ptr<HMDDevice> pHMD;
Ptr<SensorDevice> pSensor;
SensorFusion FusionResult;
HMDInfo Info;
bool InfoLoaded;
void Init()
{
//System::Init(Log::ConfigureDefaultLog(LogMask_All));
System::Init();
//pManager = *DeviceManager::Create();
//pHMD = *pManager->EnumerateDevices<HMDDevice>().CreateDevice();
/*if (pHMD)
{
InfoLoaded = pHMD->GetDeviceInfo(&Info);
pSensor = *pHMD->GetSensor();
}
else
{
pSensor = *pManager->EnumerateDevices<SensorDevice>().CreateDevice();
}
if (pSensor)
{
//FusionResult.AttachToSensor(pSensor);
}
*/
}
void Clear()
{
pSensor.Clear();
pHMD.Clear();
pManager.Clear();
System::Destroy();
}
int main()
{
Init();
Clear();
}
Main.h#ifndef __MinimalOculus__Main__
#define __MinimalOculus__Main__
#include <iostream>
#endif
Error:Undefined symbols for architecture x86_64:
"_CFRelease", referenced from:
OVR::OSX::HMDDeviceFactory::EnumerateDevices(OVR::DeviceFactory::EnumerateVisitor&) in libovr.a(OVR_OSX_HMDDevice.o)
"_CGDisplayBounds", referenced from:
OVR::OSX::HMDDeviceFactory::EnumerateDevices(OVR::DeviceFactory::EnumerateVisitor&) in libovr.a(OVR_OSX_HMDDevice.o)
"_CGDisplayIOServicePort", referenced from:
OVR::OSX::HMDDeviceFactory::EnumerateDevices(OVR::DeviceFactory::EnumerateVisitor&) in libovr.a(OVR_OSX_HMDDevice.o)
"_CGDisplayModelNumber", referenced from:
OVR::OSX::HMDDeviceFactory::EnumerateDevices(OVR::DeviceFactory::EnumerateVisitor&) in libovr.a(OVR_OSX_HMDDevice.o)
"_CGDisplayPixelsHigh", referenced from:
OVR::OSX::HMDDeviceFactory::EnumerateDevices(OVR::DeviceFactory::EnumerateVisitor&) in libovr.a(OVR_OSX_HMDDevice.o)
"_CGDisplayPixelsWide", referenced from:
OVR::OSX::HMDDeviceFactory::EnumerateDevices(OVR::DeviceFactory::EnumerateVisitor&) in libovr.a(OVR_OSX_HMDDevice.o)
"_CGDisplayVendorNumber", referenced from:
OVR::OSX::HMDDeviceFactory::EnumerateDevices(OVR::DeviceFactory::EnumerateVisitor&) in libovr.a(OVR_OSX_HMDDevice.o)
"_CGGetOnlineDisplayList", referenced from:
OVR::OSX::HMDDeviceFactory::EnumerateDevices(OVR::DeviceFactory::EnumerateVisitor&) in libovr.a(OVR_OSX_HMDDevice.o)
"_IODisplayCreateInfoDictionary", referenced from:
OVR::OSX::HMDDeviceFactory::EnumerateDevices(OVR::DeviceFactory::EnumerateVisitor&) in libovr.a(OVR_OSX_HMDDevice.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Any ideas? - jhericoAdventurerUnlike the previous linking errors, those missing references are all symbols from outside the SDK. Searches for those and similar symbols on Google leads me to believe they're part of Carbon. Can you re-run with -v and post the actual linking command as well so we can see what libraries / frameworks are getting linked in?
- FrimHonored Guest
"jherico" wrote:
Unlike the previous linking errors, those missing references are all symbols from outside the SDK. Searches for those and similar symbols on Google leads me to believe they're part of Carbon. Can you re-run with -v and post the actual linking command as well so we can see what libraries / frameworks are getting linked in?
Alright! . . . But how, do I put it in the Arguments Passed On Launch?
[Edit1]
Or maybe it's this your looking for?Ld /OculusSDK/LibOVR/Lib/MacOS/Debug/MinimalOculus normal x86_64
cd "/MinimalOculus"
setenv MACOSX_DEPLOYMENT_TARGET 10.6
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -L/OculusSDK/LibOVR/Lib/MacOS/Debug -L/OculusSDK/LibOVR/Lib/MacOS/Debug -F/OculusSDK/LibOVR/Lib/MacOS/Debug -filelist /OculusSDK/LibOVR/Lib/MacOS/Debug/MinimalOculus.build/Debug/MinimalOculus.build/Objects-normal/x86_64/MinimalOculus.LinkFileList -mmacosx-version-min=10.6 -stdlib=libstdc++ -o /OculusSDK/LibOVR/Lib/MacOS/Debug/MinimalOculus
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 19 days ago