Results 1 to 8 of 8

Thread: Deploy from ubuntu QT to any PC statically?

  1. #1
    Join Date
    Jan 2010
    Posts
    13
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question Deploy from ubuntu QT to any PC statically?

    Hi, I want to release an app I made with QT in ubuntu to run on any computer, preferably windows, the app doesn't depend on any system-specific libraries though. I can build and run in Qt and release mode gives
    Qt Code:
    1. (<unknown>:5280): GdkPixbuf-CRITICAL **: gdk_pixbuf_get_pixels: assertion `pixbuf != NULL' failed
    2.  
    3. (<unknown>:5280): GdkPixbuf-CRITICAL **: gdk_pixbuf_get_rowstride: assertion `pixbuf != NULL' failed
    4.  
    5. (<unknown>:5280): GdkPixbuf-CRITICAL **: gdk_pixbuf_get_width: assertion `pixbuf != NULL' failed
    6.  
    7. (<unknown>:5280): GdkPixbuf-CRITICAL **: gdk_pixbuf_get_height: assertion `pixbuf != NULL' failed
    To copy to clipboard, switch view to plain text mode 
    theme specific info i suppose.

    Its my understanding that to release so that the executable can run without having qt installed the qt libraries must be either compiled into the app or linked to it. I'm looking for the easiest, fastest solution, its a small app so file size shouldn't matter. Hence static linking is my 1st choice, so I'm following this doc.

    http://www.qtcentre.org/wiki/index.p...x#For_Qt_4.3.x

    This is the ending result of the command "make"

    Qt Code:
    1. <more stuff up here going out of terminal scope>
    2. ../../include/QtGui/private/../../../src/gui/styles/qgtkstyle_p.h:439: error: ‘GtkWidget’ has not been declared
    3. ../../include/QtGui/private/../../../src/gui/styles/qgtkstyle_p.h:439: error: ‘gpointer’ has not been declared
    4. ../../include/QtGui/private/../../../src/gui/styles/qgtkstyle_p.h:440: error: ‘GtkWidget’ has not been declared
    5. ../../include/QtGui/private/../../../src/gui/styles/qgtkstyle_p.h: In static member function ‘static bool QGtkStylePrivate::isThemeAvailable()’:
    6. ../../include/QtGui/private/../../../src/gui/styles/qgtkstyle_p.h:278: error: ‘gtkStyle’ was not declared in this scope
    7. make[1]: *** [.obj/release-static/qguiplatformplugin.o] Error 1
    8. make[1]: Leaving directory `/home/keats/qtsdk-2010.04/qt/src/gui'
    9. make: *** [sub-gui-make_default-ordered] Error 2
    To copy to clipboard, switch view to plain text mode 

    What gives here? I'm not very familiar with make but could the gtk theme used by the system be a problem?

    Just came across this doc http://www.qtcentre.org/wiki/index.p...c_applications

    add CONFIG += static to .pro file

    So if I add that to the project file and build and run in release mode i'll have an executable that can be copied to any machine and run?

    I've been reading and trying stuff for a few days now, even had to reinstall qt so i'll appreciate whatever help is offered.

    PS. contrary to sig the development machine i'm using has Ubuntu with QT creator installed.
    Ubuntu: Eclipse Galileo with CDT and QT integration plug-in.

    Try, try and try again. Abort. Continue. Fail?

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Deploy from ubuntu QT to any PC statically?

    First, you have to build a version for every target. You can't use the same executable on Linux and Windows. You have to compile two if static or not does not matter. (But you can build a windows version on your linux. For that see cross compiling).

    Also note, that QGtkStyle needs GTK+ version 2.10 or later installed on the target system. So this style is probably not a good choice for a multi platform application.

  3. #3
    Join Date
    Jan 2010
    Posts
    13
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Deploy from ubuntu QT to any PC statically?

    I tried adding CONFIG += static to .pro file and running on a XP machine but got "program too big for memory." in a cmd window.
    I have 1.5GB RAM so dunno what up with that. I didn't know about the cross compiling then.

    Also I came across some installer apps, NSIS and one you mentioned in another thread, Install Creator. I assume that before I can even use these programs I need to have a working executable, which is what I want, so these are irrelevant since i'll just be double-clicking the exe.

    I haven't touched anything with QGtkStyle. I have a emerald theme running and changing it removes all errors. I can build and release run with no errors.
    So I guess it was a theme specific thing, which means I don't have to install gtk+ v2.10 or higher, right?

    Something which is puzzling is where does this info[see link] fit into my situation? I'm on ubuntu trying to release for XP. Do I follow linux or windows instructions? From your cross compiling reference I assume its nothing on that page. A note on cross compiling should be added[I know its a work-in-progress].

    http://www.qtcentre.org/wiki/index.p...ynamic_Linking


    With regard to cross compiling, would it be easier or possible to install Qt on XP, move source code to it and compile there giving a exe that be run on any XP machine? From the site I'm reading, it seems that cross compiling is quite iffy. Plus if I need the Qt/Win32 anyway I might as well not bother
    You need Qt/X11 and Qt/Win32, preferably with the same version number.

    http://silmor.de/38
    Ubuntu: Eclipse Galileo with CDT and QT integration plug-in.

    Try, try and try again. Abort. Continue. Fail?

  4. #4
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Deploy from ubuntu QT to any PC statically?

    If you have a legal WinXp, I would suggest to install it in a virtual box and create your binary there instead of cross compiling. If will save you a lot of pain in the ar***.
    Because you only have to transfer the sources and build it normally on windows. Also if you have no strong reasons for building you application static, go for dynamic linking. Also there you can't run in big trouble since you only have to take the libraries which are shipped with the sdk.

    For clarification: You get the errors while you was trying to cross compile a windows application on Linux?

  5. #5
    Join Date
    Jan 2010
    Posts
    13
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Deploy from ubuntu QT to any PC statically?

    If will save you a lot of pain in the ar***. That's exactly what I needed to know! I already have a PC with XP(Hmm I really should update my sig). Heck I'll start downloading Qt/Win32 now.

    Just to confirm I'm gonna follow the steps under Windows in this link, which is basically put all libraries needed in the same directory with executable and voila! its dynamically linked.

    http://www.qtcentre.org/wiki/index.p...ynamic_Linking

    You mean the "program too big for memory" error? Yeah I didn't know about cross compiling then so I compiled in linux and just moved the executable over to my XP.

    I should try it out later today, so I'll post my progress(hopefully my success) then.
    Ubuntu: Eclipse Galileo with CDT and QT integration plug-in.

    Try, try and try again. Abort. Continue. Fail?

  6. #6
    Join Date
    Jan 2010
    Posts
    13
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Deploy from ubuntu QT to any PC statically?

    I installed Qt/Win32 under XP. I compiled the source and was able to run the program from Qt. I have a folder named release with an executable and some files.

    When I click the executable it asks for mingw32.dll, i put it in there then it asks for some other files, dlls. I put them in and when I run the executable it gives "The procedure entry point _Z5qFreePv could not be located in the dynamic link library QtCore4.dll."

    Using dependency walker I found out which dlls i needed, download them and copy into the folder. Yet the QTCORE4.dll and QTGUI4.dll are still red with error: system cannot find the files. I used the ones in Qt/qt/bin, in Qt/bin, even downloaded new ones. No change. Most tiring, i shall try again tomorrow.
    Ubuntu: Eclipse Galileo with CDT and QT integration plug-in.

    Try, try and try again. Abort. Continue. Fail?

  7. #7
    Join Date
    Jan 2010
    Posts
    13
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Deploy from ubuntu QT to any PC statically?

    So after using dependency walker to find what dlls i'm missing in release folder, I copied them and qtcore4.dll and qtgui4.dll into the same folder with executable. Got the error asking for qtcore4.dll and I know if it was debug mode I was to use qtcored4.dll so I just copied both to folder and it worked, dunno why.

    I compiled in release mode and got the folder release with the executable and put in the right qtcore4.dll and qtgui4.dll, the ones in Qt/qt/bin not Qt/bin, but got that error, strange. Anyway problem solved so far I just need to test it on a XP without Qt installed. Will post back when I test it later today.
    Ubuntu: Eclipse Galileo with CDT and QT integration plug-in.

    Try, try and try again. Abort. Continue. Fail?

  8. #8
    Join Date
    Jan 2010
    Posts
    13
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Deploy from ubuntu QT to any PC statically?

    It works perfectly on a XP machine without Qt. Thank you for the assist.
    Ubuntu: Eclipse Galileo with CDT and QT integration plug-in.

    Try, try and try again. Abort. Continue. Fail?

Similar Threads

  1. How to deploy?
    By aash_89 in forum Installation and Deployment
    Replies: 22
    Last Post: 23rd August 2010, 19:17
  2. How to link the DLL statically
    By Sergei Smirnov in forum Newbie
    Replies: 0
    Last Post: 21st June 2010, 17:53
  3. Qt statically with Qwt
    By edney in forum Qwt
    Replies: 1
    Last Post: 4th June 2010, 22:39
  4. building qt statically
    By eleanor in forum Installation and Deployment
    Replies: 7
    Last Post: 9th May 2009, 09:03
  5. Compile Qt for Mac statically
    By eric in forum Installation and Deployment
    Replies: 4
    Last Post: 19th August 2008, 15:45

Tags for this Thread

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.