0

I downloaded source of qt 5.1.1 and successfully built it. Now I'm trying to test it and set the correct paths variables. I got all include files in /usr/local/qt511/include and libs in /usr/.../lib , and when I'm trying to build it with g++ with this cmd:

g++ -Wall -I/usr/local/qt511/include main.cpp -o main 

it throws error. I noticed that in qt511 in include dir there are additional dirs with headers. So my first question Do this option -I/usr/local/qt511/include is sufficient to notify compiler about all headers despite their allocation in child directories?

Moreover I tried to build an example from tutorial. Very simple. F.e analogclock. It has in its body #include < QtGui >. So I tried to compile it with such cmd:

g++ -Wall -I/usr/local/qt511/include/QtGui main.cpp -o main 

and the responce is:

In file included from main.cpp:41:0:
/usr/local/qt511/include/QtGui/QtGui:3:30 fatal error : QtGui/QtGuiDepends : No such file or directory. Compilation Terminated.

I checked the QtGui directory and there is QtGuiDepends.... I have no clue what is going on

thx in advance for any hint

László Papp
  • 51,870
  • 39
  • 111
  • 135
kotu
  • 90
  • 1
  • 8

1 Answers1

0

After some long evenings....

Ok I have found answers in these topics: Bash: Recursively adding subdirectories to the path and How to make g++ search for header files in a specific directory?

What I did to solve my problem is: add to my .bashrc ( I use Ubuntu 12.04) export CPLUS_INCLUDE_PATH=/pathtoincludedir with this nice trick in first link I added. Now I can compile my qt programs simply with g++ -Wall main.cpp -o filename

Hope this will help other beginners like me =) Never stop digging !

Community
  • 1
  • 1
kotu
  • 90
  • 1
  • 8