Hi everyone,
Total newbie to Qt here ;) Also, actually, to software development in general. I am a young mathematician who has just completed writing his first "scientific" program using Qt. I hope you'll forgive me if my questions sound silly (and I am aware that this has been asked several times, and that there's documentation on this).
I've designed this program using Qt Creator 2.5.0 (based on Qt 4.8.1 64 bits) on my PC under Linux (Ubuntu 12.04 64 bits). It works very well, but trying to figure out how to deploy the app for the past couple days has been a rude awakening. I didn't expect I'd be so lost and nowhere at this point.
So, my project is not very sophisticated, it consists of approximantely 40 headers and 40 sources, a qrc containing a few png and html files, and I'm using a bunch of Qt classes which I guess are the most classical ones. Now I'd like to make this available in the simplest possible way for Linux, Mac and Windows users (mostly fellow mathematicians I guess, but those can ignore the first thing about computers). I'm tempted to give it up and ask people to install qt and compile my files, but I hope i change my mind.
So, this is where I'm at now, please correct me if needed:
-For Linux users, I should probably compile my program using static linking (?)
Problem1: see afer.
Q1: I guess I want to compile two versions, 32 and 64 bits? How well are they going to work on different distributions?
Q2: Sould I make a deb file or something?
-For Windows users,
Problem2: I've tried to cross-compile the app for windows from my PC using wine and mingw32, following every tuto I could find on the web, but I never got it to work; there always seemed to be an error with the qmake.conf file or something. I've come to the conclusion that even though I don't have a PC with Windows on it, I should just find one (I guess I would need one anyway to test the app) and compile my source there.
Q3: Suppose I manage to do that. Will my exe file work on all Windows computers?
Q4: Should I try to create an installer (is it going to drive me crazy as well)?
-For Mac users,
Q5: I guess it's gonna be pretty much the same as for Linux case? (the advantage is, I do have a Mac at home).
Okay, now here's my specific problem when I tried to build my project statically. First here's what I did:
1. I downloaded the Qt4.8.3 sources and built them statically (strangely, the compiler(s) don't seem to care that I told them -prefix <some folder> (in the ./configure code line), it just compiled everything in the sources folder apparently (I can tell you what I did in more details if necessary).
2. I changed the options in Qt creator to compile using the static version of Qt. I get a warning telling me "qmlviewer not installed" (don't know if that matters).
3. Because I pretty much mixed different tutos read here and there, I tried to add "CONFIG+=STATIC" in the pro file, or adding some LIBS there, or... but that didn't seem to affect the result at all.
What I get is a file that seemed to work at first: It was 15Mb instead of 1Mb previously, it no longer required the two Qt dependencies that it used to (checked that with ldd command line), and the program worked... apparently. First i notices in Qt Creator's Application output that I kept getting Qt errors: "Gtk-CRITICAL **: IA__gtk_widget_style_get: assertion `GTK_IS_WIDGET (widget)' failed". Mmm... doesn't sound too good. Even worse, everything seems to work except my help menu that doesn't manage to show itself and makes the program pretty much freeze. And the output shows:
X Error: BadDrawable (invalid Pixmap or Window parameter) 9
Major opcode: 62 (X_CopyArea)
Resource id: 0x0 and sometimes QNativeImage: Unable to attach to shared memory segment. If you need to know, the help menu is a simple widget containing a QTextBrowser (and a couple buttons) that shows an html file with some png images.
I'd really appreciate some help here, feeling a bit alone in the dark! Thanks in advance,
Seub
PS: I wouldn't mind giving you my sources if you want to try something, but the zip file is 750kb and the max here seems to be 244kb
Bookmarks