Compiling 64 bit Debian

If you have problems with the installation, you are right here.

Compiling 64 bit Debian

Postby robkailua » Sat Dec 15, 2012 5:02 am

I'm trying to explore Q7basic but having a bit of a problem compiling from the source code. I'm assuming I am making simple setup error. I'm compiling under Debian 6.06 / Gnome 2.30 / qt 4.8.

Solved my first set of errors related to problems finding phonon libraries by adding a statement to the Q7Basic.pro
INCLUDEPATH += /home/.../qt/qt-everywhere-opensource-src-4.8.3/include'
Solved the second error by copying global.h to one directory above where it is actually located (maybe the reference in the source is off?).

However, now I'm getting new compile errors that have me stuck. They are related to QSessionManager. The first error generated is the following:

In function 'QSharedPointer<Q7B_id> Q7B_QSESSIONMANAGER(QSharedPointer<Q7B_id>)':
/home/rob/qt/Q7Basic_Source_Code/Q7BRuntime.cpp

! No matching function for call to 'qobject_cast(QSessionManager*)'


This error occurs in Q7BRuntime.cpp at line 6580. Though I only know a little about C programming, it looks to me like this function is duplicated in this file (though removing what looks like a duplicate to me doesn't stop the errors) - looks like the same function written twice:

Q7B Q7B_QSESSIONMANAGER(Q7B Q7B_Object)
{
if (qobject_cast<QSessionManager *>((QSessionManager* )(Q7B_Object->ref))) return Q7B_Object;
if (Q7B_nil(Q7B_Object)){
return Q7B_Object;
}
Q7B_CASTEXCEPTION("'QSessionManager' for assignment expected. Tried '" + QString(Q7B_Object->type) + "'");
return Q7B_idnil;
}

Q7B Q7B__QSESSIONMANAGER(Q7B Q7B_Object)
{
if (qobject_cast<QSessionManager *>((QSessionManager* )(Q7B_Object->ref))) return Q7B_Object;
if (Q7B_nil(Q7B_Object)){
return Q7B_Object;
}
Q7B_CASTEXCEPTION("'QSessionManager' for assignment expected. Tried '" + QString(Q7B_Object->type) + "'");
return Q7B_idnil;
}



Anybody have any thoughts? Is it my setup for qt? Or am I missing something really obvious.

Thanks in advance for any help.
Rob
robkailua
 
Posts: 3
Joined: Mon Dec 10, 2012 5:19 am

Re: Compiling 64 bit Debian

Postby berndnoetscher » Sat Dec 15, 2012 1:56 pm

There are no duplicates.

Replace them with:

Code: Select all
Q7B Q7B_QSESSIONMANAGER(Q7B Q7B_Object)
{

return Q7B_idnil;
}

Q7B Q7B__QSESSIONMANAGER(Q7B Q7B_Object)
{
return Q7B_idnil;
}


Looks to me that you have somehow an older version of Qt
berndnoetscher
Site Admin
 
Posts: 344
Joined: Thu Mar 25, 2010 9:57 am

Re: Compiling 64 bit Debian

Postby robkailua » Sat Dec 15, 2012 5:12 pm

I really appreciate your time and help. Thought I compiled the latest version of qt: 4.8.3. Maybe I need to re-compile qt?

Still getting these errors all related to QSessionManager:

Q7BRuntime.cpp: In function ‘QSharedPointer<Q7B_id> Q7B_ID(QSessionManager*)’:
Q7BRuntime.cpp:6602: error: invalid use of incomplete type ‘struct QSessionManager’
/usr/local/Trolltech/Qt-4.8.3/include/QtGui/qapplication.h:72: error: forward declaration of ‘struct QSessionManager’
Q7BRuntime.cpp: In function ‘QSessionManager* Q7B_CQSESSIONMANAGER(QSharedPointer<Q7B_id>)’:
Q7BRuntime.cpp:8919: error: invalid use of incomplete type ‘struct QSessionManager’
/usr/local/Trolltech/Qt-4.8.3/include/QtGui/qapplication.h:72: error: forward declaration of ‘struct QSessionManager’
Q7BRuntime.cpp: In function ‘QSharedPointer<Q7B_id> Q7B_QAPPLICATION_ISSESSIONRESTORED(QSharedPointer<Q7B_id>)’:
Q7BRuntime.cpp:51176: error: ‘class QApplication’ has no member named ‘isSessionRestored’
Q7BRuntime.cpp: In function ‘QSharedPointer<Q7B_id> Q7B_QAPPLICATION_SESSIONID(QSharedPointer<Q7B_id>)’:
Q7BRuntime.cpp:51238: error: ‘class QApplication’ has no member named ‘sessionId’
Q7BRuntime.cpp: In function ‘QSharedPointer<Q7B_id> Q7B_QAPPLICATION_SESSIONKEY(QSharedPointer<Q7B_id>)’:
Q7BRuntime.cpp:51246: error: ‘class QApplication’ has no member named ‘sessionKey’
Q7BRuntime.cpp: In function ‘QSharedPointer<Q7B_id> Q7B_QSESSIONMANAGER_ALLOWSERRORINTERACTION(QSharedPointer<Q7B_id>)’:
Q7BRuntime.cpp:58698: error: invalid use of incomplete type ‘struct QSessionManager’
/usr/local/Trolltech/Qt-4.8.3/include/QtGui/qapplication.h:72: error: forward declaration of ‘struct QSessionManager’
Q7BRuntime.cpp: In function ‘QSharedPointer<Q7B_id> Q7B_QSESSIONMANAGER_ALLOWSINTERACTION(QSharedPointer<Q7B_id>)’:
Q7BRuntime.cpp:58706: error: invalid use of incomplete type ‘struct QSessionManager’
/usr/local/Trolltech/Qt-4.8.3/include/QtGui/qapplication.h:72: error: forward declaration of ‘struct QSessionManager’
Q7BRuntime.cpp: In function ‘void Q7B_QSESSIONMANAGER_CANCEL(QSharedPointer<Q7B_id>)’:
Q7BRuntime.cpp:58714: error: invalid use of incomplete type ‘struct QSessionManager’
/usr/local/Trolltech/Qt-4.8.3/include/QtGui/qapplication.h:72: error: forward declaration of ‘struct QSessionManager’
Q7BRuntime.cpp: In function ‘QSharedPointer<Q7B_id> Q7B_QSESSIONMANAGER_DISCARDCOMMAND(QSharedPointer<Q7B_id>)’:
Q7BRuntime.cpp:58722: error: invalid use of incomplete type ‘struct QSessionManager’
/usr/local/Trolltech/Qt-4.8.3/include/QtGui/qapplication.h:72: error: forward declaration of ‘struct QSessionManager’
Q7BRuntime.cpp: In function ‘QSharedPointer<Q7B_id> Q7B_QSESSIONMANAGER_ISPHASE2(QSharedPointer<Q7B_id>)’:
Q7BRuntime.cpp:58730: error: invalid use of incomplete type ‘struct QSessionManager’
/usr/local/Trolltech/Qt-4.8.3/include/QtGui/qapplication.h:72: error: forward declaration of ‘struct QSessionManager’
Q7BRuntime.cpp: In function ‘void Q7B_QSESSIONMANAGER_RELEASE(QSharedPointer<Q7B_id>)’:
Q7BRuntime.cpp:58738: error: invalid use of incomplete type ‘struct QSessionManager’
/usr/local/Trolltech/Qt-4.8.3/include/QtGui/qapplication.h:72: error: forward declaration of ‘struct QSessionManager’
Q7BRuntime.cpp: In function ‘void Q7B_QSESSIONMANAGER_REQUESTPHASE2(QSharedPointer<Q7B_id>)’:
Q7BRuntime.cpp:58746: error: invalid use of incomplete type ‘struct QSessionManager’
/usr/local/Trolltech/Qt-4.8.3/include/QtGui/qapplication.h:72: error: forward declaration of ‘struct QSessionManager’
Q7BRuntime.cpp: In function ‘QSharedPointer<Q7B_id> Q7B_QSESSIONMANAGER_RESTARTCOMMAND(QSharedPointer<Q7B_id>)’:
Q7BRuntime.cpp:58754: error: invalid use of incomplete type ‘struct QSessionManager’
/usr/local/Trolltech/Qt-4.8.3/include/QtGui/qapplication.h:72: error: forward declaration of ‘struct QSessionManager’
Q7BRuntime.cpp: In function ‘QSharedPointer<Q7B_id> Q7B_QSESSIONMANAGER_RESTARTHINT(QSharedPointer<Q7B_id>)’:
Q7BRuntime.cpp:58762: error: invalid use of incomplete type ‘struct QSessionManager’
/usr/local/Trolltech/Qt-4.8.3/include/QtGui/qapplication.h:72: error: forward declaration of ‘struct QSessionManager’
Q7BRuntime.cpp: In function ‘QSharedPointer<Q7B_id> Q7B_QSESSIONMANAGER_SESSIONID(QSharedPointer<Q7B_id>)’:
Q7BRuntime.cpp:58770: error: invalid use of incomplete type ‘struct QSessionManager’
/usr/local/Trolltech/Qt-4.8.3/include/QtGui/qapplication.h:72: error: forward declaration of ‘struct QSessionManager’
Q7BRuntime.cpp: In function ‘QSharedPointer<Q7B_id> Q7B_QSESSIONMANAGER_SESSIONKEY(QSharedPointer<Q7B_id>)’:
Q7BRuntime.cpp:58778: error: invalid use of incomplete type ‘struct QSessionManager’
/usr/local/Trolltech/Qt-4.8.3/include/QtGui/qapplication.h:72: error: forward declaration of ‘struct QSessionManager’
Q7BRuntime.cpp: In function ‘void Q7B_QSESSIONMANAGER_SETDISCARDCOMMAND(QSharedPointer<Q7B_id>, QSharedPointer<Q7B_id>)’:
Q7BRuntime.cpp:58788: error: invalid use of incomplete type ‘struct QSessionManager’
/usr/local/Trolltech/Qt-4.8.3/include/QtGui/qapplication.h:72: error: forward declaration of ‘struct QSessionManager’
Q7BRuntime.cpp: In function ‘void Q7B_QSESSIONMANAGER_SETMANAGERPROPERTY(QSharedPointer<Q7B_id>, QSharedPointer<Q7B_id>, QSharedPointer<Q7B_id>)’:
Q7BRuntime.cpp:58800: error: invalid use of incomplete type ‘struct QSessionManager’
/usr/local/Trolltech/Qt-4.8.3/include/QtGui/qapplication.h:72: error: forward declaration of ‘struct QSessionManager’
Q7BRuntime.cpp: In function ‘void Q7B_QSESSIONMANAGER_SETRESTARTCOMMAND(QSharedPointer<Q7B_id>, QSharedPointer<Q7B_id>)’:
Q7BRuntime.cpp:58810: error: invalid use of incomplete type ‘struct QSessionManager’
/usr/local/Trolltech/Qt-4.8.3/include/QtGui/qapplication.h:72: error: forward declaration of ‘struct QSessionManager’
Q7BRuntime.cpp: In function ‘void Q7B_QSESSIONMANAGER_SETRESTARTHINT(QSharedPointer<Q7B_id>, QSharedPointer<Q7B_id>)’:
Q7BRuntime.cpp:58820: error: invalid use of incomplete type ‘struct QSessionManager’
/usr/local/Trolltech/Qt-4.8.3/include/QtGui/qapplication.h:72: error: forward declaration of ‘struct QSessionManager’
Q7BRuntime.cpp:58820: error: incomplete type ‘QSessionManager’ used in nested name specifier
make: *** [Q7BRuntime.o] Error 1
robkailua
 
Posts: 3
Joined: Mon Dec 10, 2012 5:19 am

Re: Compiling 64 bit Debian

Postby Slowdown » Sun Dec 16, 2012 8:11 pm

Hi,

You have to adapt both .pro files see viewtopic.php?f=9&t=305#p1450
Kind regards,
Slowdown

OSX 10.8.x, VBox Xp, Ubuntu 32/64 bit, EOS 64 bit
Slowdown
 
Posts: 464
Joined: Sat May 01, 2010 7:11 pm
Location: Netherlands

Re: Compiling 64 bit Debian

Postby robkailua » Sat Dec 22, 2012 6:59 am

Though tried setting the QMAKE_CXX_FLAGS as the last post suggested, this didn't help. However, seemed to discover that rebuilding Qt with the -sm switch overcame the session manager errors. Thought I was in the clear, but had to work around finding headers in the ../<header>.h location rather than <header>.h locations (simply modified the source files). Also spit out an error on a 'on_actionDeploy_triggered' declaration which I commented out (not sure if this is critical).

Now, everything compiles for Q7Basic.pro, but I get a linker failure -- see below. Any ideas?? BTW, for anybody else trying to build your own 64 bit Debian version, I've summarized my 'newbie' errors below - sorry for the long note, but maybe there's info others find useful.

Here are the linker errors I'm at a roadblock with:

g++ -m64 -Wl,-O1 -Wl,-rpath,/usr/local/Trolltech/Qt-4.8.3/lib -o Q7Basic ./Application.o ./CodeView.o ./Declare.o ./Evaluation.o ./Examples.o ./FindReplaceFile.o ./Global.o ./MainWindow.o ./myClass.o ./myParser.o ./Project.o ./ProjectProperties.o ./Q7BCodeView.o ./Q7BCompiler.o ./Q7BProjectWindow.o ./Q7BRuntime.o ./Settings.o ./moc_Application.o ./moc_CodeView.o ./moc_Declare.o ./moc_Evaluation.o ./moc_Examples.o ./moc_FindReplaceFile.o ./moc_Global.o ./moc_MainWindow.o ./moc_myClass.o ./moc_myParser.o ./moc_Project.o ./moc_ProjectProperties.o ./moc_Q7BCodeView.o ./moc_Q7BCompiler.o ./moc_Q7BProjectWindow.o ./moc_Q7BRuntime.o ./moc_Settings.o ./qrc_res.o ./qrc_q7b_default.o -L/usr/local/Trolltech/Qt-4.8.3/lib -lQtDeclarative -L/usr/local/Trolltech/Qt-4.8.3/lib -lQtScript -L/usr/X11R6/lib64 -lQtXmlPatterns -lQtWebKit -lphonon -lQtSvg -lQtSql -lQtNetwork -lQtUiTools -L/usr/local/src/qt-everywhere-opensource-src-4.8.3/lib -lQtXml -lQtGui -lQtCore -lpthread
./Global.o: In function `Q7B__Q7BFORMDESIGNER(QSharedPointer<Q7B_id>)':
Global.cpp:(.text+0x432): undefined reference to `Q7BFormDesigner::staticMetaObject'
./Global.o: In function `Q7B_ID(Q7BFormDesigner*)':
Global.cpp:(.text+0x18ae): undefined reference to `typeinfo for Q7BFormDesigner'
./Project.o: In function `Project::SaveAll()':
Project.cpp:(.text+0x2540): undefined reference to `Q7BFormDesigner::saveForm(QString)'
./Project.o: In function `Project::OpenFormDesigner(QSharedPointer<Q7B_id>)':
Project.cpp:(.text+0x4a4e): undefined reference to `Q7BFormDesigner::Q7BFormDesigner(QWidget*)'
Project.cpp:(.text+0x4cda): undefined reference to `Q7BFormDesigner::loadForm(QString)'
./Q7BRuntime.o: In function `Q7B_FORMCLASS_INIT(QObject*, char const*)':
Q7BRuntime.cpp:(.text+0x211e3): undefined reference to `vtable for Q7B_FormClass'
Q7BRuntime.cpp:(.text+0x211eb): undefined reference to `vtable for Q7B_FormClass'
Q7BRuntime.cpp:(.text+0x21249): undefined reference to `typeinfo for Q7B_FormClass'
collect2: ld returned 1 exit status
make: *** [Q7Basic] Error 1


Below is a summary of what I've done:
_________________________________________________________________

A newbie attempt to build Qt and Q7Basic on 64 bit Debian. 20Dec12

I would have simply liked to install Qt and Q7Basic from Synaptic on my 64bit Debian distro. Unfortunately, synaptic doesn't provide Q7Basic or the version of Qt needed. So I figured I simply build Qt first. After a couple of failures to compile Q7Basic with my initial Qt build, I discovered that if Qt didn't have the proper configuration (phonon, gstreamer, session manager support), then the Q7Basic failed. The closest I got to a successful install of Q7Basic used the configuration of libraries and Qt command line switches noted further below.

I'm completely new at this, so others will let me know what is extraneous, what was missed, etc. But maybe will be of help to another.

1). Download QT source, QT Creator source, Q7Basic source. I used qt-4.8.3
I also installed the package 'checkinstall' so I could install Qt as a debian pkg on my system after being bulid..
2). Extract qt-everywhere-opensource-src-4.8.3; I placed in /usr/local/src/qt-everywhere-opensource-src-4.8.3. I had to copy all the header files to /usr/local/src to get the build to work.
3). Build Qt --In synaptic package manager, I needed to install the following to get Qt to build:
install g++
install libxext-dev
install libxrender-dev
the Qt web page also recommended installing the following libraries as noted which I did:
libfontconfig1-dev
libfreetype6-dev
libx11-dev
libxcursor-dev
libxext-dev
libxfixes-dev
libxft-dev
libxi-dev
libxrandr-dev
libxrender-dev
I also needed to install
libqt4-opengl
ligqt4-opengl-dev
python-qt4
libglib2.0-dev
libsm-dev (I think this allows sessionmanager support)

for mysql support added these . . .
libmysqld-dev
libmysqlclient-dev
libmysql++-dev
libmysql++3

libphonon-dev
libgstreamer0.10-dev alone didn't work, but adding
libgstreamer-plugins-base0.10-dev worked!! allowed gstreamer

libssl-dev needed for openssl support

make sure in the source directory and execute (the -sm adds sessionmanager support):
sudo ./configure -plugin-sql-mysql -opensource -openssl -phonon -sm
sudo make
sudo checkinstall

4. Add to .profile in $HOME
PATH=/usr/local/Trolltech/Qt-4.8.3/bin:$PATH
QMAKESPEC=/usr/local/Trolltech/Qt-4.8.3/mkspecs/linux-g++-64
export PATH QMAKESPEC
log off and log on to enable new path
(Note: one suggestion for making qt work properly was to set the QMAKESPEC environ variable
QMAKESPEC=/usr/local/Trolltech/Qt-4.8.3/mkspecs/linux-g++-64
export QMAKESPEC
but didn't seem to affect anything that I could see.)
_____________________________
5. Extract and build QtCreator (fairly straight forward)
sudo ./configure
sudo make
sudo checkinstall
_________________________________
6. Extract Q7Basic. I extracted my files to /usr/local/Q7Basic

7. Modify Q7Basic source files.
There is a suggestion on one of the threads to add this change to Q7Basic.pro and Q7BCompiler.pro:
QMAKE_CXXFLAGS_DEBUG+=-fpermissive
QMAKE_CXXFLAGS_RELEASE+=-fpermissive
I found I had to make the following changes in the source files in order to overcome compile errors. In the following files, change #include "../<header>.h" to #include "<header>.h"
Q7BCompiler.h should read #include "global.h"
although the following 'moc' files say at the top that all changes will be lost, I couldn't compile without these changes:
moc_CodeView.cpp should read #include "CodeView.h"
moc_Declare.cpp should read #include "Declare.h"
moc_Evaluation.cpp should read #include "Evaluation.h"
moc_Examples.cpp should read #include "Examples.h"
moc_FindReplaceFile.cpp should read #include "FindReplaceFile.h"
moc_Global.cpp should read #include "Global.h"
moc_myClass.cpp should read #include "myClass.h"
moc_myParser.cpp should read #include "myParser.h"
moc_Project.cpp should read #include "Project.h"
moc_ProjectProperties.cpp should read #include "ProjectProperties.h"
moc_Q7BCodeView.cpp should read #include "Q7BCodeView.h"
moc_Q7BCompiler.cpp should read #include "Q7BCompiler.h"
moc_Q7BProjectWindow.cpp should read #include "Q7BProjectWindow.h"
moc_Q7BRuntime.cpp should read #include "Q7BRuntime.h"
moc_Settings.cpp should read #include "Settings.h"

moc_MainWindow.cpp should read #include "MainWindow.h"
also in this file: around line 302 comment out case 27 as follows:
/* case 27: _t->on_actionDeploy_triggered((*reinterpret_cast< bool(*)>(_a[1]))); break; */
(this line generates errors, don't know if it is critical to function of Q7basic)

8. Build Q7Basic
Note:
I found that simply typing qmake from a command prompt would run qmake from /usr/bin, which set the include path to /usr/include/qt4. This didn't have all the header files that Q7Basic was looking for. The inelegant solution to this problem for me was to run qmake from the build folder /usr/local/Trolltech/Qt-4.8.3/bin/qmake specifically, so it 'knew' to point to the correct include headers (in the build folder). Simply setting the QMAKESPEC env variable didn't seem to overcome this.
I also found if I did a build and generated an error, sometimes I'd have to start with a clean slate. For me, I simply deleted 'makefile' and any object file (that ended '.o') and that seemed to do the trick.

Then to get the build to work I executed the following from the Q7Basic source folder:
sudo /usr/local/Trolltech/Qt-4.8.3/bin/qmake
sudo make
robkailua
 
Posts: 3
Joined: Mon Dec 10, 2012 5:19 am

Re: Compiling 64 bit Debian

Postby Slowdown » Thu Dec 27, 2012 10:13 am

And did you succeeded ?

I have installed Debian 64bit in VirualBox and have succeeded once in compiling Q7B without any error from Creator but
Q7B wasn't able to run it because i got the following error : segmentation fault.
I'm not an Linux expert and this was my first experience with Debian but till now couldn't compile it.
Kind regards,
Slowdown

OSX 10.8.x, VBox Xp, Ubuntu 32/64 bit, EOS 64 bit
Slowdown
 
Posts: 464
Joined: Sat May 01, 2010 7:11 pm
Location: Netherlands


Return to Installation

Who is online

Users browsing this forum: No registered users and 1 guest

cron