PDA

View Full Version : time compilation not working



Lokl
22nd June 2016, 10:24
Hi everyone,

My conf :
-VM windows 7 x64
-Qtcreator compile with another mingw that I use for building
-own Build Qt 5.6
-MINGW gcc 4.8.2 sljlj rev2
-boost 1_60_1

I'm working in kind of simple project. I'm doing a hyperterminal for serial device mixing Qt and boost asio for serial.
At compile time :
1)I generate the makefiles from the .pro rules.
-----------------------------------------------------------------
TEMPLATE = app
Qt += core gui
TARGET = 5_Qt_integration_MOD
#greaterThan(QT_MAJOR_VERSION, 5): error("requires Qt 4")
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

INCLUDEPATH += D:\boost_1_60_0\
#DEPENDPATH += D:\boost_1_60_0\
# D:\boost_1_60_0\stage\lib

LIBS += -LD:\boost_1_60_0\stage\lib\
# -lboost_system \
# -lboost_thread \
# -lboost_date_time \
# -llibboost_date_time-mgw48-d-1_60.a \
# -lwsock32 -lws2_32
#LIBS += -LD:\boost_1_60_0\
# -llibboost_date_time-mgw48-d-1_60.a \
# -llibboost_system-mgw48-d-1_60.a \
# -llibboost_thread-mgw48-mt-d-1_60.a \
# -lwsock32 -lws2_32

# Input
HEADERS += mainwindow.h QAsyncSerial.h AsyncSerial.h
FORMS += mainwindow.ui
SOURCES += main.cpp mainwindow.cpp QAsyncSerial.cpp AsyncSerial.cpp
----------------------------------------------------------------------------

At least I got my Makefile makefile.debug and makefile.release
3)Mingw32-make doing rules from makefile and release .o moc_*.cpp. As well *.ui is generate into a .h
Here's the output console
--------------------------------------------------------------
10:42:17: Running steps for project 5_Qt_integration_MOD...
10:42:17: Configuration unchanged, skipping qmake step.
10:42:17: Starting: "C:\mingw\mingwx64_481r0-sjlj-rev2\bin\mingw32-make.exe"
C:/mingw/mingwx64_481r0-sjlj-rev2/bin/mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory 'Z:/VM_shared_folder/serial-port-master/5_Qt_integration_MOD'
g++ -c -pipe -fno-keep-inline-dllexport -g -std=gnu++0x -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I. -ID:\boost_1_60_0 -ID:\QT\qt-everywhere-opensource-src-5.6.0\qtbase\include -ID:\QT\qt-everywhere-opensource-src-5.6.0\qtbase\include\QtWidgets -ID:\QT\qt-everywhere-opensource-src-5.6.0\qtbase\include\QtGui -ID:\QT\qt-everywhere-opensource-src-5.6.0\qtbase\include\QtCore -Idebug -I. -ID:\QT\qt-everywhere-opensource-src-5.6.0\qtbase\mkspecs\win32-g++ -o debug\main.o main.cpp
g++ -c -pipe -fno-keep-inline-dllexport -g -std=gnu++0x -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I. -ID:\boost_1_60_0 -ID:\QT\qt-everywhere-opensource-src-5.6.0\qtbase\include -ID:\QT\qt-everywhere-opensource-src-5.6.0\qtbase\include\QtWidgets -ID:\QT\qt-everywhere-opensource-src-5.6.0\qtbase\include\QtGui -ID:\QT\qt-everywhere-opensource-src-5.6.0\qtbase\include\QtCore -Idebug -I. -ID:\QT\qt-everywhere-opensource-src-5.6.0\qtbase\mkspecs\win32-g++ -o debug\mainwindow.o mainwindow.cpp
g++ -c -pipe -fno-keep-inline-dllexport -g -std=gnu++0x -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I. -ID:\boost_1_60_0 -ID:\QT\qt-everywhere-opensource-src-5.6.0\qtbase\include -ID:\QT\qt-everywhere-opensource-src-5.6.0\qtbase\include\QtWidgets -ID:\QT\qt-everywhere-opensource-src-5.6.0\qtbase\include\QtGui -ID:\QT\qt-everywhere-opensource-src-5.6.0\qtbase\include\QtCore -Idebug -I. -ID:\QT\qt-everywhere-opensource-src-5.6.0\qtbase\mkspecs\win32-g++ -o debug\QAsyncSerial.o QAsyncSerial.cpp
g++ -c -pipe -fno-keep-inline-dllexport -g -std=gnu++0x -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I. -ID:\boost_1_60_0 -ID:\QT\qt-everywhere-opensource-src-5.6.0\qtbase\include -ID:\QT\qt-everywhere-opensource-src-5.6.0\qtbase\include\QtWidgets -ID:\QT\qt-everywhere-opensource-src-5.6.0\qtbase\include\QtGui -ID:\QT\qt-everywhere-opensource-src-5.6.0\qtbase\include\QtCore -Idebug -I. -ID:\QT\qt-everywhere-opensource-src-5.6.0\qtbase\mkspecs\win32-g++ -o debug\AsyncSerial.o AsyncSerial.cpp
D:\QT\qt-everywhere-opensource-src-5.6.0\qtbase\bin\moc.exe -DUNICODE -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -D__GNUC__ -DWIN32 -ID:/QT/qt-everywhere-opensource-src-5.6.0/qtbase/mkspecs/win32-g++ -IZ:/VM_shared_folder/serial-port-master/5_Qt_integration_MOD -ID:/boost_1_60_0 -ID:/QT/qt-everywhere-opensource-src-5.6.0/qtbase/include -ID:/QT/qt-everywhere-opensource-src-5.6.0/qtbase/include/QtWidgets -ID:/QT/qt-everywhere-opensource-src-5.6.0/qtbase/include/QtGui -ID:/QT/qt-everywhere-opensource-src-5.6.0/qtbase/include/QtCore -Ic:\msys64\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.8.1/include/c++ -Ic:\msys64\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.8.1/include/c++/x86_64-w64-mingw32 -Ic:\msys64\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.8.1/include/c++/backward -Ic:\msys64\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.8.1/include -Ic:\msys64\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.8.1/include-fixed -Ic:\msys64\mingw64\bin\../x86_64-w64-mingw32/include mainwindow.h -o debug\moc_mainwindow.cpp
g++ -c -pipe -fno-keep-inline-dllexport -g -std=gnu++0x -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I. -ID:\boost_1_60_0 -ID:\QT\qt-everywhere-opensource-src-5.6.0\qtbase\include -ID:\QT\qt-everywhere-opensource-src-5.6.0\qtbase\include\QtWidgets -ID:\QT\qt-everywhere-opensource-src-5.6.0\qtbase\include\QtGui -ID:\QT\qt-everywhere-opensource-src-5.6.0\qtbase\include\QtCore -Idebug -I. -ID:\QT\qt-everywhere-opensource-src-5.6.0\qtbase\mkspecs\win32-g++ -o debug\moc_mainwindow.o debug\moc_mainwindow.cpp
D:\QT\qt-everywhere-opensource-src-5.6.0\qtbase\bin\moc.exe -DUNICODE -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -D__GNUC__ -DWIN32 -ID:/QT/qt-everywhere-opensource-src-5.6.0/qtbase/mkspecs/win32-g++ -IZ:/VM_shared_folder/serial-port-master/5_Qt_integration_MOD -ID:/boost_1_60_0 -ID:/QT/qt-everywhere-opensource-src-5.6.0/qtbase/include -ID:/QT/qt-everywhere-opensource-src-5.6.0/qtbase/include/QtWidgets -ID:/QT/qt-everywhere-opensource-src-5.6.0/qtbase/include/QtGui -ID:/QT/qt-everywhere-opensource-src-5.6.0/qtbase/include/QtCore -Ic:\msys64\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.8.1/include/c++ -Ic:\msys64\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.8.1/include/c++/x86_64-w64-mingw32 -Ic:\msys64\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.8.1/include/c++/backward -Ic:\msys64\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.8.1/include -Ic:\msys64\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.8.1/include-fixed -Ic:\msys64\mingw64\bin\../x86_64-w64-mingw32/include QAsyncSerial.h -o debug\moc_QAsyncSerial.cpp
g++ -c -pipe -fno-keep-inline-dllexport -g -std=gnu++0x -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I. -ID:\boost_1_60_0 -ID:\QT\qt-everywhere-opensource-src-5.6.0\qtbase\include -ID:\QT\qt-everywhere-opensource-src-5.6.0\qtbase\include\QtWidgets -ID:\QT\qt-everywhere-opensource-src-5.6.0\qtbase\include\QtGui -ID:\QT\qt-everywhere-opensource-src-5.6.0\qtbase\include\QtCore -Idebug -I. -ID:\QT\qt-everywhere-opensource-src-5.6.0\qtbase\mkspecs\win32-g++ -o debug\moc_QAsyncSerial.o debug\moc_QAsyncSerial.cpp
g++ -Wl,-subsystem,windows -mthreads -o debug\5_Qt_integration_MOD.exe debug/main.o debug/mainwindow.o debug/QAsyncSerial.o debug/AsyncSerial.o debug/moc_mainwindow.o debug/moc_QAsyncSerial.o -lglu32 -lopengl32 -lgdi32 -luser32 -lmingw32 -LD:\QT\qt-everywhere-opensource-src-5.6.0\qtbase\lib D:\QT\qt-everywhere-opensource-src-5.6.0\qtbase\lib\libqtmaind.a -lshell32 D:\QT\qt-everywhere-opensource-src-5.6.0\qtbase\lib\libQt5Cored.a -LD:\boost_1_60_0\stage\lib D:\QT\qt-everywhere-opensource-src-5.6.0\qtbase\lib\libQt5Widgetsd.a D:\QT\qt-everywhere-opensource-src-5.6.0\qtbase\lib\libQt5Guid.a D:\QT\qt-everywhere-opensource-src-5.6.0\qtbase\lib\libQt5Cored.a

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
Cannot create temporary file in C:\Windows\: Permission denied
g++: internal compiler error: Aborted (program collect2)
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://sourceforge.net/projects/mingw-w64> for instructions.
Makefile.Debug:75: recipe for target 'debug\5_Qt_integration_MOD.exe' failed
mingw32-make[1]: *** [debug\5_Qt_integration_MOD.exe] Error 4
mingw32-make[1]: Leaving directory 'Z:/VM_shared_folder/serial-port-master/5_Qt_integration_MOD'
Makefile:34: recipe for target 'debug' failed
mingw32-make: *** [debug] Error 2
10:43:01: The process "C:\mingw\mingwx64_481r0-sjlj-rev2\bin\mingw32-make.exe" exited with code 2.
Error while building/deploying project 5_Qt_integration_MOD (kit: Qt 5.6.0 (Built by mingwx64_481r0-sjlj-rev2))
When executing step "Make"
10:43:01: Elapsed time: 00:44.
------------------------------------------------------------------------------------------

As it said collect2.exe stop running and no .exe project is created. Even if I note lib boost and stuff I got the same failed.

Thanks in advance for any advice

anda_skoa
22nd June 2016, 11:22
Cannot create temporary file in C:\Windows\: Permission denied

That sounds like an environment/setup problem.

Not sure how Windows communicates the location of the temp directory, but C:\Windows\ looks very wrong.

Cheers,
_

Lokl
22nd June 2016, 13:00
Thanks a lot anda_skoa for your analyse. I'm gonna find out this blocking point

Added after 11 minutes:

Funny things when I do in command line in shell, I got another behaviour
----------------------------------------------------------------
Z:\VM_shared_folder\serial-port-master\5_Qt_integration_MOD>qmake.exe 5_Qt_integration_MOD.pro -r -spec win32-g++


Z:\VM_shared_folder\serial-port-master\5_Qt_integration_MOD>dir
Le volume dans le lecteur Z s'appelle Shared Folders
Le numéro de série du volume est 0000-0064

Répertoire de Z:\VM_shared_folder\serial-port-master\5_Qt_integration_MOD

22/06/2016 13:30 <REP> .
22/06/2016 13:30 <REP> ..
21/06/2016 10:07 7*512 .cproject
21/06/2016 10:07 <REP> .externalToolBuilders
21/06/2016 10:07 1*178 .project
21/06/2016 10:05 <REP> .settings
22/06/2016 11:42 1*051 5_Qt_integration_MOD.pro
22/06/2016 10:40 18*815 5_Qt_integration_MOD.pro.user
21/06/2016 17:35 14*741 AsyncSerial.cpp
20/06/2016 16:16 7*088 AsyncSerial.h
22/06/2016 13:30 <REP> debug
17/06/2016 15:24 181 main.cpp
29/07/2014 10:49 946 mainwindow.cpp
17/06/2016 15:25 476 mainwindow.h
20/06/2016 10:10 2*495 mainwindow.ui
22/06/2016 13:30 39*163 Makefile
22/06/2016 13:30 97*369 Makefile.Debug
22/06/2016 13:30 97*475 Makefile.Release
21/06/2016 15:18 2*170 QAsyncSerial.cpp
20/06/2016 15:46 1*740 QAsyncSerial.h
29/07/2014 10:49 940 Readme.txt
22/06/2016 13:30 <REP> release
22/06/2016 13:30 408 uic_wrapper.bat
17 fichier(s) 293*748 octets
6 Rép(s) 218*132*611*072 octets libres

Z:\VM_shared_folder\serial-port-master\5_Qt_integration_MOD>mingw32-make
mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory 'Z:/VM_shared_folder/serial-port-master/5_Qt_integration_MOD'
call Z:\VM_shared_folder\serial-port-master\5_Qt_integration_MOD\uic_wrapper.bat mainwindow.ui -o ui_mainwindow.h

mingw32-make: Interrupt/Exception caught (code = 0xc0000005, addr = 0x000007FEFF3F1E18)
Makefile:34: recipe for target 'debug' failed
mingw32-make: *** [debug] Error 255

Z:\VM_shared_folder\serial-port-master\5_Qt_integration_MOD>mingw32-make
mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory 'Z:/VM_shared_folder/serial-port-master/5_Qt_integration_MOD'
g++ -c -pipe -fno-keep-inline-dllexport -g -std=gnu++0x -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -D_
WIN32_WINNT=0x0501 -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I. -ID:\QT\qt-everywhere-opensou
rce-src-5.6.0\qtbase\include -ID:\QT\qt-everywhere-opensource-src-5.6.0\qtbase\include\QtWidgets -ID:\QT\qt-every
where-opensource-src-5.6.0\qtbase\include\QtGui -ID:\QT\qt-everywhere-opensource-src-5.6.0\qtbase\include\QtCore
-Idebug -I. -ID:\QT\qt-everywhere-opensource-src-5.6.0\qtbase\mkspecs\win32-g++ -o debug\main.o main.cpp
In file included from mainwindow.h:5:0,
from main.cpp:2:
QAsyncSerial.h:5:32: fatal error: boost\shared_ptr.hpp: No such file or directory
#include <boost\shared_ptr.hpp>
^
compilation terminated.
Makefile.Debug:685: recipe for target 'debug/main.o' failed
mingw32-make[1]: *** [debug/main.o] Error 1
mingw32-make[1]: Leaving directory 'Z:/VM_shared_folder/serial-port-master/5_Qt_integration_MOD'
Makefile:34: recipe for target 'debug' failed
mingw32-make: *** [debug] Error 2
-----------------------------------------------------------------------------------------------------

BTW I just change the .pro and add DEFINES += _WIN32_WINNT=0x0501
.pro :
-----------------------------------------------------------------------------------------------------
TEMPLATE = app
Qt += core gui
TARGET = 5_Qt_integration_MOD
#greaterThan(QT_MAJOR_VERSION, 5): error("requires Qt 4")
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
DEFINES += _WIN32_WINNT=0x0501
#INCLUDEPATH += D:\boost_1_60_0\
#DEPENDPATH += D:\boost_1_60_0\
# D:\boost_1_60_0\stage\lib

LIBS += -LD:\boost_1_60_0\stage\lib\
-lboost_system \
-lboost_thread \
-lboost_date_time \
-llibboost_date_time-mgw48-d-1_60.a \
-lwsock32 -lws2_32
#LIBS += -LD:\boost_1_60_0\
# -llibboost_date_time-mgw48-d-1_60.a \
# -llibboost_system-mgw48-d-1_60.a \
# -llibboost_thread-mgw48-mt-d-1_60.a \
# -lwsock32 -lws2_32

# Input
HEADERS += mainwindow.h QAsyncSerial.h AsyncSerial.h
FORMS += mainwindow.ui
SOURCES += main.cpp mainwindow.cpp QAsyncSerial.cpp AsyncSerial.cpp
-----------------------------------------------------------------------------------------------------

Added after 15 minutes:

New events
-----------------------------------------------------------------------------------------------------------------------
g++ -Wl,-subsystem,windows -mthreads -o debug\5_Qt_integration_MOD.exe debug/main.o debug/mainwindow.o debug/QAsy
ncSerial.o debug/AsyncSerial.o debug/moc_mainwindow.o debug/moc_QAsyncSerial.o -lglu32 -lopengl32 -lgdi32 -luser
32 -lmingw32 -LD:\QT\qt-everywhere-opensource-src-5.6.0\qtbase\lib D:\QT\qt-everywhere-opensource-src-5.6.0\qtbas
e\lib\libqtmaind.a -lshell32 D:\QT\qt-everywhere-opensource-src-5.6.0\qtbase\lib\libQt5Cored.a -LD:\boost_1_60_0\
stage\lib -lboost_system -lboost_thread -lboost_date_time -llibboost_date_time-mgw48-d-1_60.a -lwsock32 -lws2_32
D:\QT\qt-everywhere-opensource-src-5.6.0\qtbase\lib\libQt5Widgetsd.a D:\QT\qt-everywhere-opensource-src-5.6.0\qtb
ase\lib\libQt5Guid.a D:\QT\qt-everywhere-opensource-src-5.6.0\qtbase\lib\libQt5Cored.a
c:/mingw/mingwx64_481r0-sjlj-rev2/bin/../lib/gcc/x86_64-w64-mingw32/4.8.1/../../../../x86_64-w64-mingw32/bin/ld.e
xe: cannot find -lboost_system
c:/mingw/mingwx64_481r0-sjlj-rev2/bin/../lib/gcc/x86_64-w64-mingw32/4.8.1/../../../../x86_64-w64-mingw32/bin/ld.e
xe: cannot find -lboost_thread
c:/mingw/mingwx64_481r0-sjlj-rev2/bin/../lib/gcc/x86_64-w64-mingw32/4.8.1/../../../../x86_64-w64-mingw32/bin/ld.e
xe: cannot find -lboost_date_time
c:/mingw/mingwx64_481r0-sjlj-rev2/bin/../lib/gcc/x86_64-w64-mingw32/4.8.1/../../../../x86_64-w64-mingw32/bin/ld.e
xe: cannot find -llibboost_date_time-mgw48-d-1_60.a
collect2.exe: error: ld returned 1 exit status
Makefile.Debug:75: recipe for target 'debug\5_Qt_integration_MOD.exe' failed
mingw32-make[1]: *** [debug\5_Qt_integration_MOD.exe] Error 1
mingw32-make[1]: Leaving directory 'Z:/VM_shared_folder/serial-port-master/5_Qt_integration_MOD'
Makefile:34: recipe for target 'debug' failed
mingw32-make: *** [debug] Error 2
---------------------------------------------------------------------------------------------

Mingw linker cannot link without my boost lib even I wrote the location directory to my boost lib in .pro and remake all the project

anda_skoa
22nd June 2016, 13:35
Try the "-llibboost_date_time-mgw48-d-1_60.a" directive without the ".a" at the end.

Cheers,
_

Lokl
24th June 2016, 14:26
Thanks anda_skoa for your time. I found out. At first I thought my mingw goes to my lib boost folder ( D:\boost_1_60_0\stage\lib \) and pick the libs it needs for but apparently you need to add the suffix file. and mingw which unix-like environment on windows use .dll
here my .pro
-----------------------------------------------------------------------------
TEMPLATE = app
Qt += core gui
TARGET = 4_Qt_Serial_Hyperterminal
#greaterThan(QT_MAJOR_VERSION, 5): error("requires Qt 4")
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
DEFINES += _WIN32_WINNT=0x0501
INCLUDEPATH += D:\boost_1_60_0\
#DEPENDPATH += D:\boost_1_60_0\
# D:\boost_1_60_0\stage\lib

#LIBS += -LD:\boost_1_60_0\stage\lib\
# -lboost_system \
# -lboost_thread \
# -lboost_date_time \
# -lwsock32 -lws2_32
#Attention bien marquer les libs à utiliser
LIBS += -LD:\boost_1_60_0\stage\lib \
-lboost_date_time-mgw48-d-1_60.dll \
-lboost_system-mgw48-d-1_60.dll \
-lboost_thread-mgw48-mt-1_60.dll \
-lwsock32 -lws2_32

# Input
HEADERS += mainwindow.h QAsyncSerial.h AsyncSerial.h
FORMS += mainwindow.ui
SOURCES += main.cpp mainwindow.cpp QAsyncSerial.cpp AsyncSerial.cpp

RESOURCES += \
resources_hyperterminal.qrc
---------------------------------------------------------------------------------