[cfe-dev] Clang++ can't compile a simple hello world program.
crazygamealexs at hotmail.com
crazygamealexs at hotmail.com
Fri Sep 10 20:02:31 PDT 2010
This is the error message:
$ clang++ -v new.cpp
clang version 2.8 (branches/release_28 113675)
Target: i686-pc-mingw32
Thread model: posix
"C:/msys/local/bin/clang++.exe" -cc1 -triple i686-pc-mingw32 -S -disable-free -
disable-llvm-verifier -main-file-name new.cpp -mrelocation-model static -mdisabl
e-fp-elim -mconstructor-aliases -target-linker-version 2.20.51.20100613 -v -reso
urce-dir C:/msys/local/lib/clang/2.8 -ferror-limit 19 -fmessage-length 80 -fexce
ptions -fgnu-runtime -fdiagnostics-show-option -fcolor-diagnostics -o C:/Windows
/TEMP/cc-000000.s -x c++ new.cpp
clang -cc1 version 2.8 based upon llvm 2.8rc hosted on i686-pc-mingw32
ignoring nonexistent directory "c:/MinGW/lib/gcc/mingw32/4.4.0/include"
ignoring nonexistent directory "c:/MinGW/lib/gcc/mingw32/4.4.0/include/c++"
ignoring nonexistent directory "c:/MinGW/lib/gcc/mingw32/4.4.0/include/c++/mingw
32"
ignoring nonexistent directory "c:/MinGW/lib/gcc/mingw32/4.4.0/include/c++/backw
ard"
ignoring nonexistent directory "c:/MinGW/lib/gcc/mingw32/4.3.0/include"
ignoring nonexistent directory "c:/MinGW/lib/gcc/mingw32/4.3.0/include/c++"
ignoring nonexistent directory "c:/MinGW/lib/gcc/mingw32/4.3.0/include/c++/mingw
32"
ignoring nonexistent directory "c:/MinGW/lib/gcc/mingw32/4.3.0/include/c++/backw
ard"
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/usr/include"
#include "..." search starts here:
#include <...> search starts here:
c:/MinGW/lib/gcc/mingw32/4.5.0/include
c:/MinGW/lib/gcc/mingw32/4.5.0/include/c++
c:/MinGW/lib/gcc/mingw32/4.5.0/include/c++/mingw32
c:/MinGW/lib/gcc/mingw32/4.5.0/include/c++/backward
C:/msys/local/lib/clang/2.8/include
c:/mingw/include
End of search list.
"c:/MinGW/bin/g++.exe" -v -c -o C:/Windows/TEMP/cc-000001.o -x assembler C:/Win
dows/TEMP/cc-000000.s
Using built-in specs.
COLLECT_GCC=c:/MinGW/bin/g++.exe
COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/4.5.0/lto-wrapper.exe
Target: mingw32
Configured with: ../gcc-4.5.0/configure --enable-languages=c,c++,ada,fortran,obj
c,obj-c++ --disable-sjlj-exceptions --with-dwarf2 --enable-shared --enable-libgo
mp --disable-win32-registry --enable-libstdcxx-debug --enable-version-specific-r
untime-libs --disable-werror --build=mingw32 --prefix=/mingw
Thread model: win32
gcc version 4.5.0 (GCC)
COLLECT_GCC_OPTIONS='-v' '-c' '-o' 'C:/Windows/TEMP/cc-000001.o' '-shared-libgcc
' '-mtune=i386' '-march=i386'
c:/mingw/bin/../lib/gcc/mingw32/4.5.0/../../../../mingw32/bin/as.exe -o C:/Wind
ows/TEMP/cc-000001.o C:/Windows/TEMP/cc-000000.s
COMPILER_PATH=c:/mingw/bin/../libexec/gcc/mingw32/4.5.0/;c:/mingw/bin/../libexec
/gcc/;c:/mingw/bin/../lib/gcc/mingw32/4.5.0/../../../../mingw32/bin/
LIBRARY_PATH=c:/mingw/bin/../lib/gcc/mingw32/4.5.0/;c:/mingw/bin/../lib/gcc/;c:/
mingw/bin/../lib/gcc/mingw32/4.5.0/../../../../mingw32/lib/;c:/mingw/bin/../lib/
gcc/mingw32/4.5.0/../../../;/mingw/lib/
COLLECT_GCC_OPTIONS='-v' '-c' '-o' 'C:/Windows/TEMP/cc-000001.o' '-shared-libgcc
' '-mtune=i386' '-march=i386'
"c:/MinGW/bin/g++.exe" -v -o a.out C:/Windows/TEMP/cc-000001.o
Using built-in specs.
COLLECT_GCC=c:/MinGW/bin/g++.exe
COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/4.5.0/lto-wrapper.exe
Target: mingw32
Configured with: ../gcc-4.5.0/configure --enable-languages=c,c++,ada,fortran,obj
c,obj-c++ --disable-sjlj-exceptions --with-dwarf2 --enable-shared --enable-libgo
mp --disable-win32-registry --enable-libstdcxx-debug --enable-version-specific-r
untime-libs --disable-werror --build=mingw32 --prefix=/mingw
Thread model: win32
gcc version 4.5.0 (GCC)
COMPILER_PATH=c:/mingw/bin/../libexec/gcc/mingw32/4.5.0/;c:/mingw/bin/../libexec
/gcc/;c:/mingw/bin/../lib/gcc/mingw32/4.5.0/../../../../mingw32/bin/
LIBRARY_PATH=c:/mingw/bin/../lib/gcc/mingw32/4.5.0/;c:/mingw/bin/../lib/gcc/;c:/
mingw/bin/../lib/gcc/mingw32/4.5.0/../../../../mingw32/lib/;c:/mingw/bin/../lib/
gcc/mingw32/4.5.0/../../../;/mingw/lib/
COLLECT_GCC_OPTIONS='-v' '-o' 'a.out' '-shared-libgcc' '-mtune=i386' '-march=i38
6'
c:/mingw/bin/../libexec/gcc/mingw32/4.5.0/collect2.exe -Bdynamic -u ___register
_frame_info -u ___deregister_frame_info -o a.out c:/mingw/bin/../lib/gcc/mingw32
/4.5.0/../../../crt2.o c:/mingw/bin/../lib/gcc/mingw32/4.5.0/crtbegin.o -Lc:/min
gw/bin/../lib/gcc/mingw32/4.5.0 -Lc:/mingw/bin/../lib/gcc -Lc:/mingw/bin/../lib/
gcc/mingw32/4.5.0/../../../../mingw32/lib -Lc:/mingw/bin/../lib/gcc/mingw32/4.5.
0/../../.. -L/mingw/lib C:/Windows/TEMP/cc-000001.o -lstdc++ -lmingw32 -lgcc_s -
lgcc -lmoldname -lmingwex -lmsvcrt -luser32 -lkernel32 -ladvapi32 -lshell32 -lmi
ngw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt c:/mingw/bin/../lib/gcc/mingw3
2/4.5.0/crtend.o
Info: resolving std::cout by linking to __imp___ZSt4cout (auto-import)
c:/mingw/bin/../lib/gcc/mingw32/4.5.0/../../../../mingw32/bin/ld.exe: Warning: t
ype of symbol `_main' changed from 32 to 512 in C:/Windows/TEMP/cc-000001.o
c:/mingw/bin/../lib/gcc/mingw32/4.5.0/../../../../mingw32/bin/ld.exe: warning: a
uto-importing has been activated without --enable-auto-import specified on the c
ommand line.
This should work unless it involves constant data structures referencing symbols
from auto-imported DLLs.
C:/Windows/TEMP/cc-000001.o:fake:(.text+0x14): undefined reference to `__dso_han
dle'
C:/Windows/TEMP/cc-000001.o:fake:(.text+0x3e): undefined reference to `__cxa_ate
xit'
collect2: ld returned 1 exit status
clang++: error: linker (via gcc) command failed with exit code 1 (use -v to see
invocation)
And here is the source file.
#include <iostream>
using namespace std;
int main ()
{cout <<"hello world";}
Do I have to use the llvm-link for the linking progress? If yes, then please tell me how do I get clang to use it.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20100910/44fa7e44/attachment.html>
More information about the cfe-dev
mailing list