Results 1 to 5 of 5

Thread: fatal error C1083: Cannot open include file: 'stdint.h': No such file or directory

  1. #1
    Join Date
    May 2010
    Posts
    18
    Qt products
    Qt4
    Platforms
    Windows

    Default fatal error C1083: Cannot open include file: 'stdint.h': No such file or directory

    Hi! After a lot of trouble of making Qt work together with Boost, I had realized that I can't compile a boost application with MinGW, and that I can't compile a Qt application from Visual Studio. At least directly from visual studio. Or can I? A way that I found and which worked was to open "Visual Studio 2008 Command Prompt", cd to the folder containing the source files, type "qmake -project", then just "qmake", and finally "nmake". Or is there any simpler way? I would rather just be able to write a batch file and invoke that by double clicking on it, but I don't know how to make it run in the visual studio command prompt instead of the normal one.

    Anyway, in that way I could compile a Qt hello world program (which I could only find by googling on it, not on Qt's web page!):

    Qt Code:
    1. #include <QApplication>
    2. #include <QPushButton>
    3.  
    4. int main(int argc, char *argv[])
    5. {
    6. QApplication app(argc, argv);
    7.  
    8. QPushButton hello("Hello world!");
    9. hello.resize(100, 30);
    10.  
    11. hello.show();
    12. return app.exec();
    13. }
    To copy to clipboard, switch view to plain text mode 

    However, after just adding the row "#include <stdint.h>", I got this error message:

    Qt Code:
    1. .\hello_world.cpp(3) : fatal error C1083: Cannot open include file: 'stdint.h': No such file or directory
    To copy to clipboard, switch view to plain text mode 

    Why can't the compiler find stdint.h? Don't nmake know that it's supposed to look in "C:\Program Files\Microsoft Visual Studio 9.0\VC\include" (where stdint.h is located) after include files?

    Edit: I am using this program for a project in school and it's very time critical, in fact it is already quite delayed! Please, does anyone know what this problem is caused by? Am I doing this in the right way or should I do it in some other way? I am using Qt 4.6. Thank you really much in advance!

    -Kristofer
    Last edited by TriKri; 8th May 2010 at 19:51.

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

    Default Re: fatal error C1083: Cannot open include file: 'stdint.h': No such file or director

    Are you using the Qt plugin for Visual studio? If not, that'll make your life a lot easier. Then you can just compile your Qt code directly inside the IDE using the VS compiler.

  3. #3
    Join Date
    May 2010
    Posts
    18
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: fatal error C1083: Cannot open include file: 'stdint.h': No such file or director

    Thank you, I don't really know what the Qt plugin does, although when I googled it, I found this youtube video which helped me compile Qt from the visual studio IDE.

    What I found out about stdint.h was that it is not shipped with vidual studio; that's why the compiler didn't find the file

    Also, if I decide to move over to compiling from the visual studio command prompt again, I will try adding "INCLUDEPATH += . /usr/local/include/boost-1_33_1/" to my .pro file. Then I will have to stop writing "qmake -project" every time I compile, since the only thing it does is to create a new .pro file and overwrite the already existing one.

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

    Default Re: fatal error C1083: Cannot open include file: 'stdint.h': No such file or director

    Yes, when you use Visual Studio, the .pro file isn't used any more. If you modify it, then you should re-import the pro file to a visual studio project file again. You don't need to drop to a command prompt to do this, you can just do "Qt->Open .Pro".

  5. #5
    Join Date
    May 2010
    Posts
    18
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: fatal error C1083: Cannot open include file: 'stdint.h': No such file or director

    Ok. I also saw that you could choose "Qt->Qt Options", and there you could add your qt version to a list, by specifying version name and path. I guess that when you do that, the plugin will automatically add the correct paths to the bin, include and lib folders to the visual studio options in "Tools->Options...->Projects and Solutions->VC++ Directories->", right?

    I thought it was pretty clever though what they did in the video example; instead of creating a normal console application, create a makefile application; that way you can specify which command lines that should be performed when building, rebuilding, and cleaning the project. In that way, the makefiles were recreated every time you built, so updating the pro file would lead to updated makefiles.

Similar Threads

  1. Replies: 2
    Last Post: 9th March 2010, 05:21
  2. Replies: 7
    Last Post: 18th September 2009, 14:44
  3. Replies: 10
    Last Post: 15th June 2009, 19:44
  4. Replies: 1
    Last Post: 27th March 2009, 06:22
  5. Replies: 4
    Last Post: 24th November 2007, 13:33

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.