LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-26-2007, 07:01 PM   #1
Master Fox
Member
 
Registered: Aug 2004
Location: UK
Distribution: Arch (Duke / Desktop), FreeBSD 6.1 (Home-Dev server)
Posts: 131

Rep: Reputation: 15
Setting headers and libraries paths?


Sorry if this is in the wrong forum

I recently switched distro to Arch (I like it). But when I try to compile programs which need QT I always occur with the error, checking for Qt... configure: error: Qt (>= Qt 3.2) (headers and libraries) not found.
QT is installed and I can easy do ./configure --with-qt-dir= parameter

but how would I fix it so I don't have to do it each time on each differnt file?
The current path that I know works and ./configure doesn't fail on me is: --with-qt-dir=/opt/qt

Also one more offtopic question, how do I remove the highlight copy and paste? its really annoying me
 
Old 07-26-2007, 07:40 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
If you look at the output of (pretty much any) ./configure --help you'll
see something like this towards the end:
Code:
Some influential environment variables:
  CC          C compiler command
  CFLAGS      C compiler flags
  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
              nonstandard directory <lib dir>
  CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
              headers in a nonstandard directory <include dir>
  CXX         C++ compiler command
  CXXFLAGS    C++ compiler flags
  CPP         C preprocessor
  CXXCPP      C++ preprocessor
  F77         Fortran 77 compiler command
  FFLAGS      Fortran 77 compiler flags
So ... if you put something like
Code:
export CPPFLAGS=-I/opt/qt/include
export LDFLAGS=-L/opt/qt/lib
in your ~/.bashrc (or equivalent initialisation script)
I'd assume you should be sweet?



Cheers,
Tink
 
Old 07-27-2007, 07:48 AM   #3
Master Fox
Member
 
Registered: Aug 2004
Location: UK
Distribution: Arch (Duke / Desktop), FreeBSD 6.1 (Home-Dev server)
Posts: 131

Original Poster
Rep: Reputation: 15
Still coming up with the same error, i've added it to my .bashrc, logged out and logged back in again and it still accurs

Below is the config.log error
Code:
configure:28110: checking for Qt
configure: 28175: /opt/qt4/include/qstyle.h
configure: 28175: /opt/qt4/qstyle.h
configure: 28175: /usr/lib/qt3/include/qstyle.h
configure: 28175: /usr/lib/qt3/qstyle.h
configure: 28175: /usr/lib/qt/include/qstyle.h
configure: 28175: /usr/lib/qt/qstyle.h
configure: 28175: /usr/share/qt3/include/qstyle.h
configure: 28175: /usr/share/qt3/qstyle.h
configure: 28175: /usr/local/qt/include/qstyle.h
configure: 28175: /usr/include/qt/qstyle.h
configure: 28175: /usr/include/qstyle.h
configure: 28175: /usr/X11R6/include/X11/qt/qstyle.h
configure: 28175: /usr/X11R6/include/qt/qstyle.h
configure: 28175: /usr/X11R6/include/qt2/qstyle.h
configure: 28175: /usr/include/qt3/qstyle.h
configure: 28175: ./qstyle.h
tried NO
tried /opt/qt4/lib
tried /opt/qt4
tried /usr/lib/qt3/lib
tried /usr/lib/qt3
tried /usr/lib/qt/lib
tried /usr/lib/qt
tried /usr/share/qt3/lib
tried /usr/share/qt3
tried /usr/X11R6/lib
tried /usr/lib
tried /usr/local/qt/lib
tried /usr/lib
configure:28293: rm -rf SunWS_cache; g++ -o conftest -Wnon-virtual-dtor -Wno-long-long -Wundef -Wall -W -Wpointer-arith -Wwrite-strings -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -W$
/usr/bin/ld: cannot find -lqt-mt
collect2: ld returned 1 exit status
configure:28296: $? = 1
configure: failed program was:
#include "confdefs.h"
#include <qglobal.h>
#include <qapplication.h>
#include <qcursor.h>
#include <qstylefactory.h>
#include <private/qucomextra_p.h>
#if ! (QT_VERSION >= 0x030200)
#error 1
#endif

int main() {
    (void)QStyleFactory::create(QString::null);
    QCursor c(Qt::WhatsThisCursor);
    return 0;
}
configure:28336: error: Qt (>= Qt 3.2) (headers and libraries) not found. Please check your installation!
For more details about this problem, look at the end of config.log.
I've tried copying and linking the path/directoy to /usr/lib but then gives me another error about qt-mt not being found. I have both QT3.2 and QT4 installed but not being detected

Last edited by Master Fox; 07-27-2007 at 07:49 AM.
 
Old 07-27-2007, 02:43 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Out of curiosity: do those environment variables show up
in the shell you're running configure from?

env|grep FLAGS


Cheers,
Tink
 
Old 07-27-2007, 07:25 PM   #5
Master Fox
Member
 
Registered: Aug 2004
Location: UK
Distribution: Arch (Duke / Desktop), FreeBSD 6.1 (Home-Dev server)
Posts: 131

Original Poster
Rep: Reputation: 15
They do,

[paw-fox ~]$ env|grep FLAGS
LDFLAGS=-L/opt/qt/lib
CPPFLAGS=-I/opt/qt/include
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Qt headers and libraries not found c-- Ubuntu 12 03-03-2009 07:16 PM
Fluxbox install, X libraries and headers csb Linux - Software 3 07-15-2005 08:59 AM
QT Libraries & Headers inescapeableus Linux - Software 9 05-03-2005 01:14 AM
KDevelop cannot find QT headers and libraries?! mscollins1 Programming 1 04-10-2004 04:12 PM
QT-1.3 (headers and libraries) not found. p_reah Linux - Software 2 04-17-2003 07:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:52 AM.

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