How to add macro for the LIBS in the .PRO file
-
@ManiRon said in How to add macro for the LIBS in the .PRO file:
@ManiRon
I tried with windows it returned win32-g++ ?Ok. So you can use it on
Windows, but you have to check it withXenomai. By the way,win32-g++means that you useMinGWcompiler. Reply when you get the output forXenomai.I have a doubt?
-
@ManiRon said in How to add macro for the LIBS in the .PRO file:
@ManiRon
I tried with windows it returned win32-g++ ?Ok. So you can use it on
Windows, but you have to check it withXenomai. By the way,win32-g++means that you useMinGWcompiler. Reply when you get the output forXenomai.i generated a code in .pro file as
win32-g++{
LIBS += path
}
linux-g++ {
LIBS += path
}i am creating a bundle with the .exe and the required files and if i run this in a PC which does not have QT will it work
-
I have a doubt?
@ManiRon said in How to add macro for the LIBS in the .PRO file:
I have a doubt?
@ManiRon said in How to add macro for the LIBS in the .PRO file:
i generated a code in .pro file as
win32-g++{
LIBS += path
}
linux-g++ {
LIBS += path
}i am creating a bundle with the .exe and the required files and if i run this in a PC which does not have QT will it work
You have doubt about what? Is
linux-g++scope condition fromXenomaioutput?Also, you have to provide all the necessary
Qtlibs if theQtis not static (on thePCwhich does not haveQt) otherwise it wont work. For example, forWindows, you have to runwindeployqt.exeto getQtshared libs.Official docs about the deployment for
Windows: http://doc.qt.io/qt-5/windows-deployment.html -
i generated a code in .pro file as
win32-g++{
LIBS += path
}
linux-g++ {
LIBS += path
}i am creating a bundle with the .exe and the required files and if i run this in a PC which does not have QT will it work
So, you should have something like this in the
profile:TARGET = TestApp #Your executable filename without the extension win32-g++ { LIBS += path QMAKE_POST_LINK = $$(QTDIR)/bin/windeployqt.exe $$shell_quote($$DESTDIR/$$shell_quote($$TARGET).exe) --no-compiler-runtime }This will add one more build step to the project, but it will help to deploy all the necessary
Qtlibs. By the way, it will work only forWindowsdeployment andsharedlibsQtversion.LinuxdeploymentQtdocs here: http://doc.qt.io/qt-5/linux-deployment.html -
@ManiRon said in How to add macro for the LIBS in the .PRO file:
I have a doubt?
@ManiRon said in How to add macro for the LIBS in the .PRO file:
i generated a code in .pro file as
win32-g++{
LIBS += path
}
linux-g++ {
LIBS += path
}i am creating a bundle with the .exe and the required files and if i run this in a PC which does not have QT will it work
You have doubt about what? Is
linux-g++scope condition fromXenomaioutput?Also, you have to provide all the necessary
Qtlibs if theQtis not static (on thePCwhich does not haveQt) otherwise it wont work. For example, forWindows, you have to runwindeployqt.exeto getQtshared libs.Official docs about the deployment for
Windows: http://doc.qt.io/qt-5/windows-deployment.htmlI tried for Xenomai OS but the message($$QMAKESPEC) is not printing at . Donno why ? and i am struck
-
I tried for Xenomai OS but the message($$QMAKESPEC) is not printing at . Donno why ? and i am struck
@ManiRon said in How to add macro for the LIBS in the .PRO file:
I tried for Xenomai OS but the message($$QMAKESPEC) is not printing at . Donno why ? and i am struck
Hi! What
Qtversion do you use onXenomai? The problem might be because it can't find the compiler. -
@ManiRon said in How to add macro for the LIBS in the .PRO file:
I tried for Xenomai OS but the message($$QMAKESPEC) is not printing at . Donno why ? and i am struck
Hi! What
Qtversion do you use onXenomai? The problem might be because it can't find the compiler.@Cobra91151 using 4.7 version QT in xenomai
-
@Cobra91151 using 4.7 version QT in xenomai
So, for example you should check the directory:
...\Qt\4.7\mingw53_32\mkspecsHere is what I get:

Xenomaiis built with theLinuxkernel, so you should try all the possible scope conditions forlinux. Also, what compiler do you use onXenomai? It will help to find it faster. -
So, for example you should check the directory:
...\Qt\4.7\mingw53_32\mkspecsHere is what I get:

Xenomaiis built with theLinuxkernel, so you should try all the possible scope conditions forlinux. Also, what compiler do you use onXenomai? It will help to find it faster.how to check the compiler sir?
-
how to check the compiler sir?
You can check the compiler:
Tools=>Options=>Kits=>Compilersin theQt Creator.For example:

Are you sure you can build the empty project on
Xenomai? -
You can check the compiler:
Tools=>Options=>Kits=>Compilersin theQt Creator.For example:

Are you sure you can build the empty project on
Xenomai?Will check and say sir
-
Will check and say sir
OK. By the way, I have another solution to your problem but I can't check it because older
Qt->Q_WS*macros were dropped in favour ofQ_OS*. So I will add both solutions for older and newerQtversions.You can add macros in the code to check the
OSand load libs for example onWinOS:Qt 5.x:
#ifdef Q_OS_WIN #pragma comment(lib, "yourlibforwin") #elif Q_OS_LINUX #pragma comment(lib, "yourlibforlinux") #else #pragma comment(lib, "yourlibforxenomai") #endifDocs: http://doc.qt.io/qt-5/qtglobal.html
Qt 4.x
#ifdef Q_WS_WIN #pragma comment(lib, "yourlibforwin") #else #pragma comment(lib, "yourlibforlinux") #endif -
OK. By the way, I have another solution to your problem but I can't check it because older
Qt->Q_WS*macros were dropped in favour ofQ_OS*. So I will add both solutions for older and newerQtversions.You can add macros in the code to check the
OSand load libs for example onWinOS:Qt 5.x:
#ifdef Q_OS_WIN #pragma comment(lib, "yourlibforwin") #elif Q_OS_LINUX #pragma comment(lib, "yourlibforlinux") #else #pragma comment(lib, "yourlibforxenomai") #endifDocs: http://doc.qt.io/qt-5/qtglobal.html
Qt 4.x
#ifdef Q_WS_WIN #pragma comment(lib, "yourlibforwin") #else #pragma comment(lib, "yourlibforlinux") #endif@Cobra91151 said in How to add macro for the LIBS in the .PRO file:
comment
can i implement this in the .PRO file?
-
@Cobra91151 said in How to add macro for the LIBS in the .PRO file:
comment
can i implement this in the .PRO file?
No, you can't have it in the
.profile. So what about the compiler? Have you built the empty project onXenomai? -
No, you can't have it in the
.profile. So what about the compiler? Have you built the empty project onXenomai?Not yet checked . Once i check it will inform u sir.