[cfe-dev] Link error in Clang Visual studio 2008

Michael Spencer bigcheesegs at gmail.com
Mon Dec 13 18:39:59 PST 2010


On Mon, Dec 13, 2010 at 7:35 PM, Surinder <surifilms at gmail.com> wrote:
> Hi,
>
> I have compiled llvm on Windows Visual Studio 2008.  The project builds
> successfully.  However, on executing clang to compile a simple hello world C
> program, I get following link error. (I had to add C:\Documents and
> Settings\suri\llvm\bin\Debug into window path to invoke clang ).
>
> Any help would be appreciated.
>
> Surinder:
>
> C:\Documents and Settings\suri\llvm\bin\Debug>clang -v foo.c
> clang version 2.9 (trunk 120997)
> Target: i686-pc-win32
> Thread model: posix
>  "C:/Documents and Settings/suri/llvm/bin/Debug/clang.exe" -cc1 -triple
> i686-pc-
> win32 -emit-obj -mrelax-all -disable-free -main-file-name foo.c
> -mrelocation-mod
> el static -mdisable-fp-elim -masm-verbose -mconstructor-aliases -v
> -resource-dir
>  C:/Documents and Settings/suri/llvm/bin/Debug/../lib/clang/2.9
> -ferror-limit 19
>  -fmessage-length 80 -fms-extensions -fmsc-version=1300 -fgnu-runtime
> -fdiagnost
> ics-show-option -fcolor-diagnostics -o
> C:/DOCUME~1/suri/LOCALS~1/Temp/cc-000000.
> o -x c foo.c
> clang -cc1 version 2.9 based upon llvm 2.9svn-r120997 hosted on
> i686-pc-win32
> ignoring nonexistent directory "/usr/local/include"
> ignoring nonexistent directory "/usr/include"
> #include "..." search starts here:
> #include <...> search starts here:
>  C:/Documents and Settings/suri/llvm/bin/Debug/../lib/clang/2.9/include
>  C:\Program Files\Microsoft Visual Studio 9.0\VC\include
>  C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include
> End of search list.
>  "link.exe" -out:a.out -defaultlib:libcmt -nologo
> C:/DOCUME~1/suri/LOCALS~1/Temp
> /cc-000000.o
> clang: error: unable to execute command: program not executable
> clang: error: linker command failed due to signal 1 (use -v to see
> invocation)

You must run clang from the "Visual Studio Command Line", or first run
"Microsoft Visual Studio ${VERSION}\VC\bin\vcvars32.bat". This sets up
all of the environment variables that are used to lookup stuff.

- Michael Spencer




More information about the cfe-dev mailing list