[LLVMdev] Problem linking with llvm on mac os 10.6
Romain Pechayre
rpechayr at gmail.com
Sun Mar 14 08:00:37 PDT 2010
Hello all,
I am trying to build the kaleidoscope sample code on Mac os (10.6).
What I have done to get llvm libraries :
1) Downloaded llvm-2.6 source code
2) ./configure
3)make
4) make intall
Then I tried to build kaleidoscope as described in the tutorial:
g++ -g -O3 toy.cpp `llvm-config --cppflags --ldflags --libs core` -o toy
I get typical link time errors (undefined symbols: ...) as if the linked libraries were not found ( llvm-config seems to work fine)
The very first errors are the following:
ld: warning: in /usr/local/lib/libLLVMCore.a, file was built for unsupported file format which is not the architecture being linked (x86_64)
ld: warning: in /usr/local/lib/libLLVMSupport.a, file was built for unsupported file format which is not the architecture being linked (x86_64)
ld: warning: in /usr/local/lib/libLLVMSystem.a, file was built for unsupported file format which is not the architecture being linked (x86_64)
Then I guess libraries are not linked and I get classical errors.
By the way, I get the same errors (apart from the first ones) if I build like this (omitting libraries flags):
g++ -g -O3 toy.cpp -I/usr/local/include -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -o toy
There must be something wrong with the libraries and I assume I have not compiled them the right way. Please let me know if you have any ideas.
Regards,
romain
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100314/268896d2/attachment.html>
More information about the llvm-dev
mailing list