Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
how to link the object file to a Qt
I wrote one simple code in terminal
which displays "Hi"
compiled that test.c file with the help of cross compiler,"arm-linux-gnueabihf-gcc" and generated a object file.
next I copied that object file into my beagleboneboard,using
scp test firstname.lastname@example.org:/test
now I want to link this object file which is present in beagleboneboard into Qt,
is it possible to link this object file to Qt? if yes,
then please suggest me how to link ,what are the steps to link that object file in to Qt?
In your Qt project file on the beagleboneboard, add
LIBS += THEFILE.o
and make sure that the .o file is in the project folder.
This assumes that its the same compiler on the board as the one
that produced the .o file.
Wildly variation in compiler versions might prevent it from working.
"In your Qt project file on the beagleboneboard, add
LIBS += THEFILE.o"
It means I have to add that LIBS +=file.o to my beagleboard test file(executable file)?
you must add it to the project on the board so you can compile the .-o into your new exe file.
if you try to like add an o file to binary exe, that wont work.
But I am not getting this
"you must add it to the project on the board"(in board I have only one executable file,that is test)
I need to add it on my qt project file in my system?
You need need to add it to the .pro file that produces the Qt application.
So it can be linked into the new exe file.
You can not added to an already compiled app.
So you need to add the .o to the project file for the app, where you want to include the .o file.
I am running the application on qt,but not getting the output on qt creator app,
the result i am getting on vnc platform,via command prompt..
so I created .pro file in command prompt,and linked the object file(c++ object file),while executing this object file getting the result in command prompt ,not in vnc platform...
so my question is, is it possible to link the cpp files to qt projects? if yes, how?
the cpp file is:
using namespace std;
You can just include the wanted .cpp in the .pro file or
make file or what you use to compile. You can also link it into the porject as an .o file. However, if you have a main in the new .cpp that wont work as
there already is a main for the qt app.
Im not sure what you mean by
"while executing this object file getting the result in command prompt ,not in vnc platform.."