Solved help in qmake
-
this is the structure of my app's qmake .
"qpdflib" is the library and i used that lib in corepdf.
what i want to do this is i want only two qmake .
one is for the library and another is for the whole app(includeing the lib)how can i do that?
-
@saber said in help in qmake:
how can i do that?
You can't. With qmake, if you have to keep 2 separate projects under one umbrella, you have to use a thirds .pro file with SUBDIRS template.
There is a workaround, although a bit more cumbersome:
keep both projects separate (no subdirs), and simply open them separately in Qt Creator. You will have to remember to manually build your library first, and your app second. -
ok.so i tried this
giving me this warning
-
So you resigned from compiling the library and are compiling directly in your source code. Please remember that if you are using LGPL library that breaks the license terms.
Apart from that, this is a valid solution, indeed. I thought you did not want to do it like that ;-)
Regarding multiple definitions: check the headers, check if header guards (
#pragma
or ifdefs) are there, check if the same header is included twice and has some methods defined in the header (that's most likely source of this error). If so, then correct these issues (by moving the methods to source files or declaring them (probably) inline). -
Hi
You include corepdf.cpp twice.
in SOURCE +=
That gives that error. -
@sierdzio
i did not know that it could brack the license. i willing not do that.the problem is i will include this corepdf in my app CoreBox.
for this i need one qmake for my main app that could include all the cpp and header file including corepad's library.how can i do that??
note : @mrjj your solution works. but what i will do for licensing??
-
@saber
But is not all of CoreBox open source already ?
So user can recompile and change corepdf is he wants. -
-
- i don't know much about mixing licensing .
Well im not sure it it will be mixed as such.
Since qpdf will stay LGPL regardless.
But since all is open source, im not sure it will be an issue. -
so your suggesting that i can include the library in same qmake?
i will be great !!!
note : i found this
see the last term == "Same license (library)" -
@saber
Hi
Well if you include the files directly its not really a lib but compiled into exe.
but yes, with the normal IANAL (im not a lawyer) disclaimer.
Since user can change version of corepdf if they want, i think
LGPL is satisfied. -
ok .
before doing that i will inform the author . -
@saber
Good idea. You could ask him. -
@saber said in help in qmake:
the problem is i will include this corepdf in my app CoreBox.
Your corebox is GPLv2 so there is no license conflict. You can safely include qpdf.
If you want to include corepdf you have to ask the author - license file is missing so the author has full copyright and shared none of it (even if they don't know about it - often people post on GitHub assuming they share their code with the world, but without license file that is not the case).
Side note: a new module QtPdf is being created by KDAB https://www.kdab.com/browse-pdfs-in-a-qt-widgets-application/ an will )probably) be part of upstream Qt in the future.