Hi I’m having a few problems building the kaleidoscope example (chapter 3) under MinGW. To build the example I use as recommended g++ -g -O3 toy.cpp `llvm-config --cppflags --ldflags --libs core` -o toy but get the following error sh: llvm-config: command not found Indeed in my “\llvm-2.7\tools\llvm-config\” build directory there is no “Release” subdirectory as I would expect (only llvm-config.in among other files) and in \llvm-2.7\Release\bin no llvm-config executable (only a llvm-config text file). This was a little unexpected because otherwise llvm appears to have been built fine and llvm object directory tree also looks OK. What I am doing wrong? Any help would be much appreciated! ***** Error Messages sh: llvm-config: command not found In file included from /mingw/lib/gcc/mingw32/../../../include/llvm/Type.h:15, from /mingw/lib/gcc/mingw32/../../../include/llvm/DerivedTypes.h:21, from main.cpp:10: /mingw/lib/gcc/mingw32/../../../include/llvm/System/DataTypes.h:45:3: error: #error "Must #define __STDC_LIMIT_MACROS before #including System/DataTypes.h" /mingw/lib/gcc/mingw32/../../../include/llvm/System/DataTypes.h:49:3: error: #error "Must #define __STDC_CONSTANT_MACROS before " "#including System/DataTypes.h" In file included from /mingw/lib/gcc/mingw32/../../../include/llvm/Attributes.h:18, from /mingw/lib/gcc/mingw32/../../../include/llvm/Argument.h:18, from /mingw/lib/gcc/mingw32/../../../include/llvm/Function.h:24, from /mingw/lib/gcc/mingw32/../../../include/llvm/Module.h:18, from main.cpp:12: /mingw/lib/gcc/mingw32/../../../include/llvm/Support/MathExtras.h: In function 'bool llvm::isInt(int64_t)': /mingw/lib/gcc/mingw32/../../../include/llvm/Support/MathExtras.h:57: error: there are no arguments to 'INT64_C' that depend on a template parameter, so a declaration of 'INT64_C' must be available /mingw/lib/gcc/mingw32/../../../include/llvm/Support/MathExtras.h:57: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated) /mingw/lib/gcc/mingw32/../../../include/llvm/Support/MathExtras.h:57: error: there are no arguments to 'INT64_C' that depend on a template parameter, so a declaration of 'INT64_C' must be available /mingw/lib/gcc/mingw32/../../../include/llvm/Support/MathExtras.h: In function 'bool llvm::isUint(uint64_t)': /mingw/lib/gcc/mingw32/../../../include/llvm/Support/MathExtras.h:62: error: there are no arguments to 'UINT64_C' that depend on a template parameter, so a declaration of 'UINT64_C' must be available -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100907/e61e5a14/attachment.html>
Hello, António. 2010/9/7 António Saragga Seabra <antseabra at gmail.com>:> I’m having a few problems building the kaleidoscope example (chapter 3) > under MinGW. To build the example I use as recommended> g++ -g -O3 toy.cpp `llvm-config --cppflags --ldflags --libs core` -o toy > sh: llvm-config: command not foundYou need MSYS's perl to use llvm-config on mingw. Does this below work? -D_DEBUG (might be -DNDEBUG) -D__NO_CTYPE_INLINE -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -lLLVMCore -lLLVMSupport -lLLVMSystem -lpsapi -limagehlp -lm ...Takumi
Hello, Takumi, you are absolutely right! It was a problem with Perl. Many thanks! That problem solved, tried to compile again the kaleidoscope example but unfortunatelly now I get the link errors found bellow: $g++ -g –O3 toy.cpp `llvm-config –cppflags –ldflags –libs core`-o toy c:/llvm-2.7/Release/lib/libLLVMSystem.a(Signals.o):Signals.cpp:(.text+0x4d4): undefined reference to `_imp__SymSetOptions at 4' c:/llvm-2.7/Release/lib/libLLVMSystem.a(Signals.o):Signals.cpp:(.text+0x463): undefined reference to `_imp__SymInitialize at 12' c:/llvm-2.7/Release/lib/libLLVMSystem.a(Signals.o):Signals.cpp:(.text+0x46c): undefined reference to `_imp__SymGetModuleBase at 8' c:/llvm-2.7/Release/lib/libLLVMSystem.a(Signals.o):Signals.cpp:(.text+0x47a): undefined reference to `_imp__SymFunctionTableAccess at 8' c:/llvm-2.7/Release/lib/libLLVMSystem.a(Signals.o):Signals.cpp:(.text+0x4b2): undefined reference to `_imp__StackWalk at 36' c:/llvm-2.7/Release/lib/libLLVMSystem.a(Signals.o):Signals.cpp:(.text+0x567): undefined reference to `_imp__SymGetModuleBase at 8' c:/llvm-2.7/Release/lib/libLLVMSystem.a(Signals.o):Signals.cpp:(.text+0x611): undefined reference to `_imp__SymGetSymFromAddr at 16' c:/llvm-2.7/Release/lib/libLLVMSystem.a(Signals.o):Signals.cpp:(.text+0x6ae): undefined reference to `_imp__SymGetLineFromAddr at 16' c:/llvm-2.7/Release/lib/libLLVMSystem.a(Process.o):Process.cpp:(.text+0x8d): undefined reference to `GetProcessMemoryInfo at 12' collect2: ld returned 1 exit status I built again LLVM now with perl working properly. Any help would be great Antonio 2010/9/7 NAKAMURA Takumi <geek4civic at gmail.com>> Hello, António. > > 2010/9/7 António Saragga Seabra <antseabra at gmail.com>: > > > I’m having a few problems building the kaleidoscope example (chapter 3) > > under MinGW. To build the example I use as recommended > > > g++ -g -O3 toy.cpp `llvm-config --cppflags --ldflags --libs core` -o toy > > sh: llvm-config: command not found > > You need MSYS's perl to use llvm-config on mingw. > > Does this below work? > -D_DEBUG (might be -DNDEBUG) > -D__NO_CTYPE_INLINE > -D_GNU_SOURCE > -D__STDC_LIMIT_MACROS > -D__STDC_CONSTANT_MACROS > -lLLVMCore -lLLVMSupport -lLLVMSystem > -lpsapi -limagehlp -lm > > ...Takumi >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100907/58ea3332/attachment.html>
Reasonably Related Threads
- [LLVMdev] llvm-config error
- [LLVMdev] llvm-config error
- [LLVMdev] llvm-config error
- [LLVMdev] LLVM ERROR: Program used external function 'printd' which could not be resolved!
- [LLVMdev] LLVM ERROR: Program used external function 'printd' which could not be resolved!