Linker issues only in QT Creator using MinGw64
-
Are these static or dynamic librairies ?
If the later, did you properly export the symbols of your library ? -
I tried both static and dynamic libraries.
I would rather dynamic ones. I have a library that i use in all my softwares and when i compile i can find the .dll file only. I take that and all the headers files and copy them to the project that uses this library, but it cannot resolve symbols because it requires an import library (.lib), so it compiles because it finds all the headers but it does not link and so it fails. -
Then the important point: are you properly exporting you libraries symbol ?
-
What do you mean? With MinGw i used to simply compile and deploy the library. I setted up the IDE with install argument and all the install paths so it used to export in /dist all the header (copied) and the .a and .dll files, and it used to work like a charm. I don't know how to do it with MSVC neither where to find infos on how to do it. I'm just compiling and getting the .dll (or .lib if i configure for static library) and that's it...I'm probably forgetting something.
-
-
I've never find such a page.. although i looked for it for a lot.
I managed to compile my library but it does not work on the client side. It's because i have some classes such:class Q_DECL_EXPORT myClass : std::exception { //blablabla }and so, it doesn't work because while there's not problem with "myClass", base class "exception" of C++ must be "exportable", and it's not.
How can i export in the dll exporting table a symbol of the C++ system libraries?
-
You did not follow the example correctly. You are not supposed to use the two Qt macros directly.
Create your own that will use them both like shown in the documentation I linked.
-
I did everything correctly. I created my own macro and used it, i wrote "Q_DECL_EXPORT" in the example to clarify. I don't even have a class called "myClass" for that matter.
-
Symbol exportation does not apply only to classes.
Can you show your actual code ?
-
Thank you, i solved the problem! Now everything works fine, there was an unhandled exception in my code and i thought it was a link issue but it wasn't. The library builds and links with no problem now, thanks again!