LLVM Error : External function could not be resolved

99封情书 提交于 2019-12-06 07:47:15

Finally, I found a great link on the net : http://koichitamura.blogspot.fr/2011/01/since-i-went-to-held-several-weeks-ago.html.

The error came from the wrong place of the -rdynamic argument in the .pro file (-rdynamic must be after the linking options). You need this argument because (GCC man page) :

This instructs the linker to add all symbols, not only used ones, to the dynamic symbol table.

I changed the .pro file :

QT       += core    
QT       -= gui    
TARGET = Test01
CONFIG   += console
CONFIG   -= app_bundle    
TEMPLATE = app   
SOURCES += main.cpp    
INCLUDEPATH += /home/alainetflo/Documents/me/C++/LLVM/llvm-3.5.0.src/include
DEPENDPATH += /home/alainetflo/Documents/me/C++/LLVM/llvm-3.5.0.src/include
INCLUDEPATH += /usr/include/i386-linux-gnu/c++/4.8 \
/usr/include/c++/4.8

LIBS += `llvm-config --ldflags --libs all --system-libs` -Wl,-no-as-needed -rdynamic

QMAKE_CFLAGS += -m32

QMAKE_CXXFLAGS += -g -std=c++11 -O3

In this way, the program works with no error ! (The tutorial's example runs (http://llvm.org/docs/tutorial/LangImpl6.html#kicking-the-tires))

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!