[LLVMdev] bc file only with llvm-gcc3?

Michael Reichenbach michael_reichenbach at freenet.de
Thu Sep 18 02:38:58 PDT 2008


Eli Friedman schrieb:
> On Wed, Sep 17, 2008 at 3:39 PM, Michael Reichenbach
> <michael_reichenbach at freenet.de> wrote:
>> program.c will contain some non-human generated code. But it doesn't
>> compile with gcc. There is an error, gcc complaints about undefined
>> reference to std::cout and such (the code was just a very small example
>> with cout).
>>
>> It hasn't be converted into "C only" code, can you tell me why?
> 
> If your code uses the C++ library, you'll need to link it against a
> C++ library.  That has nothing to do with the language of the code.
> 
> -Eli

I was only using the C++ standard lib. It doesn't need to be linked
because it's only a header. Better said, it can't be linked with the std
lib, never heard that it's needed to link it.

Btw the code compiles and runs for sure with a g++ and also with llvm-g++.

Only the converted C output contains still references to C++. How can I
remove them?

-mr



More information about the llvm-dev mailing list