Results 1 to 20 of 20

Thread: SDK vs. own compilation

  1. #1
    Join Date
    Apr 2009
    Posts
    206
    Thanks
    34
    Thanked 2 Times in 2 Posts

    Default SDK vs. own compilation

    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.

  2. #2
    Join Date
    Apr 2009
    Posts
    206
    Thanks
    34
    Thanked 2 Times in 2 Posts

    Default Re: SDK vs. own compilation

    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 :
    Qt Code:
    1. sources\tableeditor.cpp|36|headers\\ConDB.h: No such file or directory|
    To copy to clipboard, switch view to plain text mode 


    "headers\\ConDB.h"

    That is very strange with 4.5.1(own compilation) it works. What is the problem here..
    Last edited by codeman; 5th October 2009 at 14:45.

  3. #3
    Join Date
    Apr 2009
    Posts
    206
    Thanks
    34
    Thanked 2 Times in 2 Posts

    Default Re: SDK vs. own compilation

    Ok here is the solution:

    I have to change my lines from:

    Qt Code:
    1. #include "folder\\some.h"
    To copy to clipboard, switch view to plain text mode 

    to

    Qt Code:
    1. #include "..\\folder\\some.h"
    To copy to clipboard, switch view to plain text mode 

    Could anybody explain me what is changed in the sdk.

  4. #4
    Join Date
    Jan 2006
    Location
    Frankfurt
    Posts
    500
    Thanks
    1
    Thanked 52 Times in 52 Posts
    Platforms
    MacOS X Unix/X11

    Default Re: SDK vs. own compilation

    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.
    It's nice to be important but it's more important to be nice.

  5. #5
    Join Date
    Apr 2009
    Posts
    206
    Thanks
    34
    Thanked 2 Times in 2 Posts

    Default Re: SDK vs. own compilation

    What would you suggest .
    What should I enter in .pro file?

  6. #6
    Join Date
    Jan 2006
    Location
    Frankfurt
    Posts
    500
    Thanks
    1
    Thanked 52 Times in 52 Posts
    Platforms
    MacOS X Unix/X11

    Default Re: SDK vs. own compilation

    INCLUDEPATH += <yourincludepath>
    It's nice to be important but it's more important to be nice.

  7. #7
    Join Date
    Apr 2009
    Posts
    206
    Thanks
    34
    Thanked 2 Times in 2 Posts

    Default Re: SDK vs. own compilation

    Ok I include the line

    Qt Code:
    1. INCLUDEPATH += . headers sources
    To copy to clipboard, switch view to plain text mode 

    and then change the line
    from
    Qt Code:
    1. #include "..\\headers\\tableeditor.h"
    To copy to clipboard, switch view to plain text mode 

    to
    Qt Code:
    1. #include "/headers/tableeditor.h"
    To copy to clipboard, switch view to plain text mode 

    I get this error:

    Qt Code:
    1. sources\main.cpp|10|/headers/tableeditor.h: No such file or directory|
    To copy to clipboard, switch view to plain text mode 

    and now??? Do I misunterstood something wrong

  8. #8
    Join Date
    Nov 2007
    Posts
    89
    Thanked 21 Times in 18 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: SDK vs. own compilation

    If file tableeditor.h is inside a directory in the INCLUDEPATH you could do this way
    #include <tableeditor.h>

  9. #9
    Join Date
    Apr 2009
    Posts
    206
    Thanks
    34
    Thanked 2 Times in 2 Posts

    Default Re: SDK vs. own compilation

    First of all,thank you. Now, just for understanding.
    How should my project file to be built. My looks like this at the moment

    Qt Code:
    1. TEMPLATE = app
    2. TARGET =
    3. DESTDIR = bin/
    4. DEPENDPATH += . headers sources
    5. INCLUDEPATH += headers
    6.  
    7. CONFIG +=release
    8. CONFIG += qt console
    9. QT +=sql gui network core
    10.  
    11. # Input
    12. HEADERS += headers/file1.h
    13. SOURCES += sources/file1.cpp sources/main.cpp
    14.  
    15. RESOURCES += myproject.qrc
    16.  
    17.  
    18. RC_FILE += resourcefiles/myproject.rc
    To copy to clipboard, switch view to plain text mode 

    And how do I set INCLUDEPATH ???

  10. #10
    Join Date
    Jan 2006
    Location
    Frankfurt
    Posts
    500
    Thanks
    1
    Thanked 52 Times in 52 Posts
    Platforms
    MacOS X Unix/X11

    Default Re: SDK vs. own compilation

    The pro-file looks fine for me. Now just change #include "headers/myheader.h" to #include "myheader.h" and you are done.
    It's nice to be important but it's more important to be nice.

  11. #11
    Join Date
    Apr 2009
    Posts
    206
    Thanks
    34
    Thanked 2 Times in 2 Posts

    Default Re: SDK vs. own compilation

    Ok with this constellations I get an error

    Qt Code:
    1. sources\main.cpp|10|file1.h: No such file or directory|
    To copy to clipboard, switch view to plain text mode 

  12. #12
    Join Date
    Jan 2006
    Location
    Frankfurt
    Posts
    500
    Thanks
    1
    Thanked 52 Times in 52 Posts
    Platforms
    MacOS X Unix/X11

    Default Re: SDK vs. own compilation

    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.
    It's nice to be important but it's more important to be nice.

  13. #13
    Join Date
    Apr 2009
    Posts
    206
    Thanks
    34
    Thanked 2 Times in 2 Posts

    Default Re: SDK vs. own compilation

    OK, I change my pro to to this one

    Qt Code:
    1. TEMPLATE = app
    2. TARGET =
    3. DESTDIR = bin/
    4. DEPENDPATH += . headers sources
    5. INCLUDEPATH += absolute/path/to/my/headers
    6.  
    7. CONFIG +=release
    8. CONFIG += qt console
    9. QT +=sql gui network core
    10.  
    11. # Input
    12. HEADERS += headers/tableeditor.h
    13. SOURCES += sources/tableeditor.cpp sources/main.cpp
    14.  
    15. RESOURCES += myproject.qrc
    16.  
    17.  
    18. RC_FILE += resourcefiles/myproject.rc
    To copy to clipboard, switch view to plain text mode 

    and in my main.cpp I have this line

    Qt Code:
    1. #include "tableeditor.h"
    To copy to clipboard, switch view to plain text mode 

    I get this error

    Qt Code:
    1. sources\main.cpp|10|tableeditor.h: No such file or directory|
    To copy to clipboard, switch view to plain text mode 

    I am beginning to despair!!!!

  14. #14
    Join Date
    Jan 2006
    Location
    Frankfurt
    Posts
    500
    Thanks
    1
    Thanked 52 Times in 52 Posts
    Platforms
    MacOS X Unix/X11

    Default Re: SDK vs. own compilation

    Give me the commandline that the compiler gets, otherwise I cannot help you.
    It's nice to be important but it's more important to be nice.

  15. #15
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: SDK vs. own compilation

    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.

  16. #16
    Join Date
    Apr 2009
    Posts
    206
    Thanks
    34
    Thanked 2 Times in 2 Posts

    Default Re: SDK vs. own compilation

    ok. do you mean this

    Qt Code:
    1. -------------- Build: Release in VerteilungsRechner ---------------
    2.  
    3. [100,0%] Running command: mingw32-make.exe -f Makefile Release
    4. mingw32-make.exe -f Makefile.Release
    5. mingw32-make.exe[1]: Entering directory `X:/CODEBLOCKS/cbprojects/VerteilungsRechner'
    6. 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
    7. sources/main.cpp:10:25: tableeditor.h: No such file or directory
    8. sources/main.cpp: In function `int main(int, char**)':
    9. sources/main.cpp:23: error: `QDir' has not been declared
    10. sources/main.cpp:23: error: `separator' was not declared in this scope
    11. sources/main.cpp:33: error: invalid use of undefined type `struct QDebug'
    12. c:/Qt/2009.04/qt/include/QtCore/../../src/corelib/global/qglobal.h:1474: error: forward declaration of `struct QDebug'
    13. sources/main.cpp:35: error: invalid use of undefined type `struct QDebug'
    14. c:/Qt/2009.04/qt/include/QtCore/../../src/corelib/global/qglobal.h:1474: error: forward declaration of `struct QDebug'
    15. sources/main.cpp:36: error: invalid use of undefined type `struct QDebug'
    16. c:/Qt/2009.04/qt/include/QtCore/../../src/corelib/global/qglobal.h:1474: error: forward declaration of `struct QDebug'
    17. sources/main.cpp:37: error: invalid use of undefined type `struct QDebug'
    18. c:/Qt/2009.04/qt/include/QtCore/../../src/corelib/global/qglobal.h:1474: error: forward declaration of `struct QDebug'
    19. sources/main.cpp:39: error: invalid use of undefined type `struct QDebug'
    20. c:/Qt/2009.04/qt/include/QtCore/../../src/corelib/global/qglobal.h:1474: error: forward declaration of `struct QDebug'
    21. sources/main.cpp:40: error: invalid use of undefined type `struct QDebug'
    22. c:/Qt/2009.04/qt/include/QtCore/../../src/corelib/global/qglobal.h:1474: error: forward declaration of `struct QDebug'
    23. sources/main.cpp:41: error: invalid use of undefined type `struct QDebug'
    24. c:/Qt/2009.04/qt/include/QtCore/../../src/corelib/global/qglobal.h:1474: error: forward declaration of `struct QDebug'
    25. sources/main.cpp:42: error: invalid use of undefined type `struct QDebug'
    26. c:/Qt/2009.04/qt/include/QtCore/../../src/corelib/global/qglobal.h:1474: error: forward declaration of `struct QDebug'
    27. sources/main.cpp:43: error: invalid use of undefined type `struct QDebug'
    28. c:/Qt/2009.04/qt/include/QtCore/../../src/corelib/global/qglobal.h:1474: error: forward declaration of `struct QDebug'
    29. sources/main.cpp:44: error: invalid use of undefined type `struct QDebug'
    30. c:/Qt/2009.04/qt/include/QtCore/../../src/corelib/global/qglobal.h:1474: error: forward declaration of `struct QDebug'
    31. sources/main.cpp:45: error: invalid use of undefined type `struct QDebug'
    32. c:/Qt/2009.04/qt/include/QtCore/../../src/corelib/global/qglobal.h:1474: error: forward declaration of `struct QDebug'
    33. sources/main.cpp:46: error: invalid use of undefined type `struct QDebug'
    34. c:/Qt/2009.04/qt/include/QtCore/../../src/corelib/global/qglobal.h:1474: error: forward declaration of `struct QDebug'
    35. sources/main.cpp:47: error: invalid use of undefined type `struct QDebug'
    36. c:/Qt/2009.04/qt/include/QtCore/../../src/corelib/global/qglobal.h:1474: error: forward declaration of `struct QDebug'
    37. sources/main.cpp:48: error: invalid use of undefined type `struct QDebug'
    38. c:/Qt/2009.04/qt/include/QtCore/../../src/corelib/global/qglobal.h:1474: error: forward declaration of `struct QDebug'
    39. sources/main.cpp:49: error: invalid use of undefined type `struct QDebug'
    40. c:/Qt/2009.04/qt/include/QtCore/../../src/corelib/global/qglobal.h:1474: error: forward declaration of `struct QDebug'
    41. sources/main.cpp:63: error: `TableEditor' was not declared in this scope
    42. sources/main.cpp:63: error: expected `;' before "editor"
    43. sources/main.cpp:65: error: `editor' was not declared in this scope
    44. sources/main.cpp:23: warning: unused variable 'separator'
    45. sources/main.cpp:63: warning: unused variable 'TableEditor'
    46. sources/main.cpp:65: warning: unused variable 'editor'
    47. c:/Qt/2009.04/qt/include/QtCore/../../src/corelib/global/qglobal.h: At global scope:
    48. c:/Qt/2009.04/qt/include/QtCore/../../src/corelib/global/qglobal.h:1477: warning: inline function `QDebug qDebug()' used but never defined
    49. mingw32-make.exe[1]: *** [release/main.o] Error 1
    50. mingw32-make.exe: *** [Release] Error 2
    51. mingw32-make.exe[1]: Leaving directory `X:/CODEBLOCKS/cbprojects/VerteilungsRechner'
    52. Process terminated with status 2 (0 minutes, 1 seconds)
    53. 36 errors, 4 warnings
    To copy to clipboard, switch view to plain text mode 

  17. #17
    Join Date
    Jan 2006
    Location
    Frankfurt
    Posts
    500
    Thanks
    1
    Thanked 52 Times in 52 Posts
    Platforms
    MacOS X Unix/X11

    Default Re: SDK vs. own compilation

    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?
    It's nice to be important but it's more important to be nice.

  18. #18
    Join Date
    Apr 2009
    Posts
    206
    Thanks
    34
    Thanked 2 Times in 2 Posts

    Default Re: SDK vs. own compilation

    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??

  19. #19
    Join Date
    Jan 2006
    Location
    Frankfurt
    Posts
    500
    Thanks
    1
    Thanked 52 Times in 52 Posts
    Platforms
    MacOS X Unix/X11

    Default Re: SDK vs. own compilation

    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?
    It's nice to be important but it's more important to be nice.

  20. #20
    Join Date
    Apr 2009
    Posts
    206
    Thanks
    34
    Thanked 2 Times in 2 Posts

    Default Re: SDK vs. own compilation

    Thanks a lot, but it fails.

    I use this
    Qt Code:
    1. INCLUDEPATH += X:/CODEBLOCKS/cbprojects/VerteilungsRechner/headers
    To copy to clipboard, switch view to plain text mode 

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

Similar Threads

  1. compilation error when including dumpcpp output
    By Jimmy2775 in forum Qt Programming
    Replies: 13
    Last Post: 14th May 2010, 04:12
  2. sql driver compilation
    By frog in forum Newbie
    Replies: 1
    Last Post: 11th September 2009, 16:07
  3. How to avoid creation of MOC files on each compilation
    By nileshsince1980 in forum Qt Programming
    Replies: 4
    Last Post: 29th May 2009, 08:00
  4. Compilation Error
    By ^NyAw^ in forum General Programming
    Replies: 2
    Last Post: 30th September 2008, 17:37
  5. Qt 4,4 on Solaris 10 compilation error
    By ToddAtWSU in forum Installation and Deployment
    Replies: 2
    Last Post: 1st July 2008, 13:24

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.