I am reading the LLVM's Kaleidoscope tutorial (http://llvm.org/docs/tutorial/index.html).
I wanted to compile and test the language. After some compiler's errors (EngineBuilder and Module's constructor, linking libs...), the example program was built. Then, I tried the language. I got a few problems with InitializeNativeTargets, DataLayoutPass... But I managed to correct them.
Howewer, I don't manage to resolve one error. When I write extern printd(x); printd(5);, the program doesn't work : "LLVM ERROR : Program used external function 'printd' which could not be resolved".
I looked for the solution on the net. I read a lot of webpages, but nothing worked.
How can I resolve this problem ? Why LLVM can't find the external function 'printd', which is included in the program ? Thanks in advance for your answer.
The used code : https://docs.google.com/document/d/1Qb-zUGaUUIF354uFCXv1iuq8n_rjya6IHDW4WCPWN_4/edit?usp=sharing
The .pro file (Qt Creator) :
QT += core QT -= gui TARGET = Kaleidoscope 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 LIBS += `llvm-config --ldflags --libs all --system-libs` -Wl,-no-as-needed QMAKE_CFLAGS += -m32 QMAKE_CXXFLAGS += -rdynamic -std=c++11 -O3 I use GCC 4.8.2, LLVM 3.5 and Qt 5.3.1 on Ubuntu 14.04 32bits.