PDA

View Full Version : SDK vs. own compilation



codeman
5th October 2009, 11:21
Hello friends,

until now I have compile my lib by my own. Have the sdk all modules compiled. what is the difference between the sdk and the own compilation.

My version now is 4.5.1 and I think to upgrade now, but get some errors in 4.5.2 in past and would take the ready to use sdk.

codeman
5th October 2009, 15:25
No suggestions???

Ok I install the new sdk with mingw I set all my env variables, clean my project
start qmake && make and I get an error.

It says me :

sources\tableeditor.cpp|36|headers\\ConDB.h: No such file or directory|


"headers\\ConDB.h"

That is very strange with 4.5.1(own compilation) it works. What is the problem here..

codeman
5th October 2009, 17:52
Ok here is the solution:

I have to change my lines from:


#include "folder\\some.h"

to


#include "..\\folder\\some.h"

Could anybody explain me what is changed in the sdk.

axeljaeger
15th October 2009, 13:02
Why do you use \\ as a seperator char? usually you use / and never ever add things like .. in the include statements but include the directory .. in the include path for your compiler.

codeman
16th October 2009, 16:55
What would you suggest .
What should I enter in .pro file?

axeljaeger
16th October 2009, 16:58
INCLUDEPATH += <yourincludepath>

codeman
16th October 2009, 18:08
Ok I include the line



INCLUDEPATH += . headers sources


and then change the line
from
#include "..\\headers\\tableeditor.h"


to

#include "/headers/tableeditor.h"


I get this error:



sources\main.cpp|10|/headers/tableeditor.h: No such file or directory|


and now??? Do I misunterstood something wrong

bender86
18th October 2009, 14:37
If file tableeditor.h is inside a directory in the INCLUDEPATH you could do this way
#include <tableeditor.h>

codeman
19th October 2009, 13:44
First of all,thank you. Now, just for understanding.
How should my project file to be built. My looks like this at the moment



TEMPLATE = app
TARGET =
DESTDIR = bin/
DEPENDPATH += . headers sources
INCLUDEPATH += headers

CONFIG +=release
CONFIG += qt console
QT +=sql gui network core

# Input
HEADERS += headers/file1.h
SOURCES += sources/file1.cpp sources/main.cpp

RESOURCES += myproject.qrc


RC_FILE += resourcefiles/myproject.rc


And how do I set INCLUDEPATH ???

axeljaeger
19th October 2009, 13:47
The pro-file looks fine for me. Now just change #include "headers/myheader.h" to #include "myheader.h" and you are done.

codeman
19th October 2009, 15:38
Ok with this constellations I get an error



sources\main.cpp|10|file1.h: No such file or directory|

axeljaeger
19th October 2009, 17:07
And the directory that contains file1.h is added to the includepath? Then we need the full command line to gcc to track down whether the includepath was added.

codeman
19th October 2009, 22:33
OK, I change my pro to to this one



TEMPLATE = app
TARGET =
DESTDIR = bin/
DEPENDPATH += . headers sources
INCLUDEPATH += absolute/path/to/my/headers

CONFIG +=release
CONFIG += qt console
QT +=sql gui network core

# Input
HEADERS += headers/tableeditor.h
SOURCES += sources/tableeditor.cpp sources/main.cpp

RESOURCES += myproject.qrc


RC_FILE += resourcefiles/myproject.rc


and in my main.cpp I have this line


#include "tableeditor.h"

I get this error



sources\main.cpp|10|tableeditor.h: No such file or directory|


I am beginning to despair!!!!

axeljaeger
19th October 2009, 22:34
Give me the commandline that the compiler gets, otherwise I cannot help you.

squidge
19th October 2009, 23:09
Since you are using Windows, you can use FileMon to see where that header file is being searched and modify appropriately. It's saved me a headache a few times in the past.

But the compiler command line should tell you exactly where it is searching for include directories. It's the most useful part.

codeman
20th October 2009, 00:14
ok. do you mean this




-------------- Build: Release in VerteilungsRechner ---------------

[100,0%] Running command: mingw32-make.exe -f Makefile Release
mingw32-make.exe -f Makefile.Release
mingw32-make.exe[1]: Entering directory `X:/CODEBLOCKS/cbprojects/VerteilungsRechner'
g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQPRINTEREASY_LIBRARY -DQT_DLL -DQT_NO_DEBUG -DQT_SQL_LIB -DQT_XML_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -I'c:/Qt/2009.04/qt/include/QtCore' -I'c:/Qt/2009.04/qt/include/QtNetwork' -I'c:/Qt/2009.04/qt/include/QtGui' -I'c:/Qt/2009.04/qt/include/QtXml' -I'c:/Qt/2009.04/qt/include/QtSql' -I'c:/Qt/2009.04/qt/include' -I'contrib/qprintereasy' -I'c:/Qt/2009.04/qt/include/ActiveQt' -I'release' -I'c:/Qt/2009.04/qt/mkspecs/win32-g++' -o release/main.o sources/main.cpp
sources/main.cpp:10:25: tableeditor.h: No such file or directory
sources/main.cpp: In function `int main(int, char**)':
sources/main.cpp:23: error: `QDir' has not been declared
sources/main.cpp:23: error: `separator' was not declared in this scope
sources/main.cpp:33: error: invalid use of undefined type `struct QDebug'
c:/Qt/2009.04/qt/include/QtCore/../../src/corelib/global/qglobal.h:1474: error: forward declaration of `struct QDebug'
sources/main.cpp:35: error: invalid use of undefined type `struct QDebug'
c:/Qt/2009.04/qt/include/QtCore/../../src/corelib/global/qglobal.h:1474: error: forward declaration of `struct QDebug'
sources/main.cpp:36: error: invalid use of undefined type `struct QDebug'
c:/Qt/2009.04/qt/include/QtCore/../../src/corelib/global/qglobal.h:1474: error: forward declaration of `struct QDebug'
sources/main.cpp:37: error: invalid use of undefined type `struct QDebug'
c:/Qt/2009.04/qt/include/QtCore/../../src/corelib/global/qglobal.h:1474: error: forward declaration of `struct QDebug'
sources/main.cpp:39: error: invalid use of undefined type `struct QDebug'
c:/Qt/2009.04/qt/include/QtCore/../../src/corelib/global/qglobal.h:1474: error: forward declaration of `struct QDebug'
sources/main.cpp:40: error: invalid use of undefined type `struct QDebug'
c:/Qt/2009.04/qt/include/QtCore/../../src/corelib/global/qglobal.h:1474: error: forward declaration of `struct QDebug'
sources/main.cpp:41: error: invalid use of undefined type `struct QDebug'
c:/Qt/2009.04/qt/include/QtCore/../../src/corelib/global/qglobal.h:1474: error: forward declaration of `struct QDebug'
sources/main.cpp:42: error: invalid use of undefined type `struct QDebug'
c:/Qt/2009.04/qt/include/QtCore/../../src/corelib/global/qglobal.h:1474: error: forward declaration of `struct QDebug'
sources/main.cpp:43: error: invalid use of undefined type `struct QDebug'
c:/Qt/2009.04/qt/include/QtCore/../../src/corelib/global/qglobal.h:1474: error: forward declaration of `struct QDebug'
sources/main.cpp:44: error: invalid use of undefined type `struct QDebug'
c:/Qt/2009.04/qt/include/QtCore/../../src/corelib/global/qglobal.h:1474: error: forward declaration of `struct QDebug'
sources/main.cpp:45: error: invalid use of undefined type `struct QDebug'
c:/Qt/2009.04/qt/include/QtCore/../../src/corelib/global/qglobal.h:1474: error: forward declaration of `struct QDebug'
sources/main.cpp:46: error: invalid use of undefined type `struct QDebug'
c:/Qt/2009.04/qt/include/QtCore/../../src/corelib/global/qglobal.h:1474: error: forward declaration of `struct QDebug'
sources/main.cpp:47: error: invalid use of undefined type `struct QDebug'
c:/Qt/2009.04/qt/include/QtCore/../../src/corelib/global/qglobal.h:1474: error: forward declaration of `struct QDebug'
sources/main.cpp:48: error: invalid use of undefined type `struct QDebug'
c:/Qt/2009.04/qt/include/QtCore/../../src/corelib/global/qglobal.h:1474: error: forward declaration of `struct QDebug'
sources/main.cpp:49: error: invalid use of undefined type `struct QDebug'
c:/Qt/2009.04/qt/include/QtCore/../../src/corelib/global/qglobal.h:1474: error: forward declaration of `struct QDebug'
sources/main.cpp:63: error: `TableEditor' was not declared in this scope
sources/main.cpp:63: error: expected `;' before "editor"
sources/main.cpp:65: error: `editor' was not declared in this scope
sources/main.cpp:23: warning: unused variable 'separator'
sources/main.cpp:63: warning: unused variable 'TableEditor'
sources/main.cpp:65: warning: unused variable 'editor'
c:/Qt/2009.04/qt/include/QtCore/../../src/corelib/global/qglobal.h: At global scope:
c:/Qt/2009.04/qt/include/QtCore/../../src/corelib/global/qglobal.h:1477: warning: inline function `QDebug qDebug()' used but never defined
mingw32-make.exe[1]: *** [release/main.o] Error 1
mingw32-make.exe: *** [Release] Error 2
mingw32-make.exe[1]: Leaving directory `X:/CODEBLOCKS/cbprojects/VerteilungsRechner'
Process terminated with status 2 (0 minutes, 1 seconds)
36 errors, 4 warnings

axeljaeger
20th October 2009, 00:16
Right, this is what I need. -I means add the following path to the includepath. Do you see your directory that contains the header there?

codeman
20th October 2009, 10:12
Ok I unserstand what do you mean. I don´t see the path to my headers right from the flag -I.
But as I before post it, my INCLUDEPATH variable looks to my path with my headers??

axeljaeger
20th October 2009, 10:20
Then obviously the step from .pro-file to makefile fails. How do you give your absolute path in the makefile? what exactly is path/to/files? Maybe you need to put in quotes, use forward slashes instead of backslashes or the other way around?

codeman
20th October 2009, 11:50
Thanks a lot, but it fails.

I use this


INCLUDEPATH += X:/CODEBLOCKS/cbprojects/VerteilungsRechner/headers


And I try it with double backslash, with quotes, with braces etc nothing helps....:confused: