by 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