"Symbol(S) Not Found for Architecture X86_64" on Qtcreator Project

Qt Creator projects breaking: symbols not found for architecture x86_64

It is not that the linker error is as given. There's way more to it, and you're not including the meat of the message that actually carries meaningful information allowing to debug this issue. Your problem is possibly with the project becoming internally binary-incompatible, and qmake build system not catching onto it. The issue has nothing to do with Qt Creator. The build is done by qmake and make. You'll see those problems if you build from the command line - which I highly advise you to do.

Assuming the sources are in /Users/mycaptain/src/myproject, and that you're using Qt from macports, proceed as follows in terminal:

$ mkdir ~/src/build-myproject
$ cd ~/src/build-myproject
$ /opt/local/libexec/qt5/bin/qmake ../myproject
$ make

ld: symbol(s) not found for architecture x86_64 qt

I made a very basic mistake. Everything was working, but the Makefile outputted a main.o file. I tried to execute my application by using ./main.o. This is not possible.

The correct way to execute a Qt application is by using open main.app.

No need to alter the makefile.

  1. Create a myApp.pro file
    Example:
TEMPLATE += app
QT += widgets gui
SOURCES += myApp.cpp

  1. Execute qmake
  2. Execute make
  3. Execute open myApp.app

qt compile error: symbol(s) not found for architecture x86_64

It means that there are following problems:

  1. You are linking 32-bit dylib when you should link 64-bit
  2. Linker is unable to find the library
  3. Or the required symbol is not present in the library.

You can look into compiler and linker option to make sure that library is being linked. Use nm or string to ensure that the functions are present in the library.

Symbol(s) not found for architecture x86_64 in QtCreator unsing OpenCV

Ok, after looking around in the Internet i found the following Solution :

INCLUDEPATH += /opt/local/include

LIBS += -L/opt/local/lib

LIBS += -lopencv_calib3d \
-lopencv_contrib \
-lopencv_core \
-lopencv_features2d \
-lopencv_flann \
-lopencv_gpu \
-lopencv_highgui \
-lopencv_imgproc \
-lopencv_legacy \
-lopencv_ml \
-lopencv_objdetect \
-lopencv_video


Related Topics



Leave a reply



Submit