LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-20-2010, 12:53 PM   #1
Mike Davies
Member
 
Registered: Jul 2004
Distribution: Custom Linux, Buildroot, Busybox, Fedora, Raspberry Pi
Posts: 144

Rep: Reputation: 15
Question QT Creator and include paths


I'm running QT Creator 2.0.1 and I'm having compiling problems.
I have a .cpp file with the line...

#include <QTcpSocket>

If I compile the .cpp it fails with ...

error: QTcpSocket: No such file or directory

BUT if I hover the mouse cursor over that #include line it comes up with the full path for the file, i.e. /usr/local/Trolltech/Qt-4.7.1/include/QtNetwork/QTcpSocket, and the file does exist with that full name.

So my question is why does it say the file does not exist when it builds whereas in editor mode it knows the file exists, and probably more importantly to me what can I do to fix it ?
 
Old 12-20-2010, 01:45 PM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
#include <QTcpSocket> :

Better instead try #include <QtNetwork/QTcpSocket>

(You have /usr/include/ in the search path, not /usr/include/QtNetwork/).

Fedora ?
Please have a look at your installed 'qt-devel' :
rpm -ql qt-devel > qt-filelist.txt
The text file is saved in /home/<name>/.
Most handy that way : qt-filelist.txt = 3488 lines ( Fedora 13.)


With your custom install :
/usr/local/Trolltech/Qt-4.7.1/include/((QtNetwork))
.. then /usr/local/Trolltech/Qt-4.7.1/include/ is in the search path ? ?
If so : #include <QtNetwork/QTcpSocket> : will do.
..

Last edited by knudfl; 12-20-2010 at 01:51 PM.
 
1 members found this post helpful.
Old 12-20-2010, 05:06 PM   #3
Mike Davies
Member
 
Registered: Jul 2004
Distribution: Custom Linux, Buildroot, Busybox, Fedora, Raspberry Pi
Posts: 144

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by knudfl View Post
#include <QTcpSocket> :

Better instead try #include <QtNetwork/QTcpSocket>

(You have /usr/include/ in the search path, not /usr/include/QtNetwork/).
..
Tried that it still doesn't find the file when I compile.

How do I set the search path ? Is it an environment variable or is it something else ?
 
Old 12-21-2010, 07:52 AM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
You can try with a new line added to /etc/ld.so.conf :

/usr/local/Trolltech/Qt-4.7.1/lib

..
 
Old 12-21-2010, 12:04 PM   #5
Mike Davies
Member
 
Registered: Jul 2004
Distribution: Custom Linux, Buildroot, Busybox, Fedora, Raspberry Pi
Posts: 144

Original Poster
Rep: Reputation: 15
Thanks. that works a treat.

Happy Xmas
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Qt Creator in 64Current - Paths Gavin Harper Slackware 1 11-16-2010 11:46 AM
Embedded Linux include library paths problem kermitG Programming 1 07-24-2008 11:35 AM
PHP include file directory/paths DMeerholz Linux - Software 1 07-02-2007 10:21 AM
Getting extra lib / include paths with automake MadCactus Linux - Software 0 08-21-2004 01:04 PM
include and lib paths Mux Slackware 1 05-05-2002 09:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:03 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration