Solved Static link: Q_IMPORT_PLUGIN(qico) unresolved external symbol
-
Ok, but how can I use a .pro file? SO far as I know, Visual Studio don´t using the .pro file for compiling the application.
And there are no .pro, .pri or other Qt files in my project folder. -
I suggest you to use Qt Creator for developing but Visual Studio only for compilation. I think Creator is much more better for editing Qt sources.
Qt Creator will make a .pro file for new project. -
Sorry but I am not satisfied with this answer. I have created my Application complete in VS. Until I switched to static version everything has worked correctly. And after switching to static I could import the windows plugin (Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)) without any problems.
There must be a solution to do the same with ico plugin. If is it an issue, it should be reported and fixed.
To switch an IDE each time if something doesn´t woks, it´s not a solution for me. -
Silly question but… Since you built Qt yourself, are you sure that you built the ico image format ?
-
[quote author="SGaist" date="1386279598"]Silly question but… Since you built Qt yourself, are you sure that you built the ico image format ?[/quote]
How can I check it in the build version?
I have never said that I have built Qt by myself. I got it from a friend. It´s version 5.1.2 from the stable git repository. In the plugins/imageformats folder I got qico.lib and qicod.lib. -
[quote author="igromanru" date="1386089950"]Ok, but how can I use a .pro file? SO far as I know, Visual Studio don´t using the .pro file for compiling the application.
And there are no .pro, .pri or other Qt files in my project folder.[/quote]
Then add the qico.lib to the project's "Additional Dependencies" option.
Right click on the project and click Properties. In the "Linker"-Section you can add the qico.lib file and set a "Additional Library Directories". So the Linker can find the symbols. -
[quote author="raven-worx" date="1386317327"]
Then add the qico.lib to the project's "Additional Dependencies" option.
Right click on the project and click Properties. In the "Linker"-Section you can add the qico.lib file and set a "Additional Library Directories". So the Linker can find the symbols.
[/quote]
I got it all the time.
That how it looks like: "JPG":https://www.dropbox.com/s/gf0work3tdci24h/add_dep.JPG (German version)
It´s a screenshot of the debug settings, but the release settings looks similiar. -
and $(QTDIR) points to the correct path? You can check if you click on the "Command Line" entry in the Linker section
-
[quote author="raven-worx" date="1386321519"]and $(QTDIR) points to the correct path? You can check if you click on the "Command Line" entry in the Linker section[/quote]
If $(QTDIR) would be a wrong path, I would have many problems in the whole project. And the windows plugin works too. -
haha...good point... sry for this :)
-
No more ideas?
I think I will try to make a static build by myself. Maybe it will help. -
This works for me:
...
Q_IMPORT_PLUGIN (QICOPlugin)
...I have looked in qicod.lib and have found qt_static_plugin_QICOPlugin function symbol.
-
[quote author="igromanru" date="1386003876"]
"Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)" works great.
[/quote]Which libraries did you link with to get this to work? I'm trying to clear up a small hand full of linker errors with qwindows.lib.
-
[quote author="couragic" date="1390806939"]This works for me:
...
Q_IMPORT_PLUGIN (QICOPlugin)
...I have looked in qicod.lib and have found qt_static_plugin_QICOPlugin function symbol.[/quote]
Thank you very much. This was the solution![quote author="steno" date="1393375998"][quote author="igromanru" date="1386003876"]
"Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)" works great.
[/quote]Which libraries did you link with to get this to work? I'm trying to clear up a small hand full of linker errors with qwindows.lib.[/quote]
Sorry for late answer.
This is all my linked LIBs:
qtmain.lib
Qt5Core.lib
Qt5Gui.lib
Qt5Widgets.lib
qico.lib
ws2_32.lib
sicudt.lib
sicuuc.lib
qminimal.lib
qwindows.lib
opengl32.lib
Qt5PlatformSupport.lib
imm32.lib
winmm.lib -
i got this message from CONFIG+=static
the problem is that StaticqicoPluginInstance is nowhere in the 5.4 package. it has no qico.lib
-
Hi and welcome to devnet,
You won't find this file in a Qt package as they only provide dynamic libraries. If you want a static Qt you'll have to build it yourself. Be aware of the licensing issues that comes with it.
-
You need to add QT_STATICPLUGIN to your preprocessor macro, when buildimg plugin