I'm trying to change the compiler collection of a project which uses a lot of exceptions (try/catch blocks) from Microsoft Visual C++ to LLVM, but ran into compilation issues.
Used tool chain:
Visual Studio 2015 Enterprise (MSVC 14)
LLVM 3.7 Windows/x64
Here is some test source code:
#include <iostream>
int main()
{
try
{
throw 20;
}
catch (int e)
{
std::cout << "An exception occurred. Exception Nr. " << e << '\n';
}
return 0;
}
Compiling the code with the built-in Visual Studio compiler collection (v140), this are the command line results:
ClCompile:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\CL.exe
/c /ZI /nologo /W3 /WX- /sdl /Od /Oy- /D _MBCS /Gm /EHsc /RTC1 /MDd /GS /fp:precise
/Zc:wchar_t /Zc:forScope /Zc:inline /Fo "Debug\\" /Fd"Debug\vc140.pdb" /Gd /TP
/analyze- /errorReport:queue Main.cpp
Main.cpp
Link:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\link.exe
/ERRORREPORT:QUEUE /OUT:"C:\Users\jurocha\Desktop\ClangExcept\Debug\ClangExcept.exe"
/INCREMENTAL /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
/MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /Debug
/PDB:"C:\Users\jurocha\Desktop\ClangExcept\Debug\ClangExcept.pdb" /TLBID:1
/DYNAMICBASE /NXCOMPAT
/IMPLIB:"C:\Users\jurocha\Desktop\ClangExcept\Debug\ClangExcept.lib"
/MACHINE:X86 Debug\Main.obj
Compilation succeeds.
Now, changing the compilers to LLVM (LLVM-vs2014):
ClCompile:
C:\Program Files\LLVM\3.7\msbuild-bin\CL.exe
/c /ZI /nologo /W3 /WX- /sdl /Od /Oy- /D _MBCS /Gm /EHsc /RTC1 /MDd /GS /fp:precise
/Zc:wchar_t /Zc:forScope /Zc:inline /Fo"Debug\\" /Fd"Debug\vc140.pdb" /Gd /TP
/analyze- /errorReport:queue -m32 -fmsc-version=1900 Main.cpp
clang-cl.exe : warning : argument unused during compilation: '/ZI' [ClangExcept.vcxproj]
clang-cl.exe : warning : argument unused during compilation: '/Gm' [ClangExcept.vcxproj]
clang-cl.exe : warning : argument unused during compilation: '/GS' [ClangExcept.vcxproj]
Main.cpp(7,3): error : cannot use 'throw' with exceptions disabled [ClangExcept.vcxproj]
throw 20;
^
Main.cpp(5,2): error : cannot use 'try' with exceptions disabled [ClangExcept.vcxproj]
try
^
2 errors generated.
According to this document, http://clang.llvm.org/docs/MSVCCompatibility.html:
"Exceptions and SEH: Partial". But I can't make enough sense of it.
Has anyone been able to achieve this?
The LLVM page you link to says
Exceptions and SEH: Partial. C++ exceptions (try / catch / throw) and structured exceptions (__try / __except / __finally) mostly work on x64. 32-bit exception handling support is being worked on.
But in your link parameters for VC++ you have /MACHINE:X86, and you also pass -m32 to LLVM, which indicates that you try to build a 32-bit application - the model that doesn't work.
Change your settings to build a 64-bit executable instead.
Your example with exceptions now compile and even run in 32 bits with visual 2015 Community Update 1 using LLVM-3.9.0svn-r258602-win64.exe which can be found here
http://sourceforge.net/projects/clangonwin/
Related
I'm trying to compile the following DLL code:
int* ptr;
DLLExport int add(int a, int b)
{
ptr = (int*)malloc(10 * sizeof(int));
free(ptr);
return (a + b + 6);
}
This DLL works fine when compiled with Visual Studio, but crashes on the malloc() call when compiled with mingw/gcc.
However the following code works with both compilers:
DLLExport int add(int a, int b)
{
int* ptr;
ptr = (int*)malloc(10 * sizeof(int));
free(ptr);
return (a + b + 6);
}
It also works with both compilers when I define the var as static, however that var needs to be extern and used in multiple files, so it can't be static. I tried setting it to volatile, but it didn't help.
I'm loading the DLL with Unity and it crashes with the following error:
Received signal SIGSEGV
Stack trace:
RtlLookupFunctionEntry returned NULL function. Aborting stack walk.
0x0000020f7d1669b0 (cygwin1) lfind
0x0000020f7d1c5c6b (cygwin1) acl_get_perm
<Missing stacktrace information>
cygwin1.dll is a dependency that I need to also add for the mingw DLL to be loaded (but I don't need to add any other DLLs when compiling with VC).
This is the Makefile I use for mingw:
all:
g++ -c -o dll.o dll.cpp -O0
g++ -c -o pch.o pch.cpp
g++ -shared -o dll.dll ./dll3.o ./pch.o
My guess is that I'm missing some g++ flags, but I can't figure out which ones (I tried many).
And these are some of the command lines that the VC compiler uses:
1> C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\CL.exe /c /ZI /JMC /nologo /W3 /WX- /diagnostics:column /sdl /Od /D _DEBUG /D DLL2_EXPORTS /D _WINDOWS /D _USRDLL /D _WINDLL /D _UNICODE /D UNICODE /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /permissive- /Zc:wchar_t /Zc:forScope /Zc:inline /Yc"pch.h" /Fp"x64\Debug\Dll2.pch" /Fo"x64\Debug\\" /Fd"x64\Debug\vc142.pdb" /external:W3 /Gd /TP /FC /errorReport:prompt pch.cpp
...
1> C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Tracker.exe /d "C:\Program Files (x86)\MSBuild\15.0\FileTracker\FileTracker32.dll" /i ...\Dll2\x64\Debug\Dll2.tlog /r ...\DLL2\PCH.CPP /b MSBuildConsole_CancelEvent806a58ad24214fb9a0f508edf8dd6bea /c "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\CL.exe" /c /ZI /JMC /nologo /W3 /WX- /diagnostics:column /sdl /Od /D _DEBUG /D DLL2_EXPORTS /D _WINDOWS /D _USRDLL /D _WINDLL /D _UNICODE /D UNICODE /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /permissive- /Zc:wchar_t /Zc:forScope /Zc:inline /Yc"pch.h" /Fp"x64\Debug\Dll2.pch" /Fo"x64\Debug\\" /Fd"x64\Debug\vc142.pdb" /external:W3 /Gd /TP /FC /errorReport:prompt pch.cpp
...
1> C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\link.exe /ERRORREPORT:PROMPT /OUT:"...\Dll2\x64\Debug\Dll2.dll" /INCREMENTAL /ILK:"x64\Debug\Dll2.ilk" /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /MANIFESTUAC:NO /manifest:embed /DEBUG /PDB:"...\Dll2\x64\Debug\Dll2.pdb" /SUBSYSTEM:WINDOWS /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"...\Dll2\x64\Debug\Dll2.lib" /MACHINE:X64 /DLL x64\Debug\dllmain.obj
Many thanks in advance for any tips!
I need to compile a program automatically with different platform toolsets. The compilation is done using cl.exe and link.exe like so:
cl.exe file.c /GS- /PlatformToolset=vc140xp /analyze- /W3 /Gy /Zc:wchar_t /Gm- /Od /Zc:inline /fp:precise /D \"WIN32\" /D \"_WINDOWS\" /D \"_UNICODE\" /D \"UNICODE\" /errorReport:prompt /WX- /Zc:forScope /Gd /Oy- /Oi /MD /Fa\"\" /EHsc /nologo /Fo\"\" /Fp\"\" /diagnostics:classic /link %link_additional% /ENTRY:wWinMain /SUBSYSTEM:WINDOWS /MANIFEST:EMBED /NXCOMPAT /DYNAMICBASE \"kernel32.lib\" \"user32.lib\" \"gdi32.lib\" \"winspool.lib\" \"comdlg32.lib\" \"advapi32.lib\" \"shell32.lib\" \"ole32.lib\" \"oleaut32.lib\" \"uuid.lib\" \"odbc32.lib\" \"odbccp32.lib\" /DEBUG:NONE /MACHINE:%arch% /OPT:REF /SAFESEH /INCREMENTAL:NO /SUBSYSTEM:WINDOWS /MANIFESTUAC:\"level = 'asInvoker' uiAccess = 'false'\" /OPT:ICF /ERRORREPORT:PROMPT /NOLOGO /TLBID:1\
I'm using the switch /PlatformToolset=vc140xp but, the cl.exe doesn't seem to reconginze it, i get an error:
Unknown Option: /PlatformToolset
Is there a way you can change toolset using cl.exe, without msbuild and vcproj ?
Just incase someone need it, i was able to solve this isuue. i added this option to cl.exe:
/D \"_USING_V110_SDK71_\"
And also i modified this option:
/SUBSYSTEM:WINDOWS
to
/SUBSYSTEM:WINDOWS,5.01
After the application runs succesfully on windows xp. You might encounter some problems if you are heavily useing crt in your exe, in my exe i only needed CRT to define Tls callbacks, they do not work without CRT, so i guess maybe this is why this worked for me
I am attempting to convert a project from Visual Studio 2005 to 2010. (To write a plugin for Maya 2014 as it is x64 only).
To start I am compiling with VS2010 against Maya 2013 x86. This compilation and linking works fine with VS 2005 but with 2010 I get a raft of errors along the lines:
error LNK2019: unresolved external symbol "void __cdecl operator delete(void *,char const *,int)" (??3#YAXPAXPBDH#Z) referenced in function __unwindfunclet$?creator#exporter##SAPAXXZ$0
I have attached the command line that generates the output below (some parts omitted for clarities sake). You will note the VS toolset differs from 80 to 100 (2005 vs 2010) and the block { project libs compiled with VS2005 .sln file } is missing from 2010 linker. This block is the list of dependant projects compiled by Visual Studio as part of the solution build.
Do you know how I can get these locally built libs to show up in the 2010 linker? Should I even expect them too? And can anyone suggest other points of attack to resolve this?
2005 c/c++
/Od /I "C:\Program Files (x86)\Autodesk\Maya2013\include" /I {our engine include} /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "NT_PLUGIN" /D "REQUIRE_IOSTREAM" /D "_WINDLL" /FD /EHsc /MTd /Fp{pch file output} /Fo"Debug_2013\" /Fd"Debug_2013\vc80.pdb" /W3 /nologo /c /Zi /TP /errorReport:prompt
2010 c/c++
/I"C:\Program Files (x86)\Autodesk\Maya2013\include" /I{our engine include} /Zi /nologo /W3 /WX- /Od /Oy- /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "NT_PLUGIN" /D "REQUIRE_IOSTREAM" /D "_WINDLL" /Gm- /EHsc /MTd /GS /fp:precise /Zc:wchar_t /Zc:forScope /GR /Fp*{pch file output}* /Fa"Debug\" /Fo"Debug\" /Fd"Debug\vc100.pdb" /Gd /TP
/analyze- /errorReport:prompt
2005 linker
/OUT:{dll output file} /NOLOGO /LIBPATH:"C:\Program Files (x86)\Autodesk\Maya2013\lib" /DLL /MANIFEST /MANIFESTFILE:{manifest output file} /NODEFAULTLIB:"libcmt.lib" /DEBUG /PDB:{pdb file} /MAP /IMPLIB:{import library} /ERRORREPORT:PROMPT Opengl32.lib pnglib_d.lib zlib_d.lib libeay32.lib ssleay32.lib Foundation.lib OpenMaya.lib OpenMayaUI.lib OpenMayaAnim.lib OpenMayaFX.lib OpenMayaRender.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib { project libs compiled with VS2005 .sln file }
/subsystem:windows /dll /incremental:yes /debug /export:initializePlugin /export:uninitializePlugin
2010 linker
/OUT:{dll output file} /NOLOGO /LIBPATH:"C:\Program Files (x86)\Autodesk\Maya2013\lib" /DLL "Opengl32.lib" "pnglib_d.lib" "zlib_d.lib" "libeay32.lib" "ssleay32.lib" "Foundation.lib" "OpenMaya.lib" "OpenMayaUI.lib" "OpenMayaAnim.lib" "OpenMayaFX.lib" "OpenMayaRender.lib" "kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "odbc32.lib" "odbccp32.lib" /NODEFAULTLIB:"libcmt.lib" /MANIFEST /ManifestFile:{manifest output file} /ALLOWISOLATION /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:{pdb output file} /MAP /PGD:{pgd output file} /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X86 /ERRORREPORT:PROMPT
/subsystem:windows /dll /debug /export:initializePlugin /export:uninitializePlugin
Finally figured out the problem!!!!
Followed the "new way" Visual Studio 2010 has project dependancies listed. http://manski.net/2011/11/project-dependencies-in-visual-c/
This solved the "unresolved symbol" issues but created this error:
error MSB4006: There is a circular dependency in the target dependency graph
I solved this via the instructions here https://connect.microsoft.com/VisualStudio/feedback/details/534361/better-error-message-for-output-circular-dependency#details
Hope this saves someone a lot of trouble.
I've done everything step by step in the OpenGL tutorial here, but I keep getting this error when trying to build the tutorial with CMAKE.
Determining if the C compiler works failed with the following output:
Change Dir: C:/Programming/C++/OpenGL/OpenGL-tutorial_v0014_33/CMakeFiles/CMakeTmp
Run Build Command:C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe cmTryCompileExec1900997581.vcxproj /p:Configuration=Debug /p:VisualStudioVersion=10.0
Microsoft (R) Build Engine version 4.0.30319.17929
[Microsoft .NET Framework, version 4.0.30319.17929]
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 2/19/2014 12:59:05 AM.
Project "C:\Programming\C++\OpenGL\OpenGL-tutorial_v0014_33\CMakeFiles\CMakeTmp\cmTryCompileExec1900997581.vcxproj" on node 1 (default targets).
PrepareForBuild:
Creating directory "cmTryCompileExec1900997581.dir\Debug\".
Creating directory "C:\Programming\C++\OpenGL\OpenGL-tutorial_v0014_33\CMakeFiles\CMakeTmp\Debug\".
InitializeBuildStatus:
Creating "cmTryCompileExec1900997581.dir\Debug\cmTryCompileExec1900997581.unsuccessfulbuild" because "AlwaysCreate" was specified.
ClCompile:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\CL.exe /c /Zi /W3 /WX- /Od /Ob0 /Oy- /D WIN32 /D _WINDOWS /D _DEBUG /D "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"cmTryCompileExec1900997581.dir\Debug\\" /Fd"cmTryCompileExec1900997581.dir\Debug\vc100.pdb" /Gd /TC /analyze- /errorReport:queue testCCompiler.c
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.30319.01 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.
cl /c /Zi /W3 /WX- /Od /Ob0 /Oy- /D WIN32 /D _WINDOWS /D _DEBUG /D "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"cmTryCompileExec1900997581.dir\Debug\\" /Fd"cmTryCompileExec1900997581.dir\Debug\vc100.pdb" /Gd /TC /analyze- /errorReport:queue testCCompiler.c
testCCompiler.c
ManifestResourceCompile:
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\rc.exe /nologo /fo"cmTryCompileExec1900997581.dir\Debug\cmTryCompileExec1900997581.exe.embed.manifest.res" cmTryCompileExec1900997581.dir\Debug\cmTryCompileExec1900997581_manifest.rc
Link:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\link.exe /ERRORREPORT:QUEUE /OUT:"C:\Programming\C++\OpenGL\OpenGL-tutorial_v0014_33\CMakeFiles\CMakeTmp\Debug\cmTryCompileExec1900997581.exe" /INCREMENTAL /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /ManifestFile:"cmTryCompileExec1900997581.dir\Debug\cmTryCompileExec1900997581.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"C:/Programming/C++/OpenGL/OpenGL-tutorial_v0014_33/CMakeFiles/CMakeTmp/Debug/cmTryCompileExec1900997581.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"C:/Programming/C++/OpenGL/OpenGL-tutorial_v0014_33/CMakeFiles/CMakeTmp/Debug/cmTryCompileExec1900997581.lib" /MACHINE:X86 cmTryCompileExec1900997581.dir\Debug\cmTryCompileExec1900997581.exe.embed.manifest.res
cmTryCompileExec1900997581.dir\Debug\testCCompiler.obj /machine:X86 /debug
LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt [C:\Programming\C++\OpenGL\OpenGL-tutorial_v0014_33\CMakeFiles\CMakeTmp\cmTryCompileExec1900997581.vcxproj]
Done Building Project "C:\Programming\C++\OpenGL\OpenGL-tutorial_v0014_33\CMakeFiles\CMakeTmp\cmTryCompileExec1900997581.vcxproj" (default targets) -- FAILED.
Build FAILED.
"C:\Programming\C++\OpenGL\OpenGL-tutorial_v0014_33\CMakeFiles\CMakeTmp\cmTryCompileExec1900997581.vcxproj" (default target) (1) ->
(Link target) ->
LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt [C:\Programming\C++\OpenGL\OpenGL-tutorial_v0014_33\CMakeFiles\CMakeTmp\cmTryCompileExec1900997581.vcxproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.71
I am a fresh on CGAL, I met a problem, my CMake2.8.12 (VS2010 c++ express version) seems can not work for the CGAL 4.3. I put the Error.log here
Determining if the CXX compiler works failed with the following output:
Change Dir: D:/Program Files (x86)/CGAL-4.3/CMakeFiles/CMakeTmp
Run Build Command:C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe cmTryCompileExec3635631916.vcxproj /p:Configuration=Debug /p:VisualStudioVersion=10.0
Microsoft (R) Build Engine version 4.0.30319.17929
[Microsoft .NET Framework, version 4.0.30319.18052]
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 11/18/2013 9:30:40 AM.
Project "D:\Program Files (x86)\CGAL-4.3\CMakeFiles\CMakeTmp\cmTryCompileExec3635631916.vcxproj" on node 1 (default targets).
PrepareForBuild:
Creating directory "cmTryCompileExec3635631916.dir\Debug\".
Creating directory "D:\Program Files (x86)\CGAL-4.3\CMakeFiles\CMakeTmp\Debug\".
InitializeBuildStatus:
Creating "cmTryCompileExec3635631916.dir\Debug\cmTryCompileExec3635631916.unsuccessfulbuild" because "AlwaysCreate" was specified.
ClCompile:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\CL.exe /c /Zi /W3 /WX- /Od /Ob0 /Oy- /D WIN32 /D _WINDOWS /D _DEBUG /D "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /GR /Fo"cmTryCompileExec3635631916.dir\Debug\\" /Fd"cmTryCompileExec3635631916.dir\Debug\vc100.pdb" /Gd /TP /analyze- /errorReport:queue testCXXCompiler.cxx
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.30319.01 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.
cl /c /Zi /W3 /WX- /Od /Ob0 /Oy- /D WIN32 /D _WINDOWS /D _DEBUG /D "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /GR /Fo"cmTryCompileExec3635631916.dir\Debug\\" /Fd"cmTryCompileExec3635631916.dir\Debug\vc100.pdb" /Gd /TP /analyze- /errorReport:queue testCXXCompiler.cxx
testCXXCompiler.cxx
ManifestResourceCompile:
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\rc.exe /nologo /fo"cmTryCompileExec3635631916.dir\Debug\cmTryCompileExec3635631916.exe.embed.manifest.res" cmTryCompileExec3635631916.dir\Debug\cmTryCompileExec3635631916_manifest.rc
Link:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\link.exe /ERRORREPORT:QUEUE /OUT:"D:\Program Files (x86)\CGAL-4.3\CMakeFiles\CMakeTmp\Debug\cmTryCompileExec3635631916.exe" /INCREMENTAL /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /ManifestFile:"cmTryCompileExec3635631916.dir\Debug\cmTryCompileExec3635631916.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"D:/Program Files (x86)/CGAL-4.3/CMakeFiles/CMakeTmp/Debug/cmTryCompileExec3635631916.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"D:/Program Files (x86)/CGAL-4.3/CMakeFiles/CMakeTmp/Debug/cmTryCompileExec3635631916.lib" /MACHINE:X86 cmTryCompileExec3635631916.dir\Debug\cmTryCompileExec3635631916.exe.embed.manifest.res
cmTryCompileExec3635631916.dir\Debug\testCXXCompiler.obj /machine:X86 /debug
LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt [D:\Program Files (x86)\CGAL-4.3\CMakeFiles\CMakeTmp\cmTryCompileExec3635631916.vcxproj]
Done Building Project "D:\Program Files (x86)\CGAL-4.3\CMakeFiles\CMakeTmp\cmTryCompileExec3635631916.vcxproj" (default targets) -- FAILED.
Build FAILED.
"D:\Program Files (x86)\CGAL-4.3\CMakeFiles\CMakeTmp\cmTryCompileExec3635631916.vcxproj" (default target) (1) ->
(Link target) ->
LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt [D:\Program Files (x86)\CGAL-4.3\CMakeFiles\CMakeTmp\cmTryCompileExec3635631916.vcxproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.20
Determining if the CXX compiler works failed with the following output:
Change Dir: D:/Program Files (x86)/CGAL-4.3/CMakeFiles/CMakeTmp
Run Build Command:C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe cmTryCompileExec3236418378.vcxproj /p:Configuration=Debug /p:VisualStudioVersion=10.0
Microsoft (R) Build Engine version 4.0.30319.17929
[Microsoft .NET Framework, version 4.0.30319.18052]
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 11/18/2013 9:32:41 AM.
Project "D:\Program Files (x86)\CGAL-4.3\CMakeFiles\CMakeTmp\cmTryCompileExec3236418378.vcxproj" on node 1 (default targets).
PrepareForBuild:
Creating directory "cmTryCompileExec3236418378.dir\Debug\".
Creating directory "D:\Program Files (x86)\CGAL-4.3\CMakeFiles\CMakeTmp\Debug\".
InitializeBuildStatus:
Creating "cmTryCompileExec3236418378.dir\Debug\cmTryCompileExec3236418378.unsuccessfulbuild" because "AlwaysCreate" was specified.
ClCompile:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\CL.exe /c /Zi /W3 /WX- /Od /Ob0 /Oy- /D WIN32 /D _WINDOWS /D _DEBUG /D "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /GR /Fo"cmTryCompileExec3236418378.dir\Debug\\" /Fd"cmTryCompileExec3236418378.dir\Debug\vc100.pdb" /Gd /TP /analyze- /errorReport:queue testCXXCompiler.cxx
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.30319.01 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.
cl /c /Zi /W3 /WX- /Od /Ob0 /Oy- /D WIN32 /D _WINDOWS /D _DEBUG /D "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /GR /Fo"cmTryCompileExec3236418378.dir\Debug\\" /Fd"cmTryCompileExec3236418378.dir\Debug\vc100.pdb" /Gd /TP /analyze- /errorReport:queue testCXXCompiler.cxx
testCXXCompiler.cxx
ManifestResourceCompile:
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\rc.exe /nologo /fo"cmTryCompileExec3236418378.dir\Debug\cmTryCompileExec3236418378.exe.embed.manifest.res" cmTryCompileExec3236418378.dir\Debug\cmTryCompileExec3236418378_manifest.rc
Link:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\link.exe /ERRORREPORT:QUEUE /OUT:"D:\Program Files (x86)\CGAL-4.3\CMakeFiles\CMakeTmp\Debug\cmTryCompileExec3236418378.exe" /INCREMENTAL /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /ManifestFile:"cmTryCompileExec3236418378.dir\Debug\cmTryCompileExec3236418378.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"D:/Program Files (x86)/CGAL-4.3/CMakeFiles/CMakeTmp/Debug/cmTryCompileExec3236418378.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"D:/Program Files (x86)/CGAL-4.3/CMakeFiles/CMakeTmp/Debug/cmTryCompileExec3236418378.lib" /MACHINE:X86 cmTryCompileExec3236418378.dir\Debug\cmTryCompileExec3236418378.exe.embed.manifest.res
cmTryCompileExec3236418378.dir\Debug\testCXXCompiler.obj /machine:X86 /debug
LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt [D:\Program Files (x86)\CGAL-4.3\CMakeFiles\CMakeTmp\cmTryCompileExec3236418378.vcxproj]
Done Building Project "D:\Program Files (x86)\CGAL-4.3\CMakeFiles\CMakeTmp\cmTryCompileExec3236418378.vcxproj" (default targets) -- FAILED.
Build FAILED.
"D:\Program Files (x86)\CGAL-4.3\CMakeFiles\CMakeTmp\cmTryCompileExec3236418378.vcxproj" (default target) (1) ->
(Link target) ->
LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt [D:\Program Files (x86)\CGAL-4.3\CMakeFiles\CMakeTmp\cmTryCompileExec3236418378.vcxproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.20
Determining if the CXX compiler works failed with the following output:
Change Dir: D:/Program Files (x86)/CGAL-4.3/CMakeFiles/CMakeTmp
Run Build Command:C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe cmTryCompileExec787580669.vcxproj /p:Configuration=Debug /p:VisualStudioVersion=10.0
Microsoft (R) Build Engine version 4.0.30319.17929
[Microsoft .NET Framework, version 4.0.30319.18052]
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 11/18/2013 9:35:54 AM.
Project "D:\Program Files (x86)\CGAL-4.3\CMakeFiles\CMakeTmp\cmTryCompileExec787580669.vcxproj" on node 1 (default targets).
PrepareForBuild:
Creating directory "cmTryCompileExec787580669.dir\Debug\".
Creating directory "D:\Program Files (x86)\CGAL-4.3\CMakeFiles\CMakeTmp\Debug\".
InitializeBuildStatus:
Creating "cmTryCompileExec787580669.dir\Debug\cmTryCompileExec787580669.unsuccessfulbuild" because "AlwaysCreate" was specified.
ClCompile:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\CL.exe /c /Zi /W3 /WX- /Od /Ob0 /Oy- /D WIN32 /D _WINDOWS /D _DEBUG /D "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /GR /Fo"cmTryCompileExec787580669.dir\Debug\\" /Fd"cmTryCompileExec787580669.dir\Debug\vc100.pdb" /Gd /TP /analyze- /errorReport:queue testCXXCompiler.cxx
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.30319.01 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.
cl /c /Zi /W3 /WX- /Od /Ob0 /Oy- /D WIN32 /D _WINDOWS /D _DEBUG /D "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /GR /Fo"cmTryCompileExec787580669.dir\Debug\\" /Fd"cmTryCompileExec787580669.dir\Debug\vc100.pdb" /Gd /TP /analyze- /errorReport:queue testCXXCompiler.cxx
testCXXCompiler.cxx
ManifestResourceCompile:
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\rc.exe /nologo /fo"cmTryCompileExec787580669.dir\Debug\cmTryCompileExec787580669.exe.embed.manifest.res" cmTryCompileExec787580669.dir\Debug\cmTryCompileExec787580669_manifest.rc
Link:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\link.exe /ERRORREPORT:QUEUE /OUT:"D:\Program Files (x86)\CGAL-4.3\CMakeFiles\CMakeTmp\Debug\cmTryCompileExec787580669.exe" /INCREMENTAL /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /ManifestFile:"cmTryCompileExec787580669.dir\Debug\cmTryCompileExec787580669.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"D:/Program Files (x86)/CGAL-4.3/CMakeFiles/CMakeTmp/Debug/cmTryCompileExec787580669.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"D:/Program Files (x86)/CGAL-4.3/CMakeFiles/CMakeTmp/Debug/cmTryCompileExec787580669.lib" /MACHINE:X86 cmTryCompileExec787580669.dir\Debug\cmTryCompileExec787580669.exe.embed.manifest.res
cmTryCompileExec787580669.dir\Debug\testCXXCompiler.obj /machine:X86 /debug
LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt [D:\Program Files (x86)\CGAL-4.3\CMakeFiles\CMakeTmp\cmTryCompileExec787580669.vcxproj]
Done Building Project "D:\Program Files (x86)\CGAL-4.3\CMakeFiles\CMakeTmp\cmTryCompileExec787580669.vcxproj" (default targets) -- FAILED.
Build FAILED.
"D:\Program Files (x86)\CGAL-4.3\CMakeFiles\CMakeTmp\cmTryCompileExec787580669.vcxproj" (default target) (1) ->
(Link target) ->
LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt [D:\Program Files (x86)\CGAL-4.3\CMakeFiles\CMakeTmp\cmTryCompileExec787580669.vcxproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.20
I dont know what to do, please help me. Thank you very much!!!
Your version number indicates you're not running SP1. Update Visual Studio 2010, then the problem should be solved, as it was for me.