Skip to main content

Qt 4.5 on FreeBSD

Posted in

As soon as I found out that Qt 4.5.0 was released I wanted it installed on my FreeBSD.

After several "battles" I found out the way to install it, so when Qt 4.5.1 came out I installed it immediately without any problem.

Let's say we are installing Qt 4.5.0 (This is where I started). We got the archive (either tar.gz, or tar.bz2). I prefer .tar.bz2.

Before we go any further I suggest to set an environment variable QMAKESPEC.
I use tcsh, therefore I add the following my .tcshrc:

setenv QMAKESPEC freebsd-g++34

QMAKESPEC freebsd-g++ didn't work for me, that's why I tried freebsd-g++34. The reason why is it so, is unknown to me. My apologies for not investigating this issue.

Now make sure this variable is set for our session. You might want to re-login or run setenv manually. The reason I added it to, my .tcshrc is that we will need it later, after installing Qt.

Get ready for the configuration

$ tar qt-x11-opensource-src-4.5.0.tar.bz2
$ cd qt-x11-opensource-src-4.5.0
$ ./configure -no-iconv  --prefix=/usr/local/qt-4.5.0 -nomake demos -nomake examples

Note:
1) I think this is a good practice specifying prefix for installation
2) Having iconv enabled I had problems with fonts in Qt applications. I could see a square per every character. I have "MyProg" in my window title, but I see 6 squares. =( That's why -no-iconv flag was used.
3) Skipping demos and examples saves some time.

$ make
...Take a long coffee break while Qt is being compiled...
$ sudo make install

If someone doesn't have 'sudo' installed just do a regular 'su'.

Now we have Qt installed. The next step:

Add these environment variables to your .cshrc, or .tcshrc, or, .kshrc, or what you have. I'm adding this to my .tcshrc.

setenv QTDIR /usr/local/qt-4.5.0
setenv PATH QTDIR/bin:$PATH
setenv LD_LIBRARY_PATH QTDIR/lib:$LD_LIBRARY_PATH

Have fun!

Post new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
xylop__ne: