Why do I have to remove -lGL from my Makefile? (in vanilla Ubuntu 12.10 64)
-
Hi,
after almost 20 years of Visual Studio, to avoid mental illness I'm switching to Qt.
The other day I downloaded and installed Qt5.0 on my MBP Retina with ML 10.8.2 and it worked like a charm, I could compile a test app within minutes. It probably helped a lot that I had XCode installed :-)So tonight I repartioned my MBP and installed 64 bits Ubuntu 12.10 on it as well. It works fine if you have good eyesight (screen resolution is hardwired to 2880x1800 :-). Then I proceeded to download and install 64 bits Qt5.0 for Linux. Tried first to compile a console app, i.e. hello world. Failed, but some googling revealed that my Ubuntu 12.10 needed g++.
Suggestion #1: mention somewhere that you need to do 'sudo apt-get install g++' on a vanilla Ubuntu
With a working gcc, I tried to build a vanilla GUI app, i.e. wizard-generated with no modifications. Failed with error message "cannot find -lGL". More coffee, much more, and then I got it to build by manually editing the Makefile, namely the LIBS definition line, and remove the -lGL so that the end of the line looks like this: "..-lQt5Core -lpthread". And now I can copy in the Qt project from Mountain Lion to my Ubuntu partition and recompile it with gcc instead of clang. Sweet!
Suggestion #2: make an update to Q5.0 for 64-bits Linux so that I don't have to manually edit my Makefiles.
Rgrds Henry
-
You need to install the dependencies mentioned "here":http://qt-project.org/wiki/Building_Qt_5_from_Git. This should solve the -lGL issue, too.
Maybe it should be mentioned, as you suggest, but actually user is trusted to get a compiler on all platforms by themselves (you have mentioned installing Xcode yourself. Same goes for MSVC/MinGW on Windows).
-
Thanks for a quick reply, yes I see what you mean, I got lucky with OSX and just rushed ahead with Qt for Ubuntu, without bothering to check for any prerequisites, like g++.
Maybe, for newbies like me, if the installation app would be able to verify that the necessary packages are present, that could save some time. I know that you can use the apt-get stuff for that, but not exactly how...
Now for some sleep before trying the final piece of the puzzle, installation of Qt on Windows XP. Should be interesting :-)
-
Yeah, I often could not remember exact dependencies needed myself. It should be communicated more clearly on the Download page.
SDK will check dependencies once it gets more mature, I think. That used to be the case with the old Nokia SDK.
As for Windows, you will need MSVC2010, ICU, DirectX drivers. If you want to compile Qt5 yourself, the list is longer :)
-
VS2010, got it, I've already prepared a VMWare image with XP Sp3. I'm using VMware Fusion 5 on my Mountain Lion, and it has a much more solid feel to it than VirtualBox. And I haven't planned on any compilations of Qt on Windows anyway, the fun stuff I'll be doing on OSX. (Like a Wordstar editor plugin, because I saw that the Qt Creator editor lacks commands for going to the top or bottom of the source file, and scrolling one line up or down.)
Rgrds Henry
-
[quote author="hskoglund" date="1357719114"]VS2010, got it, I've already prepared a VMWare image with XP Sp3. I'm using VMware Fusion 5 on my Mountain Lion, and it has a much more solid feel to it than VirtualBox. And I haven't planned on any compilations of Qt on Windows anyway, the fun stuff I'll be doing on OSX. (Like a Wordstar editor plugin, because I saw that the Qt Creator editor lacks commands for going to the top or bottom of the source file, and scrolling one line up or down.)
Rgrds Henry
[/quote]If I remember correctly: scrolling one line up without moving the cursor is Ctrl + UP/Down, and to go to the Top/Bottom is Ctrl + PageUp/PageDown.
If you want to move a line of code, one line up or down Ctrl + Alt + Up/Down(Or may be that was to copy it).As for the original post:
[quote author="hskoglund" date="1357703124"]Hi,after almost 20 years of Visual Studio, to avoid mental illness I'm switching to Qt.
The other day I downloaded and installed Qt5.0 on my MBP Retina with ML 10.8.2 and it worked like a charm, I could compile a test app within minutes. It probably helped a lot that I had XCode installed :-)So tonight I repartioned my MBP and installed 64 bits Ubuntu 12.10 on it as well. It works fine if you have good eyesight (screen resolution is hardwired to 2880x1800 :-). Then I proceeded to download and install 64 bits Qt5.0 for Linux. Tried first to compile a console app, i.e. hello world. Failed, but some googling revealed that my Ubuntu 12.10 needed g++.
Suggestion #1: mention somewhere that you need to do 'sudo apt-get install g++' on a vanilla Ubuntu
With a working gcc, I tried to build a vanilla GUI app, i.e. wizard-generated with no modifications. Failed with error message "cannot find -lGL". More coffee, much more, and then I got it to build by manually editing the Makefile, namely the LIBS definition line, and remove the -lGL so that the end of the line looks like this: "..-lQt5Core -lpthread". And now I can copy in the Qt project from Mountain Lion to my Ubuntu partition and recompile it with gcc instead of clang. Sweet!
Suggestion #2: make an update to Q5.0 for 64-bits Linux so that I don't have to manually edit my Makefiles.
Rgrds Henry
[/quote]
g++ - the compiler
libglu1-mesa-dev - for the -lGL problem(you don't have the libraries installed).
To solve both of your problems you have to write this command in your terminal: @sudo apt-get install g++ libglu1-mesa-dev -y@ -
Thanks,
@sudo apt-get install g++ libglu1-mesa-dev -y@
did the trick, now Qt compiles and runs new projects just fine in my Ubuntu.
Also thank you for the tips re. scrolling in Creator, however I have no PageUp and PageDown keys on my MBP :-( That's the advantage of using Emacs or Wordstar key emulation, because these were invented long time before PageUp or PageDown keys existed, i.e. esc, control-key and A-z keys suffice.
What I meant was that inside Creator's Preferences, Environment, Keyboard dialog. there are no settings (that can be changed) for GotoBeginningOfFile, GotoEndOfFile etc. On the other hand, there are many things to like about that Keyboard settings dialog. For one, it can be resized both horizontally and vertically! No version of Visual Studio has ever supported resizing of their equivalent dialog box (trust me, I tried 'em all). Xcode supports resizing, but only vertically, not horizontally, of their equivalent dialog box for keyboard settings.
Furthermore, you cannot get the 2 character sequences for Wordstar key emulation (like ctrl-Q, ctrl-S to go to the beginning of a line) to work in Xcode (yep, I've filed a radar). But Creator swallowed all my new 2 character key sequences without complaining :-)Rgrds Henry