Results 1 to 20 of 25

Thread: how to corss compile for windows in Linux

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2006
    Posts
    58
    Thanks
    12
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to corss compile for windows in Linux

    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.

  2. #2
    Join Date
    May 2006
    Location
    Pune,India
    Posts
    63
    Thanks
    7
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to corss compile for windows in Linux

    Here is my project (.pro) file
    Attached Files Attached Files

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to corss compile for windows in Linux

    Quote Originally Posted by safknw
    Here is my project (.pro) file
    You add all forms (except mainform.ui) twice to the FORMS variable.

  4. The following user says thank you to jacek for this useful post:

    safknw (10th May 2006)

  5. #4
    Join Date
    May 2006
    Location
    Pune,India
    Posts
    63
    Thanks
    7
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to corss compile for windows in Linux

    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

  6. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to corss compile for windows in Linux

    Quote Originally Posted by safknw
    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
    Compile your application in debug mode, run it from the debugger and see where exactly it crashes.

  7. #6
    Join Date
    May 2006
    Location
    Pune,India
    Posts
    63
    Thanks
    7
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to corss compile for windows in Linux

    Quote Originally Posted by jacek
    Compile your application in debug mode, run it from the debugger and see where exactly it crashes.
    How to compile in debug mode.

  8. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to corss compile for windows in Linux

    Quote Originally Posted by safknw
    How to compile in debug mode.
    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.

  9. #8
    Join Date
    May 2006
    Location
    Pune,India
    Posts
    63
    Thanks
    7
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Unhappy Re: how to corss compile for windows in Linux

    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 .

  10. #9
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to corss compile for windows in Linux

    Could you post the backtrace?

  11. #10
    Join Date
    May 2006
    Location
    Pune,India
    Posts
    63
    Thanks
    7
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to corss compile for windows in Linux

    Quote Originally Posted by jacek
    Could you post the backtrace?
    sorry.
    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.

  12. #11
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to corss compile for windows in Linux

    Quote Originally Posted by safknw
    Can I debug this application using gnu debugger on windows. If yes How?
    Download gdb from www.mingw.org.

    Quote Originally Posted by safknw
    Is there any gui based debugger for qt applications.
    You can use any debugger you want.

  13. #12
    Join Date
    Jan 2006
    Location
    Lincoln, NE USA
    Posts
    177
    Thanks
    3
    Thanked 7 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to corss compile for windows in Linux

    Quote Originally Posted by safknw
    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
    That's probably the first of possibly several dll's that you'll need.
    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.

  14. #13
    Join Date
    May 2006
    Posts
    58
    Thanks
    12
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to corss compile for windows in Linux

    Quote Originally Posted by GreyGeek
    That's probably the first of possibly several dll's that you'll need.
    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.

  15. #14
    Join Date
    May 2006
    Location
    Pune,India
    Posts
    63
    Thanks
    7
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to corss compile for windows in Linux

    Here is the backtrace.

    =======
    Starting program: D:\Sharique\win\myMplayer0.9/mymplayer.exe

    Program received signal SIGSEGV, Segmentation fault.
    0x77c423e4 in _libkernel32_a_iname ()
    (gdb) backstrace
    Undefined command: "backstrace". Try "help".
    (gdb) backtrace
    #0 0x77c423e4 in _libkernel32_a_iname ()
    #1 0x0022d09c in ?? ()
    #2 0x77c3ffb9 in _libkernel32_a_iname ()
    #3 0x104e41a3 in qt_mt3_dll_iname ()
    #4 0x0040472b in myForm:lay_file(QString) ()
    #5 0x004065c6 in myForm::stop() ()
    #6 0x00402ca5 in myForm::show_playlist() ()
    #7 0x00428c63 in mainForm::qt_invoke(int, QUObject*) (this=0x22fdd0, _id=61,
    _o=0x22f3fc) at .moc/moc_mainform.cpp:147
    #8 0x00426267 in myForm::qt_invoke(int, QUObject*) (this=0x22fdd0, _id=61,
    _o=0x22f3fc) at .moc/moc_myform.cpp:175
    #9 0x100c3bec in qt_mt3_dll_iname ()
    #10 0x100c495f in qt_mt3_dll_iname ()
    #11 0x10595120 in qt_mt3_dll_iname ()
    #12 0x1011643f in qt_mt3_dll_iname ()
    #13 0x1004d381 in qt_mt3_dll_iname ()
    #14 0x1004f39d in qt_mt3_dll_iname ()
    #15 0x100093e7 in qt_mt3_dll_iname ()
    #16 0x1000aa89 in qt_mt3_dll_iname ()
    #17 0x77d48709 in _libkernel32_a_iname ()
    #18 0x77d487eb in _libkernel32_a_iname ()
    #19 0x77d489a5 in _libkernel32_a_iname ()
    #20 0x77d489e8 in _libkernel32_a_iname ()
    #21 0x100169a7 in qt_mt3_dll_iname ()
    #22 0x1006d4f1 in qt_mt3_dll_iname ()
    #23 0x1006d446 in qt_mt3_dll_iname ()
    #24 0x0040137e in main ()
    =========

  16. #15
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to corss compile for windows in Linux

    What does myForm::play_file(QString) do?

  17. #16
    Join Date
    May 2006
    Location
    Pune,India
    Posts
    63
    Thanks
    7
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to corss compile for windows in Linux

    Quote Originally Posted by jacek
    What does myForm:lay_file(QString) do?
    Play the file specied as argument in mplayer in slave mode.
    Last edited by safknw; 12th May 2006 at 21:17.

  18. #17
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to corss compile for windows in Linux

    Quote Originally Posted by safknw
    Play the file specied as argument in mplayer in slave mode.
    It calls some function from Qt which leads to a crash. Do you know which one? If not, compile Qt in debug mode and try again (make sure you have "CONFIG += console" to your .pro file and check whether there are any messages on the console).

  19. #18
    Join Date
    May 2006
    Location
    Australia
    Posts
    53
    Thanks
    11
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: how to corss compile for windows in Linux

    if it crashes at a point when you are accessing a file, did you make sure to change these filenames to windows format too? or is it a user input/file dialog kinda situation

Similar Threads

  1. qtgui4.dll error in visual c++ 2005
    By Comptrol in forum Installation and Deployment
    Replies: 33
    Last Post: 19th June 2008, 07:18
  2. Access to PostgreSQL DB on a linux server
    By rmagro in forum Qt Programming
    Replies: 28
    Last Post: 13th March 2008, 09:02
  3. Project won't compile under Windows (works under Linux)
    By philski in forum Qt Programming
    Replies: 7
    Last Post: 14th September 2006, 15:29
  4. Replies: 4
    Last Post: 12th January 2006, 04:16

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.