hickscorp
28th March 2007, 21:58
Hello,
I have been working on setting up QT on a windows environement (MS Visual Studio .net 2003, QT 4.2.3 OpenSource ed.), and i'm ending with an issue i would like to understand.
I have been using QT on linux for some monthes, and i didnt have to bother this problem since i was using the makefiles generated by QMake, now i am using the an intel compiler integrated within Visual Studio... All this set up has been mainly made to make sure QT perfectly suits for the application we want to make (We want a photoshop plugin, so i have to make sure i can workaround the QApplication issue on Non-QT app calling a QT based DLL "plugin")...
Here is what i have done so far:
- Compiled a version of QT so it i can compile project with the MS / Intel compiler (NMake as the main compiler command).
- Set up a very minimalistic pre-build batch which does basically a RCC on needed pictures files, and UIC on GUI files.
- When i start the build in VS, the batch file is started, so the ui_*.cpp and res_*.cpp get generated.
Note that the MS VS project is *not* a Makefile project, it is a basic .vsproj with compiler options set in the VC project.
However, i am now unable to use the compiled pictures in my binary, i get this error at compile time:
CWndMainImpl.obj error LNK2005: "int __cdecl qCleanupResources(void)" (?qCleanupResources@@YAHXZ) already defined in PluginMain.obj
CWndMainImpl.obj error LNK2005: "int __cdecl qInitResources(void)" (?qInitResources@@YAHXZ) already defined in PluginMain.obj
CWndMainImpl.obj error LNK2005: "class qCleanupResources__dest_class__ qCleanupResources__dest_instance__" (?qCleanupResources__dest_instance__@@3VqCleanupRe sources__dest_class__@@A) already defined in PluginMain.obj
So, i have tried to go in my "precompiled" resources .h file, and remove those 3 static methods, it finally compiles but the program is then unable to retrieve the pictures data (No error, just no pictures).
I am sort of disapointed, because i was really pleased using QT on my usual linux environement, and i feel pretty uncomfortable under windows anyway... But for some reason, i cant switch back to Linux unless i have done a "compilable" project for windows, some of my coworkers will need it...
Any kind of help will be greatly appreciated :)
Pierre.
I have been working on setting up QT on a windows environement (MS Visual Studio .net 2003, QT 4.2.3 OpenSource ed.), and i'm ending with an issue i would like to understand.
I have been using QT on linux for some monthes, and i didnt have to bother this problem since i was using the makefiles generated by QMake, now i am using the an intel compiler integrated within Visual Studio... All this set up has been mainly made to make sure QT perfectly suits for the application we want to make (We want a photoshop plugin, so i have to make sure i can workaround the QApplication issue on Non-QT app calling a QT based DLL "plugin")...
Here is what i have done so far:
- Compiled a version of QT so it i can compile project with the MS / Intel compiler (NMake as the main compiler command).
- Set up a very minimalistic pre-build batch which does basically a RCC on needed pictures files, and UIC on GUI files.
- When i start the build in VS, the batch file is started, so the ui_*.cpp and res_*.cpp get generated.
Note that the MS VS project is *not* a Makefile project, it is a basic .vsproj with compiler options set in the VC project.
However, i am now unable to use the compiled pictures in my binary, i get this error at compile time:
CWndMainImpl.obj error LNK2005: "int __cdecl qCleanupResources(void)" (?qCleanupResources@@YAHXZ) already defined in PluginMain.obj
CWndMainImpl.obj error LNK2005: "int __cdecl qInitResources(void)" (?qInitResources@@YAHXZ) already defined in PluginMain.obj
CWndMainImpl.obj error LNK2005: "class qCleanupResources__dest_class__ qCleanupResources__dest_instance__" (?qCleanupResources__dest_instance__@@3VqCleanupRe sources__dest_class__@@A) already defined in PluginMain.obj
So, i have tried to go in my "precompiled" resources .h file, and remove those 3 static methods, it finally compiles but the program is then unable to retrieve the pictures data (No error, just no pictures).
I am sort of disapointed, because i was really pleased using QT on my usual linux environement, and i feel pretty uncomfortable under windows anyway... But for some reason, i cant switch back to Linux unless i have done a "compilable" project for windows, some of my coworkers will need it...
Any kind of help will be greatly appreciated :)
Pierre.