[Qt-creator] Compiling fails to link *sometimes*

Cristian Adam cristian.adam at here.com
Wed Jul 9 18:29:14 CEST 2014


On 09.07.2014 18:01, Murphy, Sean wrote:
> I've got an odd issue that happens sometimes with Qt Creator 3.1.1 on Windows (Windows 7 64-bit if it matters...).  When I go to compile my project, sometimes it will error out saying something like "failing to create myApp.exe, permission denied".  Sorry for not including the exact error, naturally I can't get it to do it now.
>
> Even though I get that error, it appears I have a newly built application that has the correct timestamp on it.
>
> Looking at the "Compile Output" tab, I see the following linker line repeated four times:
> g++ -Wl,-subsystem,windows -mthreads -o "debug\myApp.exe" "object_script.myApp.Debug" -lglu32 -lopengl32 -lgdi32 -luser32 -lmingw32 -lqtmaind -LC:/Qwt-6.1.0/lib -lqwtd -LC:\Qt\5.2.0\mingw48_32\lib -lQt5Svgd -lQt5Widgetsd -lQt5SerialPortd -lQt5Guid -lQt5Cored
> g++ -Wl,-subsystem,windows -mthreads -o "debug\myApp.exe" "object_script.myApp.Debug" -lglu32 -lopengl32 -lgdi32 -luser32 -lmingw32 -lqtmaind -LC:/Qwt-6.1.0/lib -lqwtd -LC:\Qt\5.2.0\mingw48_32\lib -lQt5Svgd -lQt5Widgetsd -lQt5SerialPortd -lQt5Guid -lQt5Cored
> g++ -Wl,-subsystem,windows -mthreads -o "debug\myApp.exe" "object_script.myApp.Debug" -lglu32 -lopengl32 -lgdi32 -luser32 -lmingw32 -lqtmaind -LC:/Qwt-6.1.0/lib -lqwtd -LC:\Qt\5.2.0\mingw48_32\lib -lQt5Svgd -lQt5Widgetsd -lQt5SerialPortd -lQt5Guid -lQt5Cored
> g++ -Wl,-subsystem,windows -mthreads -o "debug\myApp.exe" "object_script.myApp.Debug" -lglu32 -lopengl32 -lgdi32 -luser32 -lmingw32 -lqtmaind -LC:/Qwt-6.1.0/lib -lqwtd -LC:\Qt\5.2.0\mingw48_32\lib -lQt5Svgd -lQt5Widgetsd -lQt5SerialPortd -lQt5Guid -lQt5Cored
>
> So what I think is happening is that the link step is being executed multiple times for some reason, and on one of them Windows thinks the file is still open for writing, and the subsequent attempt to open the file fails.  If I load in a different Qt project (like a Qt example) that line is only included once.  Here's my .pro file, edited a little for brevity (I just snipped out the .h/.cpp/.ui file names):
>

This might sound silly but, is there an anti-virus program running?

I remember I had huge problems with some aggressive anti-virus program
which was always checking the programs that I would generate on my
machine.

Cheers,
Cristian.





More information about the Qt-creator mailing list