[LLVMdev] Compiling Kaleidoscope on Windows

Russell Wallace russell.wallace at gmail.com
Sun Jan 31 06:02:33 PST 2010


I don't suppose anyone knows what (or how to find out what) the actual
command to compile Kaleidoscope is? I followed cmake/nmake down
through maybe half a dozen levels before getting lost, so I tried to
develop a compiler invocation from scratch. I got as far as

cl /EHsc /I\d\llvm-2.6\include /I\llvm\include /wd4355 toy.cpp

which successfully generated toy.obj and spat out 86 link time error
messages -- as expected, it needs the libraries specified.
cmakelists.txt says set(LLVM_LINK_COMPONENTS core jit interpreter
native) so I made a guess at the .lib file corresponding to the first
of these, and tried

cl /EHsc /I\d\llvm-2.6\include /I\llvm\include /wd4355 toy.cpp
\llvm\lib\llvmcore.lib

in the hope that the number of link time error messages would go
down... but it actually goes up to 395, and the earlier ones don't
obviously have anything to do with llvm itself. Any ideas? The first
few error messages are

msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: __thiscall
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> >::~basic_string<char,struct
std::char_traits<char>,class std::allocator<char> >(void)"
(??1?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@QAE at XZ)
already defined in toy.obj
msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: __thiscall
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> >::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> >(class
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> > const &)"
(??0?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@QAE at ABV01@@Z)
already defined in toy.obj
msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: __thiscall
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> >::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> >(char const *)"
(??0?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@QAE at PBD@Z)
already defined in toy.obj
msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: char const *
__thiscall std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> >::c_str(void)const "
(?c_str@?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@QBEPBDXZ)
already defined in toy.obj
msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: static unsigned
int __cdecl std::char_traits<char>::length(char const *)"
(?length@?$char_traits at D@std@@SAIPBD at Z) already defined in toy.obj



More information about the llvm-dev mailing list