# Compiling qt4.5 in fbsd 7.2



## wirasto (May 31, 2009)

I try compile qt-x11-opensource-src-4.5.1 on freebsd 7.2, but get an error message


```
$ ./configure -no-iconv  --prefix=/opt/qt4.5.1
```


```
$ gmake
```


```
.....
......
moc/release-shared -I/usr/home/wirasto/qt-x11-opensource-src-4.5.1/src/3rdparty/webkit/WebCore/.uic/release-shared -I/usr/local/include -o 
.obj/release-shared/sqlite3.o ../../sqlite/sqlite3.c
<command-line>:0: fatal error: had to relocate PCH
compilation terminated.
gmake[1]: *** [.obj/release-shared/sqlite3.o] Error 1
gmake[1]: Leaving directory `/usr/home/wirasto/qt-x11-opensource-src-4.5.1/src/3rdparty/webkit/WebCore'
gmake: *** [sub-webkit-make_default-ordered] Error 2
```


----------



## hydra (May 31, 2009)

Instead of manual compilation, use the ports:
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ports.html


----------



## wirasto (May 31, 2009)

I need Qtcreator. Qtcreator need qt4.5.x. And in ports just available qt4.4.3.


----------



## lyuts (May 31, 2009)

I'm not sure but I think you are using gcc4 for compiling Qt 4.5.
If this is true, then i suggest you use gcc34. I had similar issues, but changing the compiler solved this problem and now I've got Qt 4.5.1 (and QtCreator also =) ). Good luck.


----------



## wirasto (May 31, 2009)

It is correct, I use gcc 4.



> gcc (GCC) 4.2.1 20070719  [FreeBSD]
> Copyright (C) 2007 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.



Before compiling I set QMAKESPEC=freebsd-g+ +

You may be able to give the steps in short 

How to use gcc34?


----------



## wirasto (May 31, 2009)

ow, have ini the archive 

http://forums.freebsd.org/archive/index.php/t-1057.html

I will try


----------



## lyuts (May 31, 2009)

Just make sure that gcc34 is installed and use freebsd-g++34 as your QMAKESPEC.


----------



## wirasto (May 31, 2009)

Oh, i'm still get error 



> sqlite3.o ../../sqlite/sqlite3.c
> <command-line>:0: fatal error: had to relocate PCH
> compilation terminated.
> gmake[1]: *** [.obj/release-shared/sqlite3.o] Error 1
> ...





```
> env | grep -i spec
```
QMAKESPECT=freebsd-g++34

what's wrong ?


----------



## Brandybuck (Jun 1, 2009)

My reply got deleted. Don't know why. Anyway... you need to disable PCH:


```
./configure -no-iconv [B]-no-pch[/B]
```


----------



## wirasto (Jun 1, 2009)

Qt4.5.1 done

```
> export QMAKESPEC=freebsd-g++34
```

Not QMAKESPECT, But QMAKESPEC


But, Qt-creator still error 

http://pastebin.com/m35a9cdd9


----------



## lyuts (Jun 1, 2009)

1. As for Qt installation
   Did you try to continue compilation? Or did you untar/unzip the sources again? I suggest you do a new clean compilation. This way you should not have PCH issues.

2. As for Qt Creator
   That's right. Qt Creator won't compile out of box. I have patched it, before i got it working for me.


----------



## wirasto (Jun 1, 2009)

You have the patch? What you released for the public? Where can I get it ...


----------



## lyuts (Jun 1, 2009)

I didn't release it. I'm trying to get a port for it done, but it has a dependency (as you know) - Qt 4.5 port.
I can share those patches. How would you like to get them?


----------



## wirasto (Jun 1, 2009)

You can post to your http or ftp maybe. Or you can send to my email as attachment


----------



## lyuts (Jun 1, 2009)

Ok, I'll send you these patches as soon as i get home.( I'm at work right now.)

Have a nice day.


----------



## wirasto (Jun 1, 2009)

why you don't write this in your blog. I think this is really interesting


----------



## lyuts (Jun 1, 2009)

Don't know... You are right. I think I should do this.


----------



## lyuts (Jun 1, 2009)

I have posted those patches.

http://lyuts.blogspot.com/2009/06/qt-creator-on-freebsd.html

If you need any help, just let me know.


----------



## wirasto (Jun 1, 2009)

Still get error message 

http://pastebin.com/maed731e


----------



## wirasto (Jun 1, 2009)

This is my steps


```
$ cd /home/wirasto/qt-creator-1.0.0-src/src/libs/extensionsystem
$ patch < /home/wirasto/qt_creator_patches/patch-src-libs-extensionsystem-extensionsystem.pro


$ cd /home/wirasto/qt-creator-1.0.0-src/src/libs/utils
$ patch < /home/wirasto/qt_creator_patches/patch-src-libs-utils-process_stub_unix.c


$ cd /home/wirasto/qt-creator-1.0.0-src/src/plugins/debugger
$ patch < /home/wirasto/qt_creator_patches/patch-src-plugins-debugger-gdbengine.cpp 

$ cd /home/wirasto/qt-creator-1.0.0-src

$ /opt/qt4.5.1/bin/qmake -unix -o Makefile qtcreator.pro


$ make
```

And, i still get error message


----------



## wirasto (Jun 1, 2009)

Ok, i try qt-creator-1.1.0-src and success.

But 

when i try run my project i get error compile output


```
Running build steps for project abc...
Starting: /usr/bin/make clean -w 
make: illegal option -- w
usage: make [-BPSXeiknpqrstv] [-C directory] [-D variable]
[-d flags] [-E variable] [-f makefile] [-I directory]
[-j max_jobs] [-m directory] [-V variable]
[variable=value] [target ...]
Exited with code 2.
Error while building project abc
When executing build step 'Make'
```


----------



## lyuts (Jun 1, 2009)

Oh, yeah, you need to go into project settings and override make command with 'make'. I know it looks strange, but it works. Somehow Qt Creator doesn't find make.


----------



## wirasto (Jun 1, 2009)

project settings ? In qt-creator ? Where..?


----------



## lyuts (Jun 1, 2009)

Yes, in Qt Creator... Ctrl+4 => Build steps => Make => Override make:


----------



## wirasto (Jun 1, 2009)

Great....
Qt-creator run well now 

lyuts, Thank's

hydra and Brandybuck, Thank's


----------



## lyuts (Jun 3, 2009)

If someone is interested, here are new patches for upcoming Qt Creator 1.2

http://lyuts.blogspot.com/2009/06/qt-creator-12-on-freebsd.html


----------



## favor (Oct 17, 2009)

Hi, wirasto

  do you qtcreator works well? my qtcreator crashed when I clicked the help icon/menu on the left bar of qtcreator.
  the error message just printed output:


```
QKqueueFileSystemWatcherEngine: error during kevent wait: Interrupted system call
```

and my envirnoment are :
 Qt Creator 1.2.93 based on Qt 4.6.0
 FreeBSD-7.2 release

any help is appreciated!

 thanks


----------



## wirasto (Oct 18, 2009)

Your environment is newer. I just tried Qt 4.5.1-4.5.2 And Qt-creator 1.1.0-1.2.1. And the both is works well.

Are you use lyuts patch for Qtcreator ?

*Sorry, about my english


----------



## lyuts (Oct 18, 2009)

Yes, I used patches for Qt Creator 1.1.0 - 1.2.1.
As for Qt Creator 1.3, it doesn't need patching anymore.


----------

