[cfe-dev] RTTI Q

Joel de Guzman joel at boost-consulting.com
Tue Aug 9 20:05:26 PDT 2011


Hi,

Can anyone tell me how to make this simple code link properly on
Windows with Clang (configured via cmake for MSVC)? I'm hoping there's
a simple solution that I have missed.

  #include <typeinfo>

  struct x {};

  int main()
  {
    typeid(x).name();
  }

I'm getting linker errors:

cc-091711.o : error LNK2019: unresolved external symbol ___type_info_root_node referenced
in function _main
cc-091711.o : error LNK2019: unresolved external symbol
__ZNK9type_info4nameEP16__type_info_node referenced in function _main
cc-091711.o : error LNK2001: unresolved external symbol __ZTVN10__cxxabiv117__class_type_infoE

with this command line:

  clang++ rtti.cpp -o rtti.exe

(Clang build using Visual Studio 10)

Does anyone know the correct runtime libs to link against to make this work?
I am aware that exception handling is not yet implemented on Windows
(neither MSVC nor MinWG). Is rtti support also not implemented?

Thanks in advance!

Regards,
-- 
Joel de Guzman
http://www.boostpro.com
http://boost-spirit.com






More information about the cfe-dev mailing list