DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD Ports and Packages

FreeBSD Ports and Packages Installation and upgrading of ports and packages on FreeBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 2nd May 2008
enpey enpey is offline
Port Guard
 
Join Date: May 2008
Location: Newcastle, Australia
Posts: 33
Default Getting Qt4 to work on FreeBSD

I have installed devel/qt4 and am trying to compile the simple "Hello Qt!" beginner.I have installed all from ports, but cannot find anything in relation to installation other than I need to set a few environment variables...

If I leave QTDIR empty, when running '$ qmake hello.pro' I now do not receive a long line of QFile:pen: errors. In my Makefile I have set absolute paths for MOC and UIC (/usr/local/bin/moc-qt4 or uic-qt4) and I am now receiving this error:
Quote:
$ make
c++ -c -pipe -Wall -W -O2 -fno-strict-aliasing -pipe -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -I/usr/local/share/qt/mkspecs/freebsd-g++ -I. -I. -I../../../../../local/include -I/include -o moc_qapplication.o ../../../../../local/include/Qt/moc_qapplication.cpp
../../../../../local/include/Qt/moc_qapplication.cpp: In member function 'virtual int QApplication::qt_metacall(QMetaObject::Call, int, void**)':
../../../../../local/include/Qt/moc_qapplication.cpp:106: error: invalid use of incomplete type 'struct QApplicationPrivate'
../../../../../local/include/QtCore/qobject.h:285: error: forward declaration of 'struct QApplicationPrivate'
../../../../../local/include/Qt/moc_qapplication.cpp:115: error: invalid use of incomplete type 'struct QIcon'
../../../../../local/include/Qt/qapplication.h:72: error: forward declaration of 'struct QIcon'
*** Error code 1

Stop in /usr/home/np/docs/.code/hello.

I found this http://lists.trolltech.com/qt-jambi...ead00008-0.html but I am unsure of its relevance as I have not installed qt3 (Except for package dependencies such as linux-opera). Could qt3 library interference be affecting my results?

If I '$ export QTDIR=/usr/local/share/qt4; qmake hello.pro' I get a long long list of QFile:pen errors followed by some other errors, but still end up with a Makefile. It still gives me the same errors as outlined above.

With QTDIR set, and running 'qmake hello.pro' these are the errors I get:
Quote:
QFile::open: No file name specified
.
.
.
QFile::open: No file name specified
QFile::open: No file name specified
qt_config.prf:8: Unknown test function: debug
qt_functions.prf:1: Unknown test function: defineReplace
qt_functions.prf:18: Unknown test function: defineTest
QFile::open: No file name specified
QFile::open: No file name specified
qt_config.prf:8: Unknown test function: debug
qt_functions.prf:1: Unknown test function: defineReplace
qt_functions.prf:18: Unknown test function: defineTest
.
.
.
$
Anyone have any ideas on what I might be able to do to get it working?

Thanks, enpey
Reply With Quote
  #2   (View Single Post)  
Old 5th May 2008
hydra's Avatar
hydra hydra is offline
Port Guard
 
Join Date: May 2008
Location: Slovakia (Europe)
Posts: 41
Default

Hi,
I've just installed the devel/qt4 package. Then I downloaded the first sample program (http://doc.trolltech.com/4.3/tutorial-t1.html) into a directory.

What needs to be done next (assuming tcsh for setting the QMAKESPEC, use export when using bash):
Code:
setenv QMAKESPEC freebsd-g++
qmake-qt4 -project
qmake-qt4
make
Hope it works for you.
Reply With Quote
  #3   (View Single Post)  
Old 5th May 2008
enpey enpey is offline
Port Guard
 
Join Date: May 2008
Location: Newcastle, Australia
Posts: 33
Default

Hey,

I am using zsh and I have checked to ensure that export is working. I downloaded the file you are using and that did not work either - giving me:

Quote:
Script started on Tue May 6 07:19:39 2008
$ ls
log.txt main.cpp
$ qmake-qt4 -project
$ ls
hell.pro log.txt main.cpp
$ qmake-qt4
$ ls
Makefile hell.pro log.txt main.cpp
$ make
c++ -c -pipe -O2 -fno-strict-aliasing -pipe -Wall -W -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/share/qt4/mkspecs/freebsd-g++ -I. -I/usr/local/include/QtCore -I/usr/local/include/QtCore -I/usr/local/include/QtGui -I/usr/local/include/QtGui -I/usr/local/include -I. -I. -I. -I/usr/local/include -o main.o main.cpp
main.cpp:1: error: expected constructor, destructor, or type conversion before 'file'
In file included from /usr/include/sys/_types.h:33,
from /usr/include/stddef.h:43,
from /usr/local/include/QtCore/qglobal.h:47,
from /usr/local/include/QtCore/qnamespace.h:47,
from /usr/local/include/QtCore/qobjectdefs.h:47,
from /usr/local/include/QtCore/qobject.h:49,
from /usr/local/include/QtCore/qcoreapplication.h:47,
from /usr/local/include/QtGui/qapplication.h:47,
from /usr/local/include/QtGui/QApplication:1,
from main.cpp:6:
/usr/include/machine/_types.h:75: error: '__int8_t' does not name a type
In file included from /usr/include/unistd.h:41,
from /usr/include/c++/4.2/bits/gthr-default.h:44,
from /usr/include/c++/4.2/bits/gthr.h:114,
from /usr/include/c++/4.2/bits/c++io.h:43,
from /usr/include/c++/4.2/iosfwd:46,
from /usr/include/c++/4.2/bits/stl_algobase.h:70,
from /usr/include/c++/4.2/bits/char_traits.h:46,
from /usr/include/c++/4.2/string:47,
from /usr/local/include/QtCore/qstring.h:62,
from /usr/local/include/QtCore/qobject.h:50,
from /usr/local/include/QtCore/qcoreapplication.h:47,
from /usr/local/include/QtGui/qapplication.h:47,
from /usr/local/include/QtGui/QApplication:1,
from main.cpp:6:
/usr/include/sys/types.h:64: error: '__int8_t' does not name a type
In file included from /usr/include/c++/4.2/bits/postypes.h:49,
from /usr/include/c++/4.2/iosfwd:49,
from /usr/include/c++/4.2/bits/stl_algobase.h:70,
from /usr/include/c++/4.2/bits/char_traits.h:46,
from /usr/include/c++/4.2/string:47,
from /usr/local/include/QtCore/qstring.h:62,
from /usr/local/include/QtCore/qobject.h:50,
from /usr/local/include/QtCore/qcoreapplication.h:47,
from /usr/local/include/QtGui/qapplication.h:47,
from /usr/local/include/QtGui/QApplication:1,
from main.cpp:6:
/usr/include/stdint.h:77: error: '__int_least8_t' does not name a type
*** Error code 1

Stop in /usr/home/np/docs/.code/hell.
I am currently cvsupping the latest source...

For the application I was trying to build (Found in the book 'C++ GUI Programming with Qt4'), using qmake-qt4 instead of qmake means I don't have to adjust the Makefile to point to moc and uic correctly, but it still gives me the same error about incomplete types in the end.

I will finish updating and see if that has any effect.

Thanks, enpey
Reply With Quote
  #4   (View Single Post)  
Old 5th May 2008
enpey enpey is offline
Port Guard
 
Join Date: May 2008
Location: Newcastle, Australia
Posts: 33
Default

I just rebuilt and installed the kernel and world but still get the same error...
Any ideas as to why or what I can do to fix this?
Reply With Quote
  #5   (View Single Post)  
Old 6th May 2008
TerryP's Avatar
TerryP TerryP is offline
Arp Constable
 
Join Date: May 2008
Location: USofA
Posts: 1,547
Default

To me, that output looks kind of strange because the headers in /usr/include/ should be the systems headers, C++ ones going in /usr/include/c++/n.m/ and generally work.


========
My system has both Qt 3.3.8 and Qt 4.3.1 installed and could compile and run the same test app fine with GNU Make and the systems compiler.


Code:
Terry@dixie$ vim main.cpp                                                  2:59
Terry@dixie$ qmake-qt4 -project                                            2:59
Terry@dixie$ qmake-qt4                                                     2:59
Terry@dixie$ ls                                                            2:59
Makefile            main.cpp            qt4-helloworld.pro
Terry@dixie$ gmake                                                         2:59
c++ -c -pipe -O2 -fno-strict-aliasing -pipe -Wall -W -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/share/qt4/mkspecs/freebsd-g++ -I. -I/usr/local/include/QtCore -I/usr/local/include/QtCore -I/usr/local/include/QtGui -I/usr/local/include/QtGui -I/usr/local/include -I. -I. -I. -I/usr/local/include -o main.o main.cpp
c++ -pthread -o qt4-helloworld main.o    -L/usr/local/lib -lQtGui -L/usr/local/lib -lpng -lSM -lICE -pthread -pthread -lXi -lXrender -lXrandr -lXfixes -lXcursor -lXinerama -lfreetype -lfontconfig -lXext -lX11 -lQtCore -lz -lm -pthread -lgthread-2.0 -lglib-2.0 -liconv
Terry@dixie$ ls                                                            3:00
Makefile            main.o              qt4-helloworld.pro
main.cpp            qt4-helloworld*
Terry@dixie$ ./qt4-helloworld                                              3:00
Terry@dixie$                                                               3:00

Note that my ~/.shrc.local (which is sourced by my ~/.zshrc) sets the variables needed:

Code:
 # QT: needed in order to compile QT programs...
 export QMAKESPEC='freebsd-g++'
 export QTDIR='/usr/X11R6/include/'
much like hydrapolic told you.
__________________
My Journal

Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''.
Reply With Quote
  #6   (View Single Post)  
Old 6th May 2008
enpey enpey is offline
Port Guard
 
Join Date: May 2008
Location: Newcastle, Australia
Posts: 33
Default

Ok, Well it has been my silly mistake from copying and pasting the program into vim (The opening comment was not yet a comment). This program now compiles and executes as it is meant to without warning or error on my system.

I assume it must have been a similar silly mistake that prevented my other program from running as after re-writing that and using qmake-qt4 it now works fine.

Thanks to both hydrapolic and to TerryP for their suggestions...
Reply With Quote
  #7   (View Single Post)  
Old 6th May 2008
hydra's Avatar
hydra hydra is offline
Port Guard
 
Join Date: May 2008
Location: Slovakia (Europe)
Posts: 41
Default

You're welcome
Reply With Quote
Reply

Thread Tools
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ATI Catalyst.... Does it work? echoblack OpenBSD Installation and Upgrading 10 17th June 2009 09:04 AM
Any chance to make work in FreeBSD ? giga FreeBSD General 2 30th January 2009 10:07 PM
Atheros 5214 will it work on Freebsd 7 businessgeeks FreeBSD Installation and Upgrading 1 26th December 2008 10:58 AM
Crossplatform UI Work Turophile Programming 9 21st October 2008 11:56 PM
KDE (X-Server) in FreeBSD 7.0 doesn't work correctly louie FreeBSD General 6 7th May 2008 11:53 PM


All times are GMT. The time now is 11:45 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick