[LLVMdev] Question about compile Systemc code

Eli Friedman eli.friedman at gmail.com
Sat Jul 30 20:27:19 PDT 2011


On Sat, Jul 30, 2011 at 7:47 PM, Rui Chen <chenrui333 at gmail.com> wrote:
> Dear all,
>
> I am quite new to llvm, after installing both llvm and systemc
> library, I checked with the command to compile the "hello world"
> systemc code, it works:
> g++ -I $SYSTEMC/include -L $SYSTEMC/lib-linux -o example.o example.cpp
> -lsystemc -lm
> ./example.o
>
> But when I replace g++ with llvm-g++, some error comes out:
>
> /home/chenrui/Desktop/llvm/systemc-2.2.0/lib-linux/libsystemc.a(sc_main_main.o):
> In function `sc_core::message_function(char const*)':
> sc_main_main.cpp:(.text+0x8c): undefined reference to
> `std::ctype<char>::_M_widen_init() const'

You can't link code compiled with a newer version libstdc++ against an
older version of libstdc++.  Try linking using g++, or compiling
everything with llvm-g++.

-Eli



More information about the llvm-dev mailing list