I am trying to link on Windows a Fortran code with C++. The Fortran code is compiled with gfortran from MinGW, and the other C++ parts are being compiled with MSVC.
The problem is that the linker generates the following error message:
libgfortran.a(read.o) : error LNK2016: Absolute symbol '_strtoflt128' used as target of REL32 relocation
With the Intel fortran compiler it works.
Tools:
GNU Fortran 6.3.0
MSVC 2013
I used the CMake generated Visual Studio project, which automatically invokes the Microsoft linker. The linker arguments(cleaned):
/MANIFEST /NXCOMPAT /DYNAMICBASE "kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "comdlg32.lib" "advapi32.lib" "libgfortran.a" "libmingwex.a" "libmingw32.a" "libquadmath.a" "libgcc_s.a" "libgcc.a" "libgcc_eh.a" /MACHINE:X86 /SAFESEH:NO /INCREMENTAL:NO /SUBSYSTEM:CONSOLE /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /ERRORREPORT:PROMPT /NOLOGO /TLBID:1 /machine:X86 /NODEFAULTLIB:"libcpmt.lib"
I tested also on 64 bit and it generates the same error.
Related
I am trying to build KFR C API with MSVC2017 according to instructions in README:
with following error
lld-link: error: : undefined symbol: mainCRTStartup
The log from MSVC2017 command prompt:
C:\Users\msd\DSP\kfr\build>cmake -GNinja -DENABLE_CAPI_BUILD=ON
-DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER="C:\Program Files\LLVM\bin\clang-cl.exe" ..
-- The CXX compiler identification is Clang 14.0.6 with MSVC-like command-line
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Check for working CXX compiler: C:\Program Files\LLVM\bin\clang-cl.exe
-- Check for working CXX compiler: C:\Program Files\LLVM\bin\clang-cl.exe - broken CMake Error at C:/Program
Files/CMake/share/cmake-3.24/Modules/CMakeTestCXXCompiler.cmake:62
(message): The C++ compiler
"C:\Program Files\LLVM\bin\clang-cl.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/Users/msd/DSP/kfr/build/CMakeFiles/CMakeTmp
Run Build Command(s):C:/PROGRA~1/NINJA-~1/ninja.exe cmTC_9cb05 && [1/2] Building CXX object
CMakeFiles\cmTC_9cb05.dir\testCXXCompiler.cxx.obj
[2/2] Linking CXX executable cmTC_9cb05.exe
FAILED: cmTC_9cb05.exe
cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=CMakeFiles\cmTC_9cb05.dir
--rc=C:\PROGRA~2\WI3CF2~1\10\bin\100177~1.0\x86\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100177~1.0\x86\mt.exe --manifests -- C:\PROGRA~1\LLVM\bin\lld-link.exe /nologo
CMakeFiles\cmTC_9cb05.dir\testCXXCompiler.cxx.obj /out:cmTC_9cb05.exe
/implib:cmTC_9cb05.lib /pdb:cmTC_9cb05.pdb /version:0.0 /machine:x64
/debug /INCREMENTAL /subsystem:console kernel32.lib user32.lib
gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib
comdlg32.lib advapi32.lib && cd ."
LINK Pass 1: command "C:\PROGRA~1\LLVM\bin\lld-link.exe /nologo CMakeFiles\cmTC_9cb05.dir\testCXXCompiler.cxx.obj /out:cmTC_9cb05.exe
/implib:cmTC_9cb05.lib /pdb:cmTC_9cb05.pdb /version:0.0 /machine:x64
/debug /INCREMENTAL /subsystem:console kernel32.lib user32.lib
gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib
comdlg32.lib advapi32.lib /MANIFEST
/MANIFESTFILE:CMakeFiles\cmTC_9cb05.dir/intermediate.manifest
CMakeFiles\cmTC_9cb05.dir/manifest.res" failed (exit code 1) with the
following output:
lld-link: error: : undefined symbol: mainCRTStartup
ninja: build stopped: subcommand failed.
CMake will not be able to correctly generate this project. Call
Stack (most recent call first): CMakeLists.txt:23 (project)
-- Configuring incomplete, errors occurred! See also "C:/Users/msd/DSP/kfr/build/CMakeFiles/CMakeOutput.log". See also
"C:/Users/msd/DSP/kfr/build/CMakeFiles/CMakeError.log". You have
changed variables that require your cache to be deleted. Configure
will be re-run and you may have to reset some variables. The following
variables have changed: CMAKE_CXX_COMPILER= C:\Program
Files\LLVM\bin\clang-cl.exe
-- Generating done CMake Warning: Manually-specified variables were not used by the project:
ENABLE_CAPI_BUILD
CMake Generate step failed. Build files cannot be regenerated
correctly.
C:\Users\msd\DSP\kfr\build>
Can anybody help me with this issue?
Thanks a lot
Earlier I installed CUDA 9.2 on my machine and built a solution with it. Then I upgraded Visual Studio 2017 to a revision that is not supported by CUDA 9.2, so I'm getting errors like:
1>D:\Dev\Views\Engines\ProbQA\ProbQA\PqaCore>"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\bin\nvcc.exe" -gencode=arch=compute_61,code=\"sm_61,compute_61\" --use-local-env -ccbin "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64" -x cu -rdc=true -ID:\Dev\Views\Engines\ProbQA\ProbQA\PqaCore\ -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\include" --source-in-ptx -G -lineinfo --keep-dir x64\Debug -maxrregcount=32 --machine 64 --compile -cudart static -g -D_DEBUG -D_WINDOWS -D_USRDLL -DPQACORE_EXPORTS -D_WINDLL -D_UNICODE -DUNICODE -Xcompiler "/EHsc /W4 /nologo /Od /FS /Zi /RTC1 /MDd /GR" -o x64\Debug\CudaEngineGpu.cu.obj "D:\Dev\Views\Engines\ProbQA\ProbQA\PqaCore\CudaEngineGpu.cu"
1>c:\program files\nvidia gpu computing toolkit\cuda\v9.2\include\crt/host_config.h(133): fatal error C1189: #error: -- unsupported Microsoft Visual Studio version! Only the versions 2012, 2013, 2015 and 2017 are supported!
1>CUDACOMPILE : nvcc warning : '--device-debug (-G)' overrides '--generate-line-info (-lineinfo)'
1>CudaEngineGpu.cu
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\BuildCustomizations\CUDA 9.2.targets(707,9): error MSB3721: The command ""C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\bin\nvcc.exe" -gencode=arch=compute_61,code=\"sm_61,compute_61\" --use-local-env -ccbin "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64" -x cu -rdc=true -ID:\Dev\Views\Engines\ProbQA\ProbQA\PqaCore\ -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\include" --source-in-ptx -G -lineinfo --keep-dir x64\Debug -maxrregcount=32 --machine 64 --compile -cudart static -g -D_DEBUG -D_WINDOWS -D_USRDLL -DPQACORE_EXPORTS -D_WINDLL -D_UNICODE -DUNICODE -Xcompiler "/EHsc /W4 /nologo /Od /FS /Zi /RTC1 /MDd /GR" -o x64\Debug\CudaEngineGpu.cu.obj "D:\Dev\Views\Engines\ProbQA\ProbQA\PqaCore\CudaEngineGpu.cu"" exited with code 2.
I've installed CUDA 10.0 that claims to be compatible with VS2017 Update 8 and any later versions. However, my solution still uses CUDA 9.2.
How to upgrade the solution to CUDA 10.0? Can I do this from GUI somewhere, or do I have to edit project files and something else?
You have two ways to upgrade the CUDA version in a Visual Studio solution:
Build dependencies -> Build customizations;
Open the vcxproj file associated to the Visual Studio solution and change 9.2 to 10.0 wherever 9.2 occurs.
This question already has an answer here:
CMake linking against shared library on windows: error about not finding .lib file
(1 answer)
Closed 4 years ago.
I'm a bit puzzled by the way that CMake deals with library linking on Windows machine. Below I have a simple CMakeLists.txt file:
cmake_minimum_required (VERSION 3.10)
project (sample)
add_library (quad SHARED quad.cpp)
add_executable (run main.cpp)
target_link_libraries (run PRIVATE quad)
On a Linux/Mac machine, CMake correctly builds the *.so/*.dylib libraries and links the executable against the *.so/*.dylib files. However on a Windows machine it builds the *.dll file and then attempts to link against a *.lib file.
Underneath the hood CMake executes the following command:
>------ Build started: Project: CMakeLists, Configuration: Debug ------
[1/4] C:\PROGRA~2\MICROS~1\2017\COMMUN~1\VC\Tools\MSVC\1415~1.267\bin\HostX64\x64\cl.exe /nologo /TP -Dquad_EXPORTS /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MDd /Zi /Ob0 /Od /RTC1 /showIncludes /FoCMakeFiles\quad.dir\quad.cpp.obj /FdCMakeFiles\quad.dir\ /FS -c C:\Users\UX\Workspace\sample\quad.cpp
[2/4] C:\PROGRA~2\MICROS~1\2017\COMMUN~1\VC\Tools\MSVC\1415~1.267\bin\HostX64\x64\cl.exe /nologo /TP /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MDd /Zi /Ob0 /Od /RTC1 /showIncludes /FoCMakeFiles\run.dir\main.cpp.obj /FdCMakeFiles\run.dir\ /FS -c C:\Users\UX\Workspace\sample\main.cpp
[3/4] cmd.exe /C "cd . && "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E vs_link_dll --intdir=CMakeFiles\quad.dir --manifests -- C:\PROGRA~2\MICROS~1\2017\COMMUN~1\VC\Tools\MSVC\1415~1.267\bin\Hostx64\x64\link.exe /nologo CMakeFiles\quad.dir\quad.cpp.obj /out:quad.dll /implib:quad.lib /pdb:quad.pdb /dll /version:0.0 /machine:x64 /debug /INCREMENTAL kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
[4/4] cmd.exe /C "cd . && "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E vs_link_exe --intdir=CMakeFiles\run.dir --manifests -- C:\PROGRA~2\MICROS~1\2017\COMMUN~1\VC\Tools\MSVC\1415~1.267\bin\Hostx64\x64\link.exe /nologo CMakeFiles\run.dir\main.cpp.obj /out:run.exe /implib:run.lib /pdb:run.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console quad.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
FAILED: run.exe
cmd.exe /C "cd . && "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E vs_link_exe --intdir=CMakeFiles\run.dir --manifests -- C:\PROGRA~2\MICROS~1\2017\COMMUN~1\VC\Tools\MSVC\1415~1.267\bin\Hostx64\x64\link.exe /nologo CMakeFiles\run.dir\main.cpp.obj /out:run.exe /implib:run.lib /pdb:run.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console quad.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
LINK Pass 1: command "C:\PROGRA~2\MICROS~1\2017\COMMUN~1\VC\Tools\MSVC\1415~1.267\bin\Hostx64\x64\link.exe /nologo CMakeFiles\run.dir\main.cpp.obj /out:run.exe /implib:run.lib /pdb:run.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console quad.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:CMakeFiles\run.dir/intermediate.manifest CMakeFiles\run.dir/manifest.res" failed (exit code 1104) with the following output:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\LINK : fatal error LNK1104: cannot open file 'quad.lib'
ninja: build stopped: subcommand failed.
Build failed.
My question is why does it fail on Windows when the CMake documentation states the following:
target_link_libraries(<target>
<PRIVATE|PUBLIC|INTERFACE> <item>...
[<PRIVATE|PUBLIC|INTERFACE> <item>...]...)
Where item can be A library target name? Shouldn't it have enough information from the target's properties to identify the full path to the compiled library as well as its type (i.e. SHARED) to be able to properly link the executable?
This is how linking works in Windows. You need a foo.lib file to link to foo.dll library. This .lib is produced when .dll itself is linked. You have to distribute .lib files together with library headers.
I have clang 3.9 from http://llvm.org/releases/3.9.0/LLVM-3.9.0-win32.exe
clang version 3.9.0 (branches/release_39)
Target: i686-pc-windows-msvc
Thread model: posix
InstalledDir: C:\Program Files\LLVM\bin
And gcc 6.2.0 (Mingw-w64)
gcc (i686-posix-dwarf-rev1, Built by MinGW-W64 project) 6.2.0
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
I don't have MSVC installed on my PC and no Windows SDK. I need some particular feature of clang and I wanted to replace it with gcc and more specifically with g++ because I use C++.
When I try to compile simple file I get:
fatal error: 'string' file not found
Does it mean my current clang installation doesn't support mingw on windows? Basically all I want is to use headers and libs from my mingw-w64 installation. I was looking for solution and didn't find anything. I don't know what should I do.
Does it also mean my clang installation depends on MSVC that I don't have?
EDIT:
From the comment on this page: http://blog.johannesmp.com/2015/09/01/installing-clang-on-windows-pt2/
This doesn't work anymore with the latest binaries (3.7.1, 3.8, 3.9)
from LLVM, because these were compiled with Visual Studio and for
Visual Studio.
You can install the full Visual Studio 2015 (takes about 8GB) or
install "Microsoft Visual C++ Build Tools 2015 Update 3" which
contains only the command line tools from VS plus the standard C++
header files that Clang needs.
I think it explains everything. Does it mean I need mingw build to get it working with mingw?
The correct thing to do, is this...
clang -target i686-pc-windows-gnu test.c -otest.exe
Or if you want 64bit output...
clang -target x86_64-pc-windows-gnu test.c -otest.exe
Clang will determine the location of the headers and libraries from your path. Make sure that you only have the version of Mingw in your path that you are targetting.
By default, the current release of Clang (5.0.0 as of now) will target x86_64-pc-windows-msvc
By way of example...
Microsoft Windows [Version 10.0.16299.19]
(c) 2017 Microsoft Corporation. All rights reserved.
C:\Users\burito>copy con hello.c
#include <stdio.h>
int main(int argc, char *argv[])
{
printf("Hello World!\n");
return 0;
}
^Z
1 file(s) copied.
C:\Users\burito>clang hello.c -ohello.exe --verbose
clang version 5.0.0 (tags/RELEASE_500/final)
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\Program Files\LLVM\bin
clang.exe: warning: unable to find a Visual Studio installation; try running Clang from a developer command prompt [-Wmsvc-not-found]
"C:\\Program Files\\LLVM\\bin\\clang.exe" -cc1 -triple x86_64-pc-windows- msvc18.0.0 -emit-obj -mrelax-all -mincremental-linker-compatible -disable-free - disable-llvm-verifier -discard-value-names -main-file-name hello.c -mrelocation- model pic -pic-level 2 -mthread-model posix -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -momit-leaf-frame-pointer -v -dwarf-column-info -debugger-tuning=gdb -resource-dir "C:\\Program Files\\LLVM\\lib\\clang\\5.0.0" -internal-isystem "C:\\Program Files\\LLVM\\lib\\clang\\5.0.0\\include" -internal-isystem C:/Program Files/Microsoft Visual Studio 10.0/VC/include -internal-isystem C:/Program Files/Microsoft Visual Studio 9.0/VC/include -internal-isystem C:/Program Files/Microsoft Visual Studio 9.0/VC/PlatformSDK/Include -internal-isystem C:/Program Files/Microsoft Visual Studio 8/VC/include -internal-isystem C:/Program Files/Microsoft Visual Studio 8/VC/PlatformSDK/Include -fdebug-compilation-dir "C:\\Users\\burito" -ferror-limit 19 -fmessage-length 120 -fms-extensions -fms-compatibility -fms-compatibility-version=18 -fno-threadsafe-statics -fdelayed-template-parsing -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -o "C:\\Users\\burito\\AppData\\Local\\Temp\\hello-5c526d.o" -x c hello.c
clang -cc1 version 5.0.0 based upon LLVM 5.0.0 default target x86_64-pc-windows-msvc
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 10.0/VC/include"
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 9.0/VC/include"
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 9.0/VC/PlatformSDK/Include"
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 8/VC/include"
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 8/VC/PlatformSDK/Include"
#include "..." search starts here:
#include <...> search starts here:
C:\Program Files\LLVM\lib\clang\5.0.0\include
End of search list.
hello.c:1:10: fatal error: 'stdio.h' file not found
#include <stdio.h>
^~~~~~~~~
1 error generated.
C:\Users\burito>clang hello.c -ohello.exe --verbose -target x86_64-pc-windows-gnu
clang version 5.0.0 (tags/RELEASE_500/final)
Target: x86_64-pc-windows-gnu
Thread model: posix
InstalledDir: C:\Program Files\LLVM\bin
"C:\\Program Files\\LLVM\\bin\\clang.exe" -cc1 -triple x86_64-pc-windows-gnu -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name hello.c -mrelocation-model pic -pic-level 2 -mthread-model posix -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -momit-leaf-frame-pointer -v -dwarf-column-info -debugger-tuning=gdb -resource-dir "C:\\Program Files\\LLVM\\lib\\clang\\5.0.0" -internal-isystem "C:\\Program Files\\LLVM\\lib\\clang\\5.0.0\\include" -internal-isystem "C:\\Program Files\\mingw-w64\\x86_64-7.2.0-posix-seh-rt_v5-rev0\\mingw64\\x86_64-w64-mingw32/sys-root/mingw/include" -internal-isystem "C:\\Program Files\\mingw-w64\\x86_64-7.2.0-posix-seh-rt_v5-rev0\\mingw64\\x86_64-w64-mingw32\\include" -internal-isystem "C:\\Program Files\\mingw-w64\\x86_64-7.2.0-posix-seh-rt_v5-rev0\\mingw64\\include" -fdebug-compilation-dir "C:\\Users\\burito" -ferror-limit 19 -fmessage-length 120 -fno-use-cxa-atexit -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -o "C:\\Users\\burito\\AppData\\Local\\Temp\\hello-d88ba4.o" -x c hello.c
clang -cc1 version 5.0.0 based upon LLVM 5.0.0 default target x86_64-pc-windows-msvc
ignoring nonexistent directory "C:\Program Files\mingw-w64\x86_64-7.2.0-posix-seh-rt_v5-rev0\mingw64\x86_64-w64-mingw32/sys-root/mingw/include"
#include "..." search starts here:
#include <...> search starts here:
C:\Program Files\LLVM\lib\clang\5.0.0\include
C:\Program Files\mingw-w64\x86_64-7.2.0-posix-seh-rt_v5-rev0\mingw64\x86_64-w64-mingw32\include
C:\Program Files\mingw-w64\x86_64-7.2.0-posix-seh-rt_v5-rev0\mingw64\include
End of search list.
"C:\\Program Files\\mingw-w64\\x86_64-7.2.0-posix-seh-rt_v5-rev0\\mingw64\\bin\\ld.exe" -m i386pep -Bdynamic -o hello.exe "C:\\Program Files\\mingw-w64\\x86_64-7.2.0-posix-seh-rt_v5-rev0\\mingw64\\x86_64-w64-mingw32\\lib\\crt2.o" "C:\\Program Files\\mingw-w64\\x86_64-7.2.0-posix-seh-rt_v5-rev0\\mingw64\\lib\\gcc\\x86_64-w64-mingw32\\7.2.0\\crtbegin.o" "-LC:\\Program Files\\mingw-w64\\x86_64-7.2.0-posix-seh-rt_v5-rev0\\mingw64\\lib\\gcc\\x86_64-w64-mingw32\\7.2.0" "-LC:\\Program Files\\mingw-w64\\x86_64-7.2.0-posix-seh-rt_v5-rev0\\mingw64\\x86_64-w64-mingw32\\lib" "-LC:\\Program Files\\mingw-w64\\x86_64-7.2.0-posix-seh-rt_v5-rev0\\mingw64\\lib" "-LC:\\Program Files\\mingw-w64\\x86_64-7.2.0-posix-seh-rt_v5-rev0\\mingw64\\x86_64-w64-mingw32/sys-root/mingw/lib" "C:\\Users\\burito\\AppData\\Local\\Temp\\hello-d88ba4.o" -lmingw32 -lgcc -lgcc_eh -lmoldname -lmingwex -lmsvcrt -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc -lgcc_eh -lmoldname -lmingwex -lmsvcrt "C:\\Program Files\\mingw-w64\\x86_64-7.2.0-posix-seh-rt_v5-rev0\\mingw64\\lib\\gcc\\x86_64-w64-mingw32\\7.2.0\\crtend.o"
C:\Users\burito>hello
Hello World!
C:\Users\burito>
After installing older version built with MinGW that is 3.7.0 RC3 it worked.
You can notice the difference in version i686-pc-windows-gnu vs i686-pc-windows-msvc.
I think clang 3.9 would work too if they didn't break something in their source code and if you'd build it yourself. Would be nice to have newest 3.9 working with MinGW too. I'm too lazy though to try to build it myself.
EDIT:
There are some packages for mingw too https://github.com/Alexpux/MINGW-packages that you can install using MSYS2 that seem to provide support for clang. There are some commits related to 3.8 and 3.9.
Hope this will help someone that has similar problems.
I searched the Web for few days now, for how to build Qt 4.8.6 for Visual Studio 2012. I am using Windows 10 x64.
I tried following:
Enviroment Variables:
QTDIR=c:\Qt\4.8.6
Path=%QTDIR%\bin
QMAKESPEC=%QTDIR%\mkspecs\win32-msvc2012
Visual Studio Native Tools Command Prompt:
cd c:\Qt\4.8.6
nmake confclean
configure -no-webkit -debug-and-release -opensource -platform win32-msvc2012
jom -j 8
But I always get Error-Codes: (last few lines)
cl -c -nologo -Zm200 -Zc:wchar_t- -O2 -MD -GR -EHsc -W3 -w34100 -w34189 -DUNICODE -DWIN32 -DQT_DLL -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DNDEBUG -I"..\..\..\include\QtCore" -I"..\..\..\include\QtGui" -I"..\..\..\include" -I"..\..\..\include\ActiveQt" -I"tmp\moc\release_shared" -I"..\..\..\mkspecs\win32-msvc2012" -Fotmp\obj\release_shared\ #C:\Users\HONIAH~1\AppData\Local\Temp\moc_mainwindow.obj.146576.5359.jom
moc_mainwindow.cpp
link /LIBPATH:"c:\Qt\4.8.6\lib" /LIBPATH:"c:\Qt\4.8.6\lib" /NOLOGO /DYNAMICBASE /NXCOMPAT /INCREMENTAL:NO /SUBSYSTEM:WINDOWS "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" /OUT:release\undoframework.exe #C:\Users\HONIAH~1\AppData\Local\Temp\undoframework.exe.146576.7484.jom
jom: C:\Qt\4.8.6\Makefile [sub-examples-make_default-ordered] Error 2