LinuxQuestions.org
Visit Jeremy's Blog.
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-15-2009, 11:35 PM   #1
Doug Hutcheson
Member
 
Registered: Jun 2009
Location: Philippines
Distribution: Fedora 36; Homebrew desktop with Ryzen 5600G and 32Gb. Using Red Hat since 1998
Posts: 304

Rep: Reputation: 22
Error when compiling app against Qt4


I run FC11 on an x86_64 Thinkpad T61.
Currently trying to build unixODBC.
I have Qt3.3 and Qt4 installed.
Code:
configure
identifies the Qt version as 040503.
I have to run configure as "./configure --with-qt-libraries=/usr/lib64", or the Qt libraries are not found.

My problem is during make. The following error occurs:
Code:
mCAbout.cpp:15:34: error: private/qucomextra_p.h: No such file or directory                            
mCAbout.cpp:17:2: error: #error "This file was generated using the moc from 3.3.8b. It"                
mCAbout.cpp:18:2: error: #error "cannot be used with the include files
from this version of Qt."       
mCAbout.cpp:19:2: error: #error "(The moc has changed too much.)"
Code:
locate
finds
Code:
/usr/lib64/qt-3.3/include/private/qucomextra_p.h
Evidently, I do not have a qucomextra_p.h for Qt4. Am I supposed to have one, or do I have to run something to generate it, or what? mCAbout.cpp starts off as follows:
Code:
/****************************************************************************
** CAbout meta object code from reading C++ file 'CAbout.h'
**
** Created: Wed Dec 16 14:46:48 2009
**      by: The Qt MOC ($Id: qt/moc_yacc.cpp   3.3.8   edited Feb 2 14:59 $)
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/

#undef QT_NO_COMPAT
#include "CAbout.h"
#include <qmetaobject.h>
#include <qapplication.h>

#include <private/qucomextra_p.h>
#if !defined(Q_MOC_OUTPUT_REVISION) || (Q_MOC_OUTPUT_REVISION != 26)
#error "This file was generated using the moc from 3.3.8b. It"
#error "cannot be used with the include files from this version of Qt."
#error "(The moc has changed too much.)"

What am I missing here, folks?
 
Old 12-16-2009, 03:33 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,304

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
If you have qt3 and qt4 in /usr/lib64, it's pot l;uck which is found first.

--with-qt-libraries=/usr/lib64/qt4
 
Old 12-16-2009, 04:24 AM   #3
Doug Hutcheson
Member
 
Registered: Jun 2009
Location: Philippines
Distribution: Fedora 36; Homebrew desktop with Ryzen 5600G and 32Gb. Using Red Hat since 1998
Posts: 304

Original Poster
Rep: Reputation: 22
Thanks for the idea, but no dice. I still get the same error.

However, it seems reasonable that the Qt MOC - whatever that is - which is being used to generate mCAbout.cpp must be the Qt3.3 version, not the Qt4 one. What is the Qt MOC and how do I find it/specify which one to use? I tried "locate moc_yacc" with no results.

Alternatively, do I need to specify additional Qt directories (for include files etc) when I run configure? I notice that /usr/lib64/qt-3.3 contains an "include" subdirectory, but /usr/lib64/qt4 does not. The configure script finds Qt4 include files in /usr/include.

If configure is picking up bits of Qt3.3 and bits of Qt4, how do I clean this up? Or do I just abandon trying to build this GUI - sigh.
 
Old 12-16-2009, 05:40 AM   #4
Elv13
Member
 
Registered: Apr 2006
Location: Montreal,Quebec
Distribution: Gentoo
Posts: 825

Rep: Reputation: 129Reputation: 129
Code:
export QTDIR=/usr/lib64/qt4
MOC is a code genarator used to generate the CPP code that will actually be compilled.
 
Old 12-16-2009, 07:30 PM   #5
Doug Hutcheson
Member
 
Registered: Jun 2009
Location: Philippines
Distribution: Fedora 36; Homebrew desktop with Ryzen 5600G and 32Gb. Using Red Hat since 1998
Posts: 304

Original Poster
Rep: Reputation: 22
Thanks Elv13, but still get the compiler error.

However, you caused me to check my environment variables:
Code:
[doug@cardraeh unixODBC-2.2.14]$ env | grep QT
QTDIR=/usr/lib64/qt4
QTINC=/usr/lib64/qt-3.3/include
QT_IM_MODULE=xim
QTLIB=/usr/lib64/qt-3.3/lib
I can correct QTLIB to /usr/lib64/qt4, but I don't know what to put for QTINC, because /usr/lib64/qt4/include does not exist.
Code:
[doug@cardraeh unixODBC-2.2.14]$ ls /usr/lib64/qt-3.3
bin  include  lib  mkspecs  phrasebooks  plugins  templates  translations
[doug@cardraeh unixODBC-2.2.14]$ ls /usr/lib64/qt4
bin  mkspecs  phrasebooks  plugins  q3porting.xml  qsci
Any ideas?
 
1 members found this post helpful.
Old 12-16-2009, 10:26 PM   #6
Elv13
Member
 
Registered: Apr 2006
Location: Montreal,Quebec
Distribution: Gentoo
Posts: 825

Rep: Reputation: 129Reputation: 129
/usr/include/qt4 for the include (if its where your distribution store, it, check in your package manager)


as for libs, it is /usr/lib64/qt4

I am not sure about Qt dir, I have a separated one compiled from Git (I am a KDE-apps dev), so mine host all the bins/libs/includes/doc file. It work just fine, you could do the same, its quite easy in fact, just follow those instructions:
http://techbase.kde.org/Getting_Started/Build/KDE4

After setting your kde-devel account and .bashrc, you will have a sandbox where Qt/KDE apps will compile fine and be separated from files managed by your system. It create a much cleaner system when you have separated development environment. You will have to do the optional compiling of qt-copy in order to have better results than you currently have.

You can then "include" the sandbox packages in your regular coount by adding an entry in your PATH variable.
 
1 members found this post helpful.
Old 12-16-2009, 11:59 PM   #7
Doug Hutcheson
Member
 
Registered: Jun 2009
Location: Philippines
Distribution: Fedora 36; Homebrew desktop with Ryzen 5600G and 32Gb. Using Red Hat since 1998
Posts: 304

Original Poster
Rep: Reputation: 22
I am not an apps developer, just a PBU (poor bloody user) running Gnome, so would prefer to get the 'standard' file layout working if possible.

I found my $PATH first element was pointing to /usr/lib64/qt-3.3/bin, so I changed this to point to qt4 instead.

Current status:
PATH=/usr/lib64/qt4/bin...
QTDIR=/usr/lib64/qt4
QTINC=/usr/include/Qt
QTLIB=/usr/lib64/qt4

App being configured with:
./configure --with-qt-libraries=/usr/lib64/qt4

With this I have successfully built my app.

Thank you for your help - I would have taken much longer to solve it without the clues you gave me.

Kind regards, Doug
 
  


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
Problem while compiling Qt App. scarypajamas Programming 5 10-01-2009 11:33 AM
There is error while trying to install QT4 . please help navderm Programming 1 01-10-2009 09:39 AM
starting qt4 - compiling problem divukman Programming 1 07-14-2007 11:25 PM
Compiling qt4 apps for non-qt4 linux, win, mac birdseye Programming 4 10-31-2005 04:45 AM
compiling gtk1 app against gtk2 cs-cam Linux - Newbie 3 01-11-2005 02:53 AM

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

All times are GMT -5. The time now is 03:33 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