Sysprogs forums › Forums › VisualGDB › Error cross compiling Qt library for Raspberry
- This topic has 5 replies, 3 voices, and was last updated 8 years, 5 months ago by support.
-
AuthorPosts
-
November 30, 2013 at 22:15 #694GimqParticipant
I’m having problems correcly cross compiling a Qt library for Rasberry Pi.
I’m using the following setup:Windows 8.1 64 bit
Visual Studio 2010
VisualGDB 4.1
Latest Raspian wheezy imageI start out by creating a new application, setting the project template to ‘A QT-based application’. I’m doing this since there is no template for Qt in shared library.
Next I select build locally with cross compiler. When the project has been created, I edit the .pro file to set the project template to a library, changingTEMPLATE = app
to
TEMPLATE = lib
resulting in this .pro file:
#Generated by VisualGDB project wizard. #Feel free to modify any flags you want #Visit http://visualgdb.com/makefiles for more details QT += core gui greaterThan(QT_MAJOR_VERSION, 4): QT += widgets TARGET = test5 TEMPLATE = lib SOURCES +=MainWindow.cpp test5.cpp HEADERS += MainWindow.h FORMS += MainWindow.ui include($$lower($$join(CONFIGNAME,,,.pro))) OBJECTS_DIR = $$DESTDIR MOC_DIR = $$DESTDIR RCC_DIR = $$DESTDIR UI_DIR = $$DESTDIR
When I build the project, I’m getting the following output:
1> Build started: Project: test5, Configuration: Debug Win32 1>Build started 30-11-2013 22:59:21.
1>PrepareForBuild:
1> Creating directory "objWin32Debug".
1>Build:
1> VisualGDB: Attempting inline build...
1> VisualGDB: Updated source file list in G:Projectstmptest2test5test5.pro. Enable verbose mode for more details.
1> VisualGDB: Executing prebuild actions
1> VisualGDB: Run "C:SysGCCraspberryQtv4qmake.exe test5.pro CONFIGNAME=Debug" in directory "G:Projectstmptest2test5" on local computer
1> VisualGDB: Run "cmd.exe /c "C:SysGCCraspberrybinmake.exe"" in directory "G:Projectstmptest2test5" on local computer
1> c:/SysGCC/raspberry/Qt/v4/uic.exe MainWindow.ui -o Debug/ui_MainWindow.h
1> C:/SysGCC/raspberry/bin/arm-linux-gnueabihf-g++.exe -c -pipe -Wno-psabi -g -Wall -W -D_REENTRANT -fPIC -DQT_GUI_LIB -DQT_CORE_LIB -Ic:/sysgcc/raspberry/arm-linux-gnueabihf/sysroot/usr/share/qt4/mkspecs/arm-linux-gnueabihf -I. -Ic:/sysgcc/raspberry/arm-linux-gnueabihf/sysroot/usr/include/qt4/QtCore -Ic:/sysgcc/raspberry/arm-linux-gnueabihf/sysroot/usr/include/qt4/QtGui -Ic:/sysgcc/raspberry/arm-linux-gnueabihf/sysroot/usr/include/qt4 -IDebug -IDebug -o Debug/MainWindow.o MainWindow.cpp
1> C:/SysGCC/raspberry/bin/arm-linux-gnueabihf-g++.exe -c -pipe -Wno-psabi -g -Wall -W -D_REENTRANT -fPIC -DQT_GUI_LIB -DQT_CORE_LIB -Ic:/sysgcc/raspberry/arm-linux-gnueabihf/sysroot/usr/share/qt4/mkspecs/arm-linux-gnueabihf -I. -Ic:/sysgcc/raspberry/arm-linux-gnueabihf/sysroot/usr/include/qt4/QtCore -Ic:/sysgcc/raspberry/arm-linux-gnueabihf/sysroot/usr/include/qt4/QtGui -Ic:/sysgcc/raspberry/arm-linux-gnueabihf/sysroot/usr/include/qt4 -IDebug -IDebug -o Debug/test5.o test5.cpp
1> C:/SysGCC/raspberry/Qt/v4/moc.exe -DQT_GUI_LIB -DQT_CORE_LIB -Ic:/sysgcc/raspberry/arm-linux-gnueabihf/sysroot/usr/share/qt4/mkspecs/arm-linux-gnueabihf -I. -Ic:/sysgcc/raspberry/arm-linux-gnueabihf/sysroot/usr/include/qt4/QtCore -Ic:/sysgcc/raspberry/arm-linux-gnueabihf/sysroot/usr/include/qt4/QtGui -Ic:/sysgcc/raspberry/arm-linux-gnueabihf/sysroot/usr/include/qt4 -IDebug -IDebug MainWindow.h -o Debug/moc_MainWindow.cpp
1> C:/SysGCC/raspberry/bin/arm-linux-gnueabihf-g++.exe -c -pipe -Wno-psabi -g -Wall -W -D_REENTRANT -fPIC -DQT_GUI_LIB -DQT_CORE_LIB -Ic:/sysgcc/raspberry/arm-linux-gnueabihf/sysroot/usr/share/qt4/mkspecs/arm-linux-gnueabihf -I. -Ic:/sysgcc/raspberry/arm-linux-gnueabihf/sysroot/usr/include/qt4/QtCore -Ic:/sysgcc/raspberry/arm-linux-gnueabihf/sysroot/usr/include/qt4/QtGui -Ic:/sysgcc/raspberry/arm-linux-gnueabihf/sysroot/usr/include/qt4 -IDebug -IDebug -o Debug/moc_MainWindow.o Debug/moc_MainWindow.cpp
1> del libtest5.so.1.0.0 libtest5.so libtest5.so.1 libtest5.so.1.0
1> Could Not Find G:Projectstmptest2test5libtest5.so.1.0.0
1> C:/SysGCC/raspberry/bin/arm-linux-gnueabihf-g++.exe -shared -Wl,-soname,libtest5.so.1 -o libtest5.so.1.0.0 Debug/MainWindow.o Debug/test5.o Debug/moc_MainWindow.o -LE:Qt4.8.5lib -lQtGui -lQtCore -lpthread
1> ln -s libtest5.so.1.0.0 libtest5.so
1> ln -s libtest5.so.1.0.0 libtest5.so.1
1> process_begin: CreateProcess(NULL, ln -s libtest5.so.1.0.0 libtest5.so, ...) failed.
1> make (e=2): Het systeem kan het opgegeven bestand niet vinden.
1>
1> make: [Debug/libtest5.so.1.0.0] Error 2 (ignored)
1> ln -s libtest5.so.1.0.0 libtest5.so.1.0
1> process_begin: CreateProcess(NULL, ln -s libtest5.so.1.0.0 libtest5.so.1, ...) failed.
1> make (e=2): Het systeem kan het opgegeven bestand niet vinden.
1>
1> make: [Debug/libtest5.so.1.0.0] Error 2 (ignored)
1> process_begin: CreateProcess(NULL, ln -s libtest5.so.1.0.0 libtest5.so.1.0, ...) failed.
1> make (e=2): Het systeem kan het opgegeven bestand niet vinden.
1>
1> del Debug/libtest5.so.1.0.0
1> make: [Debug/libtest5.so.1.0.0] Error 2 (ignored)
1> Invalid switch - "libtest5.so.1.0.0".
1> make: [Debug/libtest5.so.1.0.0] Error 1 (ignored)
1> del Debug/libtest5.so
1> Invalid switch - "libtest5.so".
1> make: [Debug/libtest5.so.1.0.0] Error 1 (ignored)
1> del Debug/libtest5.so.1
1> Invalid switch - "libtest5.so.1".
1> make: [Debug/libtest5.so.1.0.0] Error 1 (ignored)
1> del Debug/libtest5.so.1.0
1> Invalid switch - "libtest5.so.1.0".
1> make: [Debug/libtest5.so.1.0.0] Error 1 (ignored)
1> move libtest5.so.1.0.0 libtest5.so libtest5.so.1 libtest5.so.1.0 Debug/
1> process_begin: CreateProcess(NULL, move libtest5.so.1.0.0 libtest5.so libtest5.so.1 libtest5.so.1.0 Debug/, ...) failed.
1> make (e=2): Het systeem kan het opgegeven bestand niet vinden.
1>
1> make: [Debug/libtest5.so.1.0.0] Error 2 (ignored)
1> VisualGDB: Executing postbuild actions
1>
1>Build succeeded.
1>
1>Time Elapsed 00:00:03.92
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
So it seems like the ln commands are not working.
Am I approaching this the worng way, overlooking a stupid thing or is there maybe a project template for this somewhere?
December 2, 2013 at 07:12 #2830supportKeymasterHi,
This looks like a bug in our toolchain. Thanks for reporting it, we will fix it in the next release. In the meanwhile please use the following workaround:
1. Download mv.exe to SysGCCRaspberrybin
2. Modify SysGCCRaspberryarm-linux-gnueabihfsysrootusrshareqt4mkspecsarm-linux-gnueabihfqmake.conf so that QMAKE_MOVE is set to mv:QMAKE_MOVE = mv
3. Create a file called ln.bat in SysGCCRaspberry with the following contents:
copy /y %2 %3
December 2, 2013 at 19:22 #2831GimqParticipantThanks, that did the trick, except that the ln.bat needs to be in SysGCCRaspberrybin.
A clean build is running ok now. The incremental build is not, I’m getting the following output:
1> Build started: Project: test1, Configuration: Debug Win32 1>Build started 2-12-2013 20:18:16.
1>Build:
1> VisualGDB: Attempting inline build...
1> VisualGDB: Executing prebuild actions
1> VisualGDB: Run "C:SysGCCraspberryQtv4qmake.exe test1.pro CONFIGNAME=Debug" in directory "G:Projectstmptest2test1" on local computer
1> VisualGDB: Run "cmd.exe /c "C:SysGCCraspberrybinmake.exe"" in directory "G:Projectstmptest2test1" on local computer
1> C:/SysGCC/raspberry/bin/arm-linux-gnueabihf-g++.exe -c -pipe -Wno-psabi -g -Wall -W -D_REENTRANT -fPIC -DQT_GUI_LIB -DQT_CORE_LIB -Ic:/sysgcc/raspberry/arm-linux-gnueabihf/sysroot/usr/share/qt4/mkspecs/arm-linux-gnueabihf -I. -Ic:/sysgcc/raspberry/arm-linux-gnueabihf/sysroot/usr/include/qt4/QtCore -Ic:/sysgcc/raspberry/arm-linux-gnueabihf/sysroot/usr/include/qt4/QtGui -Ic:/sysgcc/raspberry/arm-linux-gnueabihf/sysroot/usr/include/qt4 -IDebug -IDebug -o Debug/MainWindow.o MainWindow.cpp
1> del libtest1.so.1.0.0 libtest1.so libtest1.so.1 libtest1.so.1.0
1> Could Not Find G:Projectstmptest2test1libtest1.so.1.0.0
1> C:/SysGCC/raspberry/bin/arm-linux-gnueabihf-g++.exe -shared -Wl,-soname,libtest1.so.1 -o libtest1.so.1.0.0 Debug/MainWindow.o Debug/test1.o Debug/moc_MainWindow.o -LE:Qt4.8.5lib -lQtGui -lQtCore -lpthread
1> ln -s libtest1.so.1.0.0 libtest1.so
1>
1> G:Projectstmptest2test1>copy /y libtest1.so.1.0.0 libtest1.so
1> 1 file(s) copied.
1> ln -s libtest1.so.1.0.0 libtest1.so.1
1>
1> G:Projectstmptest2test1>copy /y libtest1.so.1.0.0 libtest1.so.1
1> 1 file(s) copied.
1> ln -s libtest1.so.1.0.0 libtest1.so.1.0
1>
1> G:Projectstmptest2test1>copy /y libtest1.so.1.0.0 libtest1.so.1.0
1> 1 file(s) copied.
1> del Debug/libtest1.so.1.0.0
1> del Debug/libtest1.so
1> Invalid switch - "libtest1.so.1.0.0".
1> make: [Debug/libtest1.so.1.0.0] Error 1 (ignored)
1> Invalid switch - "libtest1.so".
1> make: [Debug/libtest1.so.1.0.0] Error 1 (ignored)
1> del Debug/libtest1.so.1
1> Invalid switch - "libtest1.so.1".
1> make: [Debug/libtest1.so.1.0.0] Error 1 (ignored)
1> del Debug/libtest1.so.1.0
1> Invalid switch - "libtest1.so.1.0".
1> make: [Debug/libtest1.so.1.0.0] Error 1 (ignored)
1> mv libtest1.so.1.0.0 libtest1.so libtest1.so.1 libtest1.so.1.0 Debug/
1> mv: 'libtest1.so.1.0.0' and 'Debug/libtest1.so.1.0.0' are the same file
1> mv: 'libtest1.so' and 'Debug/libtest1.so' are the same file
1> mv: 'libtest1.so.1' and 'Debug/libtest1.so.1' are the same file
1> mv: 'libtest1.so.1.0' and 'Debug/libtest1.so.1.0' are the same file
1> make: [Debug/libtest1.so.1.0.0] Error 1 (ignored)
1> VisualGDB: Executing postbuild actions
1>
1>Build succeeded.
1>
1>Time Elapsed 00:00:02.20
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
Maybe the problem is that the del command should get a backslash in the path and not a forward slah?
December 2, 2013 at 20:07 #2832GimqParticipantCreated a workaround for the last problem. The problem was indeed the forward slash, so I created a script to replace the forward slash with a backward slash, created the script SysGCCraspberrybindelcmd.bat
@echo off set filepath=%1 set delcommand=del %filepath:/=% %delcommand%
Then set the QMake del command to the script in SysGCCraspberryarm-linux-gnueabihfsysrootusrshareqt4mkspecsarm-linux-gnueabihfqmake.conf
QMAKE_DEL_FILE = delcmd
Now getting this output:
1> Build started: Project: test1, Configuration: Debug Win32 1>Build started 2-12-2013 21:03:07.
1>Build:
1> VisualGDB: Attempting inline build...
1> VisualGDB: Executing prebuild actions
1> VisualGDB: Run "C:SysGCCraspberryQtv4qmake.exe test1.pro CONFIGNAME=Debug" in directory "G:Projectstmptest2test1" on local computer
1> VisualGDB: Run "cmd.exe /c "C:SysGCCraspberrybinmake.exe"" in directory "G:Projectstmptest2test1" on local computer
1> C:/SysGCC/raspberry/bin/arm-linux-gnueabihf-g++.exe -c -pipe -Wno-psabi -g -Wall -W -D_REENTRANT -fPIC -DQT_GUI_LIB -DQT_CORE_LIB -Ic:/sysgcc/raspberry/arm-linux-gnueabihf/sysroot/usr/share/qt4/mkspecs/arm-linux-gnueabihf -I. -Ic:/sysgcc/raspberry/arm-linux-gnueabihf/sysroot/usr/include/qt4/QtCore -Ic:/sysgcc/raspberry/arm-linux-gnueabihf/sysroot/usr/include/qt4/QtGui -Ic:/sysgcc/raspberry/arm-linux-gnueabihf/sysroot/usr/include/qt4 -IDebug -IDebug -o Debug/MainWindow.o MainWindow.cpp
1> delcmd libtest1.so.1.0.0 libtest1.so libtest1.so.1 libtest1.so.1.0
1> Could Not Find G:Projectstmptest2test1libtest1.so.1.0.0
1> C:/SysGCC/raspberry/bin/arm-linux-gnueabihf-g++.exe -shared -Wl,-soname,libtest1.so.1 -o libtest1.so.1.0.0 Debug/MainWindow.o Debug/test1.o Debug/moc_MainWindow.o -LE:Qt4.8.5lib -lQtGui -lQtCore -lpthread
1> ln -s libtest1.so.1.0.0 libtest1.so
1> 1 file(s) copied.
1> ln -s libtest1.so.1.0.0 libtest1.so.1
1> 1 file(s) copied.
1> ln -s libtest1.so.1.0.0 libtest1.so.1.0
1> 1 file(s) copied.
1> delcmd Debug/libtest1.so.1.0.0
1> delcmd Debug/libtest1.so
1> delcmd Debug/libtest1.so.1
1> delcmd Debug/libtest1.so.1.0
1> mv libtest1.so.1.0.0 libtest1.so libtest1.so.1 libtest1.so.1.0 Debug/
1> VisualGDB: Executing postbuild actions
1>
1>Build succeeded.
1>
1>Time Elapsed 00:00:02.25
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
the script is not entirely correct, since the command
delcmd libtest1.so.1.0.0 libtest1.so libtest1.so.1 libtest1.so.1.0
will not delete all files as it processes only 1 argument. I think this is enough for me right now though, but I will fix the script soon to correctly delete all files.
June 12, 2016 at 09:02 #8396scp_synaflexParticipantDid this ever get fixed?
I did the same as Gimq, i.e. created a QT app and then turned it in to a .lib.
I’ve tried following the steps to fix above but the link to mv.exe is broken, is there another link/wesite where I can download it from?
Thanks.
June 15, 2016 at 04:32 #8421supportKeymasterHi,
Yes, please try this one: http://sysprogs.com/files/forum/mv.exe
-
AuthorPosts
- You must be logged in to reply to this topic.