View Full Version : Q_init_resource
phillip_Qt
11th March 2008, 07:11
Hi all.
I created a folder and saved a qrc file there. in another folder i ve a main() and inside that main I ve added Q_INIT_RESOURCE(stylesheet);
While building the whole solution Im getting error like
Linking...
: error LNK2019: unresolved external symbol "int __cdecl qInitResources_stylesheet(void)" (?qInitResources_stylesheet@@YAHXZ) referenced in function _main
so i need all of ur kind help.
Thanx.
jpn
11th March 2008, 07:36
How does this problem differ from the problem in this another thread of yours: Q_init_resource (http://www.qtcentre.org/forum/f-qt-programming-2/t-q-init-resource-12186.html)?
phillip_Qt
11th March 2008, 12:34
How does this problem differ from the problem in this another thread of yours: Q_init_resource (http://www.qtcentre.org/forum/f-qt-programming-2/t-q-init-resource-12186.html)?
This is because i was only trying to execute that example alone.
But I'm trying to add it in my project as a DLL. so im getting so much error. I ve a small doubt. Can i add Ui files in dll.?
Plz do a reply.
jpn
11th March 2008, 14:49
Wait, your first post states nothing about DLL, but main(). Could you clearly state
- where do you have Q_INIT_RESOURCES()
- in which .pro file you have the corresponding resource file
phillip_Qt
12th March 2008, 10:23
Wait, your first post states nothing about DLL, but main(). Could you clearly state
- where do you have Q_INIT_RESOURCES()
- in which .pro file you have the corresponding resource file
K. In my project some 15 modules are there. one module is a exe. But my module is a dll. i ve include the Q_INIT_RESOURCES in the main() of that exe module. and created a pointer of stylesheet there. while trying to allocate memory its showing
error LNK2019: unresolved external symbol "public: __thiscall StyleSheet::StyleSheetEditor::StyleSheetEditor(cla ss QWidget *)"
and error LNK2019: unresolved external symbol "int __cdecl qInitResources_stylesheet(void)" (?qInitResources_stylesheet@@YAHXZ) referenced in function _main for Q_INIT_RESOURCES. I'm doing all these through cmake.i cannt understand what to do. Can u help me?:(
phillip_Qt
12th March 2008, 11:29
K. In my project some 15 modules are there. one module is a exe. But my module is a dll. i ve include the Q_INIT_RESOURCES in the main() of that exe module. and created a pointer of stylesheet there. while trying to allocate memory its showing
error LNK2019: unresolved external symbol "public: __thiscall StyleSheet::StyleSheetEditor::StyleSheetEditor(cla ss QWidget *)"
and error LNK2019: unresolved external symbol "int __cdecl qInitResources_stylesheet(void)" (?qInitResources_stylesheet@@YAHXZ) referenced in function _main for Q_INIT_RESOURCES. I'm doing all these through cmake.i cannt understand what to do. Can u help me?:(
I'm building the solution by using CMake.
phillip_Qt
17th March 2008, 06:37
Hi all. Ive posted this msg befor some day. But did not get replies to solve. so posting it again. I've one solution having a qrc file and its a Dll. and in another solution having main() and its a exe. I added Q_INIT_RESOURCES there. I'm creating the solution by using cmake. but if im compiling whole project I'm geeting error error LNK2001: unresolved external symbol for Q_INIT_RESOURCES. If im commenting it out then everything is ok. I cannt understand what to do.
so i need ur kind help.
Thanx.
sonuani
17th March 2008, 09:31
Where r u adding ur Q_INIT_RESOURCE??
phillip_Qt
17th March 2008, 09:38
Where r u adding ur Q_INIT_RESOURCE??
The structure is like this.
Projece
|----|-.cpp file
| |-.qrc file, qss files
| |-.h file (This module is dll)
|
|
|----|-.cpp file. here ive put Q_INIT_RESOURCE inside main() . and this module is exe.
| |-.h file
Am i right?:confused:
jpn
17th March 2008, 18:49
{ Two threads merged }
Please, do not start new threads on the same problem.
Move the Q_INIT_RESOURCE() to somewhere in the DLL project.
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.