Problems building Qtd on Windows

simendsjo simendsjo at gmail.com
Tue Jul 19 03:45:05 PDT 2011


On 19.07.2011 11:56, simendsjo wrote:
> On 19.07.2011 11:20, simendsjo wrote:
>> On 19.07.2011 10:23, simendsjo wrote:
>>>
>>> I'm trying to compile Qtd trunk on QT 4.7 using dmd 2.054, but I'm
>>> getting a strange error:
>>>
>>> -- Check for working CXX compiler: c:/Qt/2010.05/mingw/bin/g++.exe --
>>> broken
>>>
>>> The C++ compiler "c:/Qt/2010.05/mingw/bin/g++.exe" is not able to
>>> compile a
>>> simple test program.
>>>
>>> But I'm able to compile a small program, t.c:
>>> int main() { return 0; }
>>> g++ t.c
>>> a.exe // works
>>>
>>> Here's the full output:
>>>
>>> c:\d\ext\qtd\dmd-2.054>cmake -G"MinGW Makefiles" ../
>>> -DCMAKE_CXX_FLAGS="-m32"
>>>
>>> -- The CXX compiler identification is GNU
>>> -- The C compiler identification is GNU
>>> -- Check for working CXX compiler: c:/Qt/2010.05/mingw/bin/g++.exe
>>> -- Check for working CXX compiler: c:/Qt/2010.05/mingw/bin/g++.exe --
>>> broken
>>> CMake Error at C:/Program Files (x86)/CMake
>>> 2.8/share/cmake-2.8/Modules/CMakeTes
>>> tCXXCompiler.cmake:45 (MESSAGE):
>>> The C++ compiler "c:/Qt/2010.05/mingw/bin/g++.exe" is not able to
>>> compile a
>>> simple test program.
>>>
>>> It fails with the following output:
>>>
>>> Change Dir: C:/d/ext/qtd/dmd-2.054/CMakeFiles/CMakeTmp
>>>
>>>
>>>
>>> Run Build Command:c:/Qt/2010.05/mingw/bin/mingw32-make.exe
>>> "cmTryCompileExec/fast"
>>>
>>> c:/Qt/2010.05/mingw/bin/mingw32-make.exe -f
>>> CMakeFiles\cmTryCompileExec.dir\build.make
>>> CMakeFiles/cmTryCompileExec.dir/build
>>>
>>> mingw32-make.exe[1]: Entering directory
>>> `C:/d/ext/qtd/dmd-2.054/CMakeFiles/CMakeTmp'
>>>
>>> "C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -E
>>> cmake_progress_report
>>> C:\d\ext\qtd\dmd-2.054\CMakeFiles\CMakeTmp\CMakeFiles 1
>>>
>>> Building CXX object
>>> CMakeFiles/cmTryCompileExec.dir/testCXXCompiler.cxx.obj
>>>
>>> c:\Qt\2010.05\mingw\bin\g++.exe -m32 -o
>>> CMakeFiles\cmTryCompileExec.dir\testCXXCompiler.cxx.obj -c
>>> C:\d\ext\qtd\dmd-2.054\CMakeFiles\CMakeTmp\testCXXCompiler.cxx
>>>
>>> Linking CXX executable cmTryCompileExec.exe
>>>
>>> "C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -E cmake_link_script
>>> CMakeFiles\cmTryCompileExec.dir\link.txt --verbose=1
>>>
>>> Error opening link script "CMakeFiles\cmTryCompileExec.dir\link.txt"
>>>
>>> mingw32-make.exe[1]: *** [cmTryCompileExec.exe] Error 1
>>>
>>> mingw32-make.exe[1]: Leaving directory
>>> `C:/d/ext/qtd/dmd-2.054/CMakeFiles/CMakeTmp'
>>>
>>> mingw32-make.exe: *** [cmTryCompileExec/fast] Error 2
>>>
>>>
>>>
>>>
>>>
>>> CMake will not be able to correctly generate this project.
>>> Call Stack (most recent call first):
>>> CMakeLists.txt:2 (PROJECT)
>>>
>>>
>>> -- Configuring incomplete, errors occurred!
>>
>> The steps works while running manually:
>>
>> > mingw32-make.exe[1]: Entering directory
>> > `C:/d/ext/qtd/dmd-2.054/CMakeFiles/CMakeTmp'
>> (...)
>> > "C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -E cmake_link_script
>> > CMakeFiles\cmTryCompileExec.dir\link.txt --verbose=1
>> >
>> > Error opening link script "CMakeFiles\cmTryCompileExec.dir\link.txt"
>>
>> But if I do this manually:
>> cd CMakeFiles\CMakeTmp
>> cmake -E cmake_link_script CMakeFiles\cmTryCompileExec.dir\link.txt
>> --verbose=1
>>
>> It works and I get a cmTryCompileExec.exe.
>>
>> Does it have some problems with the relative path? Any workaround for
>> this?
>>
>> This is using cmake 2.8.5
>
> I've also tried cmake 2.6 without any luck.
>
> I forced the "try compile" stuff to report as succeeded by modifying
> CMakeTestCXXCompiler.cmake and CMakeTestCCompiler.cmake.
>
> This allowed me to begin compilation, but the underlying problem is not
> gone, and linking fails during compilation:
>
> Linking CXX shared library lib\libcpp_core.dll
> Error opening link script "CMakeFiles\cpp_core.dir\link.txt"
> mingw32-make[5]: *** [lib/libcpp_core.dll] Error 1
> mingw32-make[4]: *** [CMakeFiles/cpp_core.dir/all] Error 2
> mingw32-make[3]: *** [all] Error 2
> mingw32-make[2]: *** [main] Error 2
> mingw32-make[1]: *** [CMakeFiles/main.dir/all] Error 2
> mingw32-make: *** [all] Error 2

Trying SO: 
http://stackoverflow.com/questions/6745911/cmake-error-opening-link-script-cannot-change-directory


More information about the Digitalmars-d-learn mailing list