Page 1 of 1

Error in .pro file generated by Qmake Plugin

Posted: Tue Dec 22, 2015 6:08 pm
by srini2174
Hi,
I am using Codelite ver.9.0.6. I have created a small "Hello world" program as qmake based project. I have configured Qt plugin to use Qt 5.5 with win32-msvc2015 specification. Now when I run the "Run Qmake" command the following .pro file as well as .mk are generated (see the attached file). When I run the generated makefile using nmake I get the following error.

MESSAGE: Entering directory `C:\sources\workspaces\testcodelite\testQmake\'
"testQmake.bat"
----------Building project:[ testQmake - Debug ]----------
Executing Pre Build commands ...
Done

Microsoft (R) Program Maintenance Utility Version 14.00.23026.0
Copyright (C) Microsoft Corporation. All rights reserved.

cl -c -nologo -Zc:wchar_t -FS -Zc:strictStrings -Zi -MDd -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 /Fd"..\testQmake TEMPLATE = app\Debug\testQmake.pdb" -DQT_GUI_LIB -DQT_CORE_LIB -I. -I. -I..\..\..\..\ProgramFiles\MSVC14.0\VC\include -IC:\Program -IFiles -I(x86)\Windows -IKits\10\Include\10.0.10150.0\ucrt -I..\..\..\..\Qt\qt550\qtbase\include -I..\..\..\..\Qt\qt550\qtbase\include\QtGui -I..\..\..\..\Qt\qt550\qtbase\include\QtCore -I. -I..\..\..\..\Qt\qt550\qtbase\mkspecs\win32-msvc2015 -FoDebug\ @C:\Users\SRINIV~1\AppData\Local\Temp\nmCFB5.tmp
main.cpp
C:\ProgramFiles\MSVC14.0\VC\include\xlocale(341): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
.\main.cpp(3): warning C4100: 'argv': unreferenced formal parameter
.\main.cpp(3): warning C4100: 'argc': unreferenced formal parameter
C:\ProgramFiles\MSVC14.0\VC\include\exception(361): warning C4577: 'noexcept' used with no exception handling mode specified; termination on exception is not guaranteed. Specify /EHsc
link /NOLOGO /DYNAMICBASE /NXCOMPAT /DEBUG /SUBSYSTEM:CONSOLE "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" /OUT:"..\testQmake TEMPLATE = app\Debug\testQmake.exe" @C:\Users\SRINIV~1\AppData\Local\Temp\nmD39E.tmp
LINK : fatal error LNK1104: cannot open file 'C:\Qt\qt550\qtbase\lib\Qt5Gui550.lib'
NMAKE : fatal error U1077: 'C:\ProgramFiles\MSVC14.0\VC\BIN\link.EXE' : return code '0x450'
Stop.
====2 errors, 0 warnings====

On closer inspection I found some error message in the generated .pro file which in turn causes error in generated make file.
1) In Line 18 the include options are not correct. This is caused due to the Space in the path.
2) In Line 21 the LIBPATH is shown incorrectly as Qt5Gui550.lib instead of Qt5Gui.lib
Errors_pro_file.jpg
3) In the make file the destination directory is shown wrongly as - DESTDIR = "..\testQmake TEMPLATE = app\Debug\" #avoid trailing-slash linebreak

Thanks for providing help in resolving this error

Srinivasan.B

Re: Error in .pro file generated by Qmake Plugin

Posted: Thu Dec 24, 2015 9:04 am
by srini2174
Hi,
I did some changes in the code and I was able to overcome the problems #1 & #3 stated here. The solution to problem #2 is a bit tricky. If I change the keyword "qt" which is given in the CONFIG option to "qt5" I am able to overcome the problem #2 as well. I think the qt option should work with qt version 4 and since I have qt version 5.5 this option doesn't work. So I think the developers can change the code accordingly to take care of this.

When I was analyzing this issue I compared the codes of the Qmake plugin and Cmake plugin. I have the following observations.

1) CMake plugin takes care of the "Environment Variables" which are set in the workspace. I don't see any equivalent code in the Qmake plugin
2) Both the plugins takes the information regarding the library path and include path from the workspace and project, but the implementation of the code is different. Further the code for treating the project specific Library path and the global library path are also different some times. This is the reason for issue #1073 which I had raised in github portal.
3) Some of the strings are hardcode like the CONFIG option in Qmake plugin and a full makefile in the CMAKE plugin. Why can't this be created as a template or set in some configuration file. Eg. If the CONFIG option is set in a configuration file then people who use QT4 can set this CONFIG option line to CONFIG += release qt ... and people who use QT5 could set this line as CONFIG += release qt5 ..
4) The CMAKE plugin uses a Hardcoded Makefile to call the CMAKE command, but there is no prebuild option which is available. If you have to add a prebuild option then the only way to do is to modify and recompile the code which is not possible for everyone using this ide.
5) Further the hardcoded Makefile can be executed only by GNU-MAKE. So in the future I do not want to use only a single tool chain eg. MSVC 2015 & nmake I cannot do it. I will be forced to install GNU-Make.

I have shared these observation in the hope that the developers have a chance to make the necessary modification and make this IDE a world class one. You can discard my opinion if it is an unsolicited advice.

Srinivasan.B

Re: Error in .pro file generated by Qmake Plugin

Posted: Thu Dec 24, 2015 9:07 am
by srini2174
Hi,
A typo in Point #5. The point #5 should read as following

5) Further the hardcoded Makefile can be executed only by GNU-MAKE. So in the future if I want to use only a single tool chain eg. MSVC 2015 & nmake I cannot do it. I will be forced to install GNU-Make just to executed this generated makefile.

Re: Error in .pro file generated by Qmake Plugin

Posted: Thu Dec 24, 2015 9:17 am
by eranif
CodeLite can only generate GNU makefiles or use a custom builds, namke is not supported and there are no plans on adding it in the future.
Pull requests to support it are most welcomed

Eran

Re: Error in .pro file generated by Qmake Plugin

Posted: Thu Dec 24, 2015 9:43 am
by srini2174
Hi,

Thanks for your response. I have given nmake as an example, but theoretically it could be any build system like scons, ant, qbs, etc., My point was that if there is a provision in the future to have a build system like scons then the whole build process should only use it rather than having a mix of Make and scons. This would make this IDE much more extensible.

Srinivasan.B

Re: Error in .pro file generated by Qmake Plugin

Posted: Thu Dec 24, 2015 9:48 am
by eranif
I do plan a custom build plugin in the near future that will leave all the build process for an external tools
Hopefully for the next release

Eran

Re: Error in .pro file generated by Qmake Plugin

Posted: Thu Dec 24, 2015 10:29 am
by srini2174
Hi,
Thanks for your response. Can you please provide your valuable comments on the other points which I had mentioned in my earlier post.

Srinivasan.B