Results 1 to 13 of 13

Thread: Qt and Boost in the same C++ program?

Hybrid View

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

    Default Re: Qt and Boost in the same C++ program?

    Quote Originally Posted by wysota View Post
    But no libraries are needed here.
    What do you mean? I'm including libraries in both cases, so don't I need libraries in both cases? Or do you mean that if I include these files before I include the boost libraries, I won't get these compile errors?



    Quote Originally Posted by wysota View Post
    Hmm...? You know there is no "C++ runtime" only "C runtime", right? g++ is just a compiler, it doesn't implement functions. C runtime does (i.e. (g)libc on gcc unix platforms).
    I don't really know what MinGW Runtime means, but I found this about it:

    Quote Originally Posted by http://74.63.13.247/index.php/mingw-runtime
    The MinGW Runtime is the package of headers and libraries that describe the API for the MSVCRT and the mingwex extension functions to help support C99.
    Does MinGW Runtime also help support C++98? For example, stdint.h is a C99 standard library, but it is not implemented in the C++98 standard. In fact, if you include stdint.h in a visual studio project, it won't build because the VC++ compiler will not find the file. I thought it might have been the same thing with swprintf, but apparently not. Maybe stdint.h is just not implemented in C runtime?

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

    Default Re: Qt and Boost in the same C++ program?

    Quote Originally Posted by TriKri View Post
    What do you mean? I'm including libraries in both cases, so don't I need libraries in both cases?
    I mean you don't need any libraries to use swprintf().

    For example, stdint.h is a C99 standard library, but it is not implemented in the C++98 standard.
    stdint.h is a header file, not a library. It's neither included in C99 nor in C++98 because it's a file. C99 and C++98 define the syntax and semantics of the language, not any files.
    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
    May 2010
    Posts
    18
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qt and Boost in the same C++ program?

    Quote Originally Posted by wysota View Post
    I mean you don't need any libraries to use swprintf().
    Can you please explain this a bit more carefully? Okay, you don't need any library to use swprintf(), but you have included libraries anyway, why? Please explain this to me so I understand what you mean.

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

    Default Re: Qt and Boost in the same C++ program?

    Quote Originally Posted by TriKri View Post
    Can you please explain this a bit more carefully? Okay, you don't need any library to use swprintf(), but you have included libraries anyway, why?
    .h files are not libraries. They are declarations of functions, other symbols and sets of macros. You could as well simply copy their required contents to your main implementation file:

    C Code:
    1. extern int printf (const char *, ...);
    2.  
    3. int main() {
    4. printf("%i\n", 42);
    5. return 0;
    6. };
    To copy to clipboard, switch view to plain text mode 
    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
    May 2010
    Posts
    18
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qt and Boost in the same C++ program?

    Aha, ok, my fault! I mean: Seems like boost doesn't include all the headers needed?

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

    Default Re: Qt and Boost in the same C++ program?

    I won't argue with that but maybe you just need to set some macro or something like this. swprintf() is declared in wchar.h, if that's of any help to you.
    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
    May 2010
    Posts
    18
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qt and Boost in the same C++ program?

    It was just a guess, I have no idea actually why it's complaining. I think that use of functions like this should be hidden from the user, and I shouldn't have to mind about where different functions are located just because boost cannot find them, so I hope it's not the meaning that I should include these headers myself.

    According to the top of this page, boost it may or may not work on the MSYS command shell, but I guess that doesn't mean that boost won't support mingw even if the normal command shell is used. I did have MSYS installed, although I compiled from the normal command shell. I don't know if this could have affected in any way.

    Thanks anyway. Maybe mingw works with boost after all, just that I have done something wrong.

    -Kristofer

Similar Threads

  1. Replies: 1
    Last Post: 30th April 2010, 13:25
  2. Howto use Qt with Boost ?
    By bilgenratte in forum Qt Programming
    Replies: 3
    Last Post: 1st October 2009, 14:12
  3. how to use boost multi_array in QtCreator
    By elflord in forum Qt Programming
    Replies: 2
    Last Post: 1st April 2009, 07:37
  4. Boost libraries
    By steg90 in forum General Programming
    Replies: 26
    Last Post: 13th June 2007, 12:50
  5. boost::assign
    By Sivert in forum General Programming
    Replies: 0
    Last Post: 2nd May 2007, 00:23

Tags for this Thread

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
  •  
Qt is a trademark of The Qt Company.