Results 1 to 12 of 12

Thread: TROUBLE MIGRATING CODE from VS2008 to QT

  1. #1
    Join Date
    Aug 2011
    Posts
    7
    Qt products
    Qt4
    Platforms
    Windows

    Default TROUBLE MIGRATING CODE from VS2008 to QT

    Hi, i'm new in QT and I have this problem.
    I developed a C++ program using Visual Studio 2008, I use OpenGL for graphics and GLUI for user interface.
    I would like to use QT for user interface because it seems to be easier and it looks better than GLUI.
    My program uses a .lib for solving a numerical problem (arpack++), so I have some .h and some .libs besides
    my own .h and .cpp files.
    So, I created a new proyect, I added the .h and .cpp files and I modified the .pro file for writting the LIBS+= instruction.
    When I compile the program I get a lot of compile errors like this one:
    C:/Documents and Settings/Administrator/Desktop/System/././ARPACK++//arrseig.h:22: error: new.h: No such file or directory

    arrseig.h is a .h file form arpack++ dll and it work fine in VisualStudio (they are the same files, without modification),
    and new.h should be included in QT (it is a .h file that comes with c++).

    Does someone knows if I shoul include something or configure something such that QT can use the c++ default headers????

    Please help me , I've spend a week trying to solve this problem....
    THANKS!!!!!

    I'm using Qt Creator 1.3.0
    Based on Qt 4.6.0 (32 bit)
    Built on Nov 27 2009 at 14:53:38
    From revision c0e849ecc3
    Copyright 2008-2009 Nokia Corporation. All rights reserved.
    On windows XP

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: TROUBLE MIGRATING CODE from VS2008 to QT

    Use the INCLUDEPATH directive in the project file to point the compiler to where the header files for your libraries reside.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Aug 2011
    Posts
    7
    Qt products
    Qt4
    Platforms
    Windows

    Unhappy Re: TROUBLE MIGRATING CODE from VS2008 to QT

    Thank you for your answer, I was googling and I found out a comment that said that it should be written #include <new> instead of #include <new.h> and doing that I solved that error.

    But now, I got 500 new errors of variables and methods that "was not declared in this scope". It's true that those variables were not declared in the .h file where the error is indicated, but they are declared in the .h files defined in the #include.

    I'm almost giving myself up with QT . I thought it was gonna be easier.

    Can someone help me?????

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: TROUBLE MIGRATING CODE from VS2008 to QT

    Your problem is not with Qt but with expecting that your compiler will depart on a quest of finding files that happen to declare the missing symbols. Do as I told you in my last post and your problems will go away.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Aug 2011
    Posts
    7
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: TROUBLE MIGRATING CODE from VS2008 to QT

    I already do that, in the .pro I wrote the INCLUDEPATH += instruction with the address to the .h files, it still doesn't work..

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: TROUBLE MIGRATING CODE from VS2008 to QT

    Please answer the following questions:
    1. What does the INCLUDEPATH statement in your project look like?
    2. What do the #include statements in files that you know are included (like the aforementioned new.h) look like?
    3. Where in the file system are the files the compiler is able to find and that are containing inclusions to other files that can't be found?
    4. Where in the file system are the files containing the missing symbols?
    5. What is the path of the directory containing your .pro file?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #7
    Join Date
    Aug 2011
    Posts
    7
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: TROUBLE MIGRATING CODE from VS2008 to QT

    ok, here it goes:
    1. The includepath looks like this:
    INCLUDEPATH += "C:\Documents and Settings\Susy\Desktop\System\libs"\
    "C:\Documents and Settings\Susy\Desktop\System"
    2. For example, the include statements at arlsmat.h file are:
    #include "arlspen.h"

    #ifndef ARLSMAT_H
    #define ARLSMAT_H
    #include <stddef.h>
    #include "arch.h"
    #include "armat.h"
    #include "arhbmat.h"
    #include "arerror.h"
    #include "blas1c.h"
    #include "superluc.h"
    #include "arlspdef.h"
    #include "arlutil.h"
    and the error is :C:/Documents and Settings/Administrator/Desktop/System/arlsmat.h:120: error: 'n' was not declared in this scope.
    When I go to the option "Follow symbol under cursor", it goes to the definition of variable 'n' in armat.h

    3. adn 4. All files are in the same folder, in the folder of the project, that will be: C:\Documents and Settings\Administrator\Desktop\System

    5. C:\Documents and Settings\Administrator\Desktop\System

    Thanks for helping me

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: TROUBLE MIGRATING CODE from VS2008 to QT

    So what's exactly the point of adding directories to INCLUDEPATH if no relevant files are there?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  9. #9
    Join Date
    Aug 2011
    Posts
    7
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: TROUBLE MIGRATING CODE from VS2008 to QT

    Sorry, i had a typing mistake at point 1, the include path is this (I textualy copied it)
    INCLUDEPATH += "C:\Documents and Settings\Administrator\Desktop\System\libs"\
    "C:\Documents and Settings\Administrator\Desktop\System"

    So, in the libs folder are the .lib of arpack++
    Last edited by lola; 18th August 2011 at 15:25.

  10. #10
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: TROUBLE MIGRATING CODE from VS2008 to QT

    Try placing all those files in a directory without spaces in its name and try again.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  11. #11
    Join Date
    Aug 2011
    Posts
    7
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: TROUBLE MIGRATING CODE from VS2008 to QT

    Done, same 500 errors

  12. #12
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: TROUBLE MIGRATING CODE from VS2008 to QT

    What if you rename armat.h to armat.h_? Do you get a message about a missing file? If so, then your problem is unrelated to file paths but rather to file contents.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. QT + VS2008 + Adobe API
    By angelo in forum Qt Programming
    Replies: 1
    Last Post: 27th April 2011, 14:22
  2. Replies: 2
    Last Post: 25th June 2010, 09:13
  3. Qwt setup with VS2008
    By er453r in forum Qwt
    Replies: 1
    Last Post: 26th April 2010, 15:44
  4. Replies: 3
    Last Post: 4th February 2010, 19:10
  5. Migrating development XD
    By chaosgeorge in forum Installation and Deployment
    Replies: 10
    Last Post: 24th November 2006, 09:59

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.