Qt Creator: Undefined symbols for architecture x86_64 - macos

I have a program in Qt creator that compiles and runs fine in a Windows machine. But as soon as I tried to compile it in a Mac OS X (10.9) I received these messages:
Undefined symbols for architecture x86_64:
"std::__1::__basic_string_common<true>::__throw_length_error() const", referenced from:
std::__1::enable_if<__is_forward_iterator<char*>::value, void>::type std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__init<char*>(char*, char*) in libVolumeSelectorLib.a(NetCDFDataSource.o)
...
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [UI.app/Contents/MacOS/UI] Error 1
14:38:02: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project VVSIT (kit: Desktop Qt 5.4.0 clang 64bit)
When executing step "Make"
I have tried cleaning and compiling again in case some file built on Windows had made it to the Mac, but that is not the case, the problem continues happening.
I've checked these posts but their solutions didn't work:
Undefined symbols for architecture x86_64 in QT-creator
https://stackoverflow.com/questions/23806544/undefined-symbols-for-architecture-x86-64-in-qt-creator
Any idea how to solve this error?

After some research I found this thread: Qt5.1/Qt5.2 + XCode 5.0.2 + Mac OS 10.9 (Mavericks), Can’t link to the libraries
That link contains the solution that worked for me, I had to edit the file:
/Applications/Qt/5.4/clang_64/mkspecs/macx-clang/qmake.conf
And change the line that says:
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.7
to:
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.9
After that, I cleaned every subproject in my project, and compiled them again, and all is working fine now.
In case you wonder what does that change in the clang++ do, what it does is to change the parameter -mmacosx-version-min=10.7 to -mmacosx-version-min=10.9.

Related

What files do i need to link to my xcode project (built in gamemaker) to make it work?

I have seen similar issues on here which has led me to believe i need to link binary files with library. However, i cannot figure out which ones i need, can any one help me with this ? I have macOS catalina 10.15.3, xcode 10.3, gamemaker 2.2.5.481 and runtime v2.2.5.378
here is my error message:
Undefined symbols for architecture x86_64:
"___isPlatformVersionAtLeast", referenced from:
UpdateIOSControllers() in libyoyo_interpreted.a(IOSGamepad.o)
_SetHomeIndicatorDeferOption in libyoyo_interpreted.a(RunnerViewController.o)
-[RunnerViewController viewDidLoad] in libyoyo_interpreted.a(RunnerViewController.o)
Achievement_TeamPlayerID() in libyoyo_interpreted.a(YoYo_GameCenter.o)
Achievement_GamePlayerID() in libyoyo_interpreted.a(YoYo_GameCenter.o)
PB_Challenges(HTTP_REQ_CONTEXT*, void*, int*) in libyoyo_interpreted.a(YoYo_GameCenter.o)
PB_PlayerPic(HTTP_REQ_CONTEXT*, void*, int*) in libyoyo_interpreted.a(YoYo_GameCenter.o)
...
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Bluetooth gamepad support is added in iOS 13, which requires XCode 11 to work; you probably only need to upgrade xcode.
Reference:
https://forums.developer.apple.com/thread/123003

Cryptic link error. Where do I start?

I'm trying to build the basemap toolkit, from source, for matplotlib to run on my MacBook Pro under OS X 10.8. The C and C++ compiler are those included with the latest Xcode package. The package includes the geos-3.3.3 package which needs to be built separately and installed before the main basemap python package is built. When I do this, using the supplied Makefile, I get the following error when the makefile attempts to build the libgeos.dylib library:
Undefined symbols for architecture x86_64:
"std::auto_ptr<geos::geom::Envelope>::auto_ptr(std::auto_ptr_ref<geos::geom::Envelope>)", referenced from:
virtual thunk to geos::geom::GeometryCollection::computeEnvelopeInternal() constin libgeom.a(GeometryCollection.o)
"__ZNSt8auto_ptrIN4geos4geom8EnvelopeEEcvSt12auto_ptr_refIT_EIS2_EEv", referenced from:
virtual thunk to geos::geom::GeometryCollection::computeEnvelopeInternal() constin libgeom.a(GeometryCollection.o)
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
On a Fedora 17 machine, with gcc 4.7, this library builds successfully so there is obviously something going on with the Mac compiler/linker. However, I have no idea how to decode this message. What, for instance, is a "virtual thunk"? Any insight on how I can compile and build this on the Mac?
I used a different compiler and the problem went away. Try:
make CXX=c++
Worked for me. OSX 10.8.3, XCode 4.6.1.

SDL in XCode 4.3.2 SDLMain.o undefined symbols

I have started trying to use SDL in Xcode 4.3.2 so I started up a Cocoa application for Mac OS X and connected all my frameworks : OpenGL, SDL etc. I don't have SDL_Image, SDL_Mixer etc. (Do I need these?) When I try to compile the project that just has SDLmain.h and SDLmain.m I get this error:
Undefined symbols for architecture x86_64: "_SDL_main", referenced from: -[SDLMain applicationDidFinishLaunching:] in SDLMain.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
I was having the same issue with SDL 1.2.15 on Xcode 4.5 and OS X 10.7, turned out the problem was that I added SDLMain.m and SDLMain.h (according to a suggestion on the libSDL website about OS X frameworks) to an existing SDL project which messed up with main. Bottom line is that you don't need those files just because you are using Cocoa -- SDL's own test apps don't use it either and run just fine on OS X.

Xcode 4 FLTK 1.3.0 undefined architecture x86_64

Hi, I am using Xcode 4 and trying to set up FLTK 1.3.0 to run Bjarne
Stroustrup's Chapter 12 FLTK Demo at the end of the chapter. I keep
getting the following error when compiling, and have no idea where to go.
I have an idea it might have to do with the linker flags, but I don't know
what flag to add and where...
Here's the error:
Undefined symbols for architecture x86_64:
"Fl_JPEG_Image::Fl_JPEG_Image(char const*)", referenced from:
Graph_lib::Image::Image(Point, String,
Graph_lib::Suffix::Encoding) in Graph.o
"Fl_GIF_Image::Fl_GIF_Image(char const*)", referenced from:
Graph_lib::Image::Image(Point, String,
Graph_lib::Suffix::Encoding) in Graph.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see
invocation)
Are you passing the linker flags present with --use-images? try:
> fltk-config --use-images --ldflags
and check the results to make sure you're getting either the system image libs, or the ones optionally built with fltk.
I also found this to be quite useful:
fltk-config --compile test.cpp
It worked perfectly for me.
For more examples of using fltk-config check out http://www.fltk.org/doc-1.1/basics.html

Plone 4.1rc3 installation fails on Mac OS X Lion

Namaste, all.
I am trying to install Plone 4.1rc3 on Mac OS X Lion build 11A494a, with Python 2.7 installed. I've tried the DMG installer and the Unified Installer and both error out. The latter's log file contains the following (which I believe is the pertinent, applicable part):
gcc -I"/Users/benjamin/Plone/Python-2.6"/include -L"/Users/benjamin/Plone/Python-2.6"/lib -R"/Users/benjamin/Plone/Python-2.6"/lib -o python.exe \
Modules/python.o \
libpython2.6.a -ldl -framework CoreFoundation
Undefined symbols for architecture x86_64:
"_Py_Main", referenced from:
_main in python.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make: *** [python.exe] Error 1
This is my first time using Python and Plone in any capacity, so I am likely overlooking something elementary. Any help would be appreciated.
Try this again. Unified Installer is working on Lion release with Xcode 3 and/or 4 installed.

Resources