I have developed an application using kdeveloper in linux, Now I want ot port it to windows. What changes I have to made it to port to windows.
I have developed an application using kdeveloper in linux, Now I want ot port it to windows. What changes I have to made it to port to windows.
As long as you stick to Qt, none. There can be issues with filenames (drives, / or \, etc), header files, focusing on advanced pop-ups (such as IntelliType), but a normal app should be portable as it is.
I have ceate project using kdevelop.
I compiled it on windows, I have appropriate changes in make file (I changed path ). and compile. Copmiler shows followin error.
======================
makefile:168: warning: overriding commands for target `.'
makefile:165: warning: ignoring old commands for target `.'
g++ -Wl,-enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo
-reloc -mthreads -Wl,-s -Wl,-subsystem,windows -e __Z19QtWinMainCRTStartupv -o m
ymplayer .obj/main.o .obj/myform.o .obj/playlist.o .obj/fileinfo.o .obj/equilize
r.o .obj/previewmp.o .obj/mplayerprocess.o .obj/importwiz.o .obj/mpfileinfo.o .o
bj/passwordform.o .obj/mainform.o .obj/PlayList.o .obj/EquilizerForm.o .obj/Prev
iewForm.o .obj/ImportForm.o .obj/InfoDiag.o .obj/passwordDiag.o .obj/moc_myform.
o .obj/moc_playlist.o .obj/moc_equilizer.o .obj/moc_previewmp.o .obj/moc_mplayer
process.o .obj/moc_importwiz.o .obj/moc_mpfileinfo.o .obj/moc_passwordform.o .ob
j/moc_mainform.o .obj/moc_PlayList.o .obj/moc_EquilizerForm.o .obj/moc_PreviewFo
rm.o .obj/moc_ImportForm.o .obj/moc_InfoDiag.o .obj/moc_passwordDiag.o -L"C:\qt-
3\lib" -lqtmain -lqt-mt -lkernel32 -luser32 -lgdi32 -lcomdlg32 -ladvapi32 -lshel
l32 -lole32 -loleaut32 -luuid -limm32 -lwinmm -lwsock32 -lwinspool
.obj/PlayList.o(.text+0x0): In function `ZN12PlayListForm6removeEv':
/usr/lib/qt-3.3/include/qglist.h:150: multiple definition of `ZN12PlayListForm6r
emoveEv'
.obj/playlist.o(.text+0x0):/usr/lib/qt-3.3/include/qglist.h:150: first defined h
ere
.obj/PlayList.o(.text+0x10): In function `ZN12PlayListForm3addEv':
.ui/PlayList.cpp:102: multiple definition of `ZN12PlayListForm3addEv'
.obj/playlist.o(.text+0x10):.ui/PlayList.cpp:102: first defined here
.obj/PlayList.o(.text+0x20): In function `ZN12PlayListFormD0Ev':
.ui/PlayList.cpp:80: multiple definition of `ZN12PlayListFormD0Ev'
.obj/playlist.o(.text+0x20):.ui/PlayList.cpp:80: first defined here
.obj/PlayList.o(.text+0x50): In function `ZN12PlayListFormD1Ev':
.ui/PlayList.cpp:80: multiple definition of `ZN12PlayListFormD1Ev'
.obj/playlist.o(.text+0x50):.ui/PlayList.cpp:80: first defined here
.obj/PlayList.o(.text+0x70): In function `ZN12PlayListFormD2Ev':
.ui/PlayList.cpp:80: multiple definition of `ZN12PlayListFormD2Ev'
.obj/playlist.o(.text+0x70):.ui/PlayList.cpp:80: first defined here
.obj/PlayList.o(.text+0x90): In function `ZN12PlayListForm14languageChangeEv':
.ui/PlayList.cpp:89: multiple definition of `ZN12PlayListForm14languageChangeEv'
.obj/playlist.o(.text+0x90):.ui/PlayList.cpp:89: first defined here
.obj/PlayList.o(.text+0x420): In function `ZN12PlayListFormC1EP7QWidgetPKcbj':
.ui/PlayList.cpp:27: multiple definition of `ZN12PlayListFormC1EP7QWidgetPKcbj'
.obj/playlist.o(.text+0x420):.ui/PlayList.cpp:27: first defined here
.obj/PlayList.o(.text+0x970): In function `ZN12PlayListFormC2EP7QWidgetPKcbj':
.ui/PlayList.cpp:27: multiple definition of `ZN12PlayListFormC2EP7QWidgetPKcbj'
.obj/playlist.o(.text+0x970):.ui/PlayList.cpp:27: first defined here
.obj/moc_PlayList.o(.text+0x0): In function `ZNK12PlayListForm9classNameEv':
/usr/lib/qt-3.3/include/qglist.h:150: multiple definition of `ZNK12PlayListForm9
classNameEv'
.obj/moc_playlist.o(.text+0x0):/usr/lib/qt-3.3/include/qglist.h:150: first defin
ed here
.obj/moc_PlayList.o(.text+0x10): In function `ZN12PlayListForm18qt_static_proper
tyEP7QObjectiiP8QVariant':
.moc/moc_PlayList.cpp:106: multiple definition of `ZN12PlayListForm18qt_static_p
ropertyEP7QObjectiiP8QVariant'
.obj/moc_playlist.o(.text+0x10):.moc/moc_PlayList.cpp:106: first defined here
.obj/moc_PlayList.o(.text+0x160): In function `ZN12PlayListForm16staticMetaObjec
tEv':
.moc/moc_PlayList.cpp:50: multiple definition of `ZN12PlayListForm16staticMetaOb
jectEv'
.obj/moc_playlist.o(.text+0x160):.moc/moc_PlayList.cpp:50: first defined here
.obj/moc_PlayList.o(.text+0xa0): In function `ZN12PlayListForm11qt_propertyEiiP8
QVariant':
.moc/moc_PlayList.cpp:101: multiple definition of `ZN12PlayListForm11qt_property
EiiP8QVariant'
.obj/moc_playlist.o(.text+0xa0):.moc/moc_PlayList.cpp:101: first defined here
.obj/moc_PlayList.o(.text+0xd0): In function `ZN12PlayListForm7qt_emitEiP8QUObje
ct':
.moc/moc_PlayList.cpp:95: multiple definition of `ZN12PlayListForm7qt_emitEiP8QU
Object'
.obj/moc_playlist.o(.text+0xd0):.moc/moc_PlayList.cpp:95: first defined here
.obj/moc_PlayList.o(.text+0x100): In function `ZN12PlayListForm7qt_castEPKc':
.moc/moc_PlayList.cpp:76: multiple definition of `ZN12PlayListForm7qt_castEPKc'
.obj/moc_playlist.o(.text+0x100):.moc/moc_PlayList.cpp:76: first defined here
.obj/moc_PlayList.o(.bss+0x0): multiple definition of `ZN12PlayListForm7metaObjE
'
.obj/moc_playlist.o(.bss+0x0): first defined here
.obj/moc_PlayList.o(.text+0x200): In function `ZN12PlayListForm9qt_invokeEiP8QUO
bject':
.moc/moc_PlayList.cpp:83: multiple definition of `ZN12PlayListForm9qt_invokeEiP8
QUObject'
.obj/moc_playlist.o(.text+0x200):.moc/moc_PlayList.cpp:83: first defined here
.obj/moc_PlayList.o(.text+0x2a0): In function `ZN12PlayListForm6trUtf8EPKcS1_':
.moc/moc_PlayList.cpp:39: multiple definition of `ZN12PlayListForm6trUtf8EPKcS1_
'
.obj/moc_playlist.o(.text+0x2a0):.moc/moc_PlayList.cpp:39: first defined here
.obj/moc_PlayList.o(.text+0x310): In function `ZN12PlayListForm2trEPKcS1_':
.moc/moc_PlayList.cpp:31: multiple definition of `ZN12PlayListForm2trEPKcS1_'
.obj/moc_playlist.o(.text+0x310):.moc/moc_PlayList.cpp:31: first defined here
C:\MinGW\bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\ mingw32\bin\ld.exe: cannot fin
d -lqtmain
collect2: ld returned 1 exit status
mingw32-make: *** [mymplayer] Error 1
=================
make file atteched.
I have renamed make for atteching.
Don't edit the Makefile --- just generate a new one from the .pro file.Originally Posted by safknw
Well, I wrote a little blurb on how I develop QT applications across Windows and Linux. Here it is:Originally Posted by safknw
http://www.hardgeus.com/index.php?ndailyupdateid=685
First, a couple of notes: I don't use KDevelop...I use vim for editing my code. I do, however use QT Designer to design dialogs etc. My build environment is a tad specific to what I'm doing (QT 4 only). Finally, I don't use qmake or anything, I use the Scons tool, which is dependent on Python. Don't panic, Python and Scons are extremely easy to install on both Linux and Windows.
i recreated make file and compile it shows following error.
=========
D:\saf\myMplayer0.8>mingw32-make
makefile:415: warning: overriding commands for target `.ui\PlayList.h'
makefile:403: warning: ignoring old commands for target `.ui\PlayList.h'
makefile:418: warning: overriding commands for target `.ui\PlayList.cpp'
makefile:406: warning: ignoring old commands for target `.ui\PlayList.cpp'
makefile:421: warning: overriding commands for target `.ui\EquilizerForm.h'
makefile:379: warning: ignoring old commands for target `.ui\EquilizerForm.h'
makefile:424: warning: overriding commands for target `.ui\EquilizerForm.cpp'
makefile:382: warning: ignoring old commands for target `.ui\EquilizerForm.cpp'
makefile:427: warning: overriding commands for target `.ui\PreviewForm.h'
makefile:409: warning: ignoring old commands for target `.ui\PreviewForm.h'
makefile:430: warning: overriding commands for target `.ui\PreviewForm.cpp'
makefile:412: warning: ignoring old commands for target `.ui\PreviewForm.cpp'
makefile:433: warning: overriding commands for target `.ui\ImportForm.h'
makefile:385: warning: ignoring old commands for target `.ui\ImportForm.h'
makefile:436: warning: overriding commands for target `.ui\ImportForm.cpp'
makefile:388: warning: ignoring old commands for target `.ui\ImportForm.cpp'
makefile:439: warning: overriding commands for target `.ui\InfoDiag.h'
makefile:391: warning: ignoring old commands for target `.ui\InfoDiag.h'
makefile:442: warning: overriding commands for target `.ui\InfoDiag.cpp'
makefile:394: warning: ignoring old commands for target `.ui\InfoDiag.cpp'
makefile:445: warning: overriding commands for target `.ui\passwordDiag.h'
makefile:397: warning: ignoring old commands for target `.ui\passwordDiag.h'
makefile:448: warning: overriding commands for target `.ui\passwordDiag.cpp'
makefile:400: warning: ignoring old commands for target `.ui\passwordDiag.cpp'
makefile:471: warning: overriding commands for target `.obj\playlist.o'
makefile:337: warning: ignoring old commands for target `.obj\playlist.o'
makefile:479: warning: overriding commands for target `.obj\playlist.o'
makefile:471: warning: ignoring old commands for target `.obj\playlist.o'
makefile:483: warning: overriding commands for target `.obj\EquilizerForm.o'
makefile:455: warning: ignoring old commands for target `.obj\EquilizerForm.o'
makefile:487: warning: overriding commands for target `.obj\PreviewForm.o'
makefile:475: warning: ignoring old commands for target `.obj\PreviewForm.o'
makefile:491: warning: overriding commands for target `.obj\ImportForm.o'
makefile:459: warning: ignoring old commands for target `.obj\ImportForm.o'
makefile:495: warning: overriding commands for target `.obj\InfoDiag.o'
makefile:463: warning: ignoring old commands for target `.obj\InfoDiag.o'
makefile:499: warning: overriding commands for target `.obj\passwordDiag.o'
makefile:467: warning: ignoring old commands for target `.obj\passwordDiag.o'
makefile:551: warning: overriding commands for target `.obj\moc_playlist.o'
makefile:510: warning: ignoring old commands for target `.obj\moc_playlist.o'
makefile:557: warning: overriding commands for target `.obj\moc_playlist.o'
makefile:551: warning: ignoring old commands for target `.obj\moc_playlist.o'
makefile:560: warning: overriding commands for target `.obj\moc_EquilizerForm.o'
makefile:539: warning: ignoring old commands for target `.obj\moc_EquilizerForm.
o'
makefile:563: warning: overriding commands for target `.obj\moc_PreviewForm.o'
makefile:554: warning: ignoring old commands for target `.obj\moc_PreviewForm.o'
makefile:566: warning: overriding commands for target `.obj\moc_ImportForm.o'
makefile:542: warning: ignoring old commands for target `.obj\moc_ImportForm.o'
makefile:569: warning: overriding commands for target `.obj\moc_InfoDiag.o'
makefile:545: warning: ignoring old commands for target `.obj\moc_InfoDiag.o'
makefile:572: warning: overriding commands for target `.obj\moc_passwordDiag.o'
makefile:548: warning: ignoring old commands for target `.obj\moc_passwordDiag.o
'
makefile:614: warning: overriding commands for target `.moc\moc_playlist.cpp'
makefile:578: warning: ignoring old commands for target `.moc\moc_playlist.cpp'
makefile:620: warning: overriding commands for target `.moc\moc_playlist.cpp'
makefile:614: warning: ignoring old commands for target `.moc\moc_playlist.cpp'
makefile:623: warning: overriding commands for target `.moc\moc_EquilizerForm.cp
p'
makefile:602: warning: ignoring old commands for target `.moc\moc_EquilizerForm.
cpp'
makefile:626: warning: overriding commands for target `.moc\moc_PreviewForm.cpp'
makefile:617: warning: ignoring old commands for target `.moc\moc_PreviewForm.cp
p'
makefile:629: warning: overriding commands for target `.moc\moc_ImportForm.cpp'
makefile:605: warning: ignoring old commands for target `.moc\moc_ImportForm.cpp
'
makefile:632: warning: overriding commands for target `.moc\moc_InfoDiag.cpp'
makefile:608: warning: ignoring old commands for target `.moc\moc_InfoDiag.cpp'
makefile:635: warning: overriding commands for target `.moc\moc_passwordDiag.cpp
'
makefile:611: warning: ignoring old commands for target `.moc\moc_passwordDiag.c
pp'
g++ -c -mthreads -Wall -O2 -fexceptions -frtti -DUNICODE -DQT_DLL -DQT_THREAD_S
UPPORT -DQT_NO_DEBUG -I"C:\qt-3\include" -I".ui" -I"." -I"." -I".moc" -I"C:\qt-3
\mkspecs\win32-g++" -o .obj\main.o main.cpp
In file included from C:/qt-3/include/qiconset.h:43,
from C:/qt-3/include/qpushbutton.h:43,
from myform.h:21,
from main.cpp:2:
C:/qt-3/include/qpixmap.h:249: warning: 'void bitBlt(QPaintDevice*, int, int, co
nst QPaintDevice*, int, int, int, int, Qt::RasterOp, bool)' redeclared without d
llimport attribute after being referenced with dllimport linkage
In file included from myform.h:27,
from main.cpp:2:
playlist.h:21: error: expected class-name before '{' token
mingw32-make: *** [.obj\main.o] Error 1
===========
Could you post your .pro file?
I would assume that your Linux project is using QT 3, and I would further assume that your Windows install of QT is QT4? I couldn't get even a "Hello World" example to compile under Windows when the .cpp files were generated with the QT3 tools. Hell, I couldn't even get it to work when only my .ui files were generated with QT3!
I know you probably don't want to hear this, but you're probably better off starting from scratch and first trying to get a simple "Hello world" example cross compiling on both Windows and Linux rather than taking an existing large codebase generated in KDevelop and trying to get it working under Windows.
Here is my project (.pro) file
You add all forms (except mainform.ui) twice to the FORMS variable.Originally Posted by safknw
safknw (11th May 2006)
I successfully compiled my project in windows.
Now the problem is that while I run the application and click on a button in response of which I start a process. (process->start). It crashes and shows following error.
AppName: mymplayer.exe AppVer: 0.0.0.0 ModName: msvcrt.dll
ModVer: 7.0.2600.2180 Offset: 000323e4
Compile your application in debug mode, run it from the debugger and see where exactly it crashes.Originally Posted by safknw
How to compile in debug mode.Originally Posted by jacek
![]()
Make sure you have built Qt in debug mode, then add "CONFIG += debug" to your .pro file. Although, AFAIR, in windows qmake builds applications by default in both release and debug mode at once.Originally Posted by safknw
I have complied in debug mode and run the application and it shows access violation in msvcrt.dll.
What does this means and how solve it .
Could you post the backtrace?
sorry.Originally Posted by jacek
I didn't show the backtrace .
Can I debug this application using gnu debugger on windows. If yes How? Is there any gui based debugger for qt applications.
Download gdb from www.mingw.org.Originally Posted by safknw
You can use any debugger you want.Originally Posted by safknw
That's probably the first of possibly several dll's that you'll need.Originally Posted by safknw
Go to Microsoft's website and download their free "Dependency Checker". Run it on your exe and it will tell you what your QT app cannot find when it tried to run.
Do a file search for those missing dlls and either copy them to your app directory or add their location to your PATH.
I don't think the problem is a missing dependency...If that were the case, it would have immediately reported the missing DLL and not run the program. He's having a problem after the program runs, i.e. the crash is occurring *in* the DLL, therefore the DLL is there.Originally Posted by GreyGeek
Bookmarks