ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I'm trying a simple QT tutorial. When I try and compile my helloworld app, it has trouble including the .h files (see below). Where and how do I include the directory containing these (I think it's /opt/kde3/qt/include)...
dave@davee:~/qt> qmake -project
dave@davee:~/qt> qmake
dave@davee:~/qt> make
g++ -c -pipe -O2 -march=i586 -mcpu=i686 -fmessage-length=0 -fPIC -DNO_DEBUG -Wall -W -O2 -march=i586 -mcpu=i686 -fmessage-length=0 -fPIC -DNO_DEBUG -DQT_NO_DEBUG -I/usr/lib/qt3//mkspecs/default -I. -I. -I/usr/include -I/include -o main.o main.cpp
main.cpp:1:26: qapplication.h: No such file or directory
I don't know much about qmake & QT, but I know that make uses a file called Makefile. Try to find the -I. -I/usr/include etc. arguments in Makefile, and add "-I/opt/kde3/qt/include". That should work, but I'm not sure if Makefile is auto-generated by qmake. If that is the case, then you should check qmake's input files / configuration to make sure that it also writes this argument in newly-written Makefiles
You seem to be under the impression that libraries and .h files are the same thing. Your title mentions library directories, then you ask about the directory containing .h files in the text.
A library and a .h file are NOT the same. A library contains object code that has the actual implementation of things. A .h file simply DECLARES the implementation of those things, it doesn't implement them.
So... even if you get your INCLUDE paths working, the next thing you will probably run into is linker errors because you don't have the LIBRARY paths setup. To tell the linker about a LIBRARY, you use -llibraryname and possibly -L/path/to/library if it is not in your search paths.
Sorry, if you are already aware of the distinction, but it was always a bit of a pet peeve of mine when people in my C++ classes in college would say they included a library, when what they really did was to include a header file... I think the confusion might have come from the fact that the standard C/C++ libraries are usually included by default so they never had to deal with actual libraries before.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.