Can't generate shared library on ubuntu and can't link statically to a static library
-
Tried both with the same result too.
-
something I didn't mention as I didn't think it was related , I build the shared library with Qt static library which I built from sources .
Now when I try to build the shared library with the same version of Qt but dynamic it builds and generates .so file and the test application runs normally.
What might cause this ? -
something I didn't mention as I didn't think it was related , I build the shared library with Qt static library which I built from sources .
Now when I try to build the shared library with the same version of Qt but dynamic it builds and generates .so file and the test application runs normally.
What might cause this ?@Mohammedbie said in Can't generate shared library on ubuntu and can't link statically to a static library:
something I didn't mention as I didn't think it was related , I build the shared library with Qt static library which I built from sources .
Now when I try to build the shared library with the same version of Qt but dynamic it builds and generates .so file and the test application runs normally.
What might cause this ?Hm, not sure but maybe your Qt config or mkspecs leak into definitions of your project when qmake is run.
Try adding this in your shared lib .pro file:
CONFIG -= staticlib CONFIG += shared -
Thank you very much .
This solved it. -
@sierdzio sorry for bothering you but one last thing how to convert those lines to a cmake line ?
Thanks in advance
-
@sierdzio sorry for bothering you but one last thing how to convert those lines to a cmake line ?
Thanks in advance
@Mohammedbie said in Can't generate shared library on ubuntu and can't link statically to a static library:
@sierdzio sorry for bothering you but one last thing how to convert those lines to a cmake line ?
Thanks in advance
No idea, I don't know cmake well enough.
-
Ok thanks.
-
Hi,
You set that in the call to add_library.
-
Hi ,
what I understood from cmake documentation is that add_library() configure the current project as a library and don't add an external library what I used instead was target_link_libraries() and it did the job indeed. -
Ok, from you .pro file it looked like you were generating libraries.