CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 2 FirstFirst 12
Results 16 to 27 of 27
  1. #16
    Join Date
    Aug 2007
    Posts
    858

    Re: Question about C++, compilers

    How should I go about compiling C++ files meant for QT?
    Qt is very different from normal C++ libraries. It adds non-standard features to the language, and it includes its own "preprocessor" which you have to put your source files through before feeding them to an actual C++ compiler. You'll have to go to the Qt website for instructions on getting all of that set up.

  2. #17
    Join Date
    Oct 2006
    Location
    Sweden
    Posts
    3,654

    Re: Question about C++, compilers

    Quote Originally Posted by ninja9578 View Post
    Writing C++ on Windows is hell, Windows does not have a make command.
    Huh? I must say that having to maintain a makefile is hell compared to using MSVC's project settings... For those that instead love makefiles nmake is part of the express installation package.
    Debugging is twice as hard as writing the code in the first place.
    Therefore, if you write the code as cleverly as possible, you are, by
    definition, not smart enough to debug it.
    - Brian W. Kernighan

    To enhance your chance's of getting an answer be sure to read
    http://www.codeguru.com/forum/announ...nouncementid=6
    and http://www.codeguru.com/forum/showthread.php?t=366302 before posting

    Refresh your memory on formatting tags here
    http://www.codeguru.com/forum/misc.php?do=bbcode

    Get your free MS compiler here
    https://visualstudio.microsoft.com/vs

  3. #18
    Join Date
    Jan 2009
    Posts
    1,689

    Re: Question about C++, compilers

    If you're writing the project it's fine, try compiling wxWidgets for Visual C++ It's not your programs that makefiles are for, I've only written a few makefiles in my whole life, it's all of the libraries that you end up needing that you wish windows had a make function.

    If I remember correctly, nmake isn't make compatible. Libraries all use real make files, not Microsoft's interpretation of how make should work.

  4. #19
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: Question about C++, compilers

    Quote Originally Posted by ninja9578 View Post
    If you're writing the project it's fine, try compiling wxWidgets for Visual C++ It's not your programs that makefiles are for, I've only written a few makefiles in my whole life, it's all of the libraries that you end up needing that you wish windows had a make function.

    If I remember correctly, nmake isn't make compatible. Libraries all use real make files, not Microsoft's interpretation of how make should work.
    Well, you can always use CMake to generate the project files I guess. There are options, anyway.

  5. #20
    Join Date
    Apr 2010
    Posts
    14

    Re: Question about C++, compilers

    Quote Originally Posted by Speedo View Post
    Qt is very different from normal C++ libraries. It adds non-standard features to the language, and it includes its own "preprocessor" which you have to put your source files through before feeding them to an actual C++ compiler. You'll have to go to the Qt website for instructions on getting all of that set up.

    And in doing so requires you to use the 'make' command. Which I get an error for.
    And reading on it seems make is not from qt but your compiler?

    So I tried to install minGW stand alone and see what this whole make thing is, but the make command still is not recognized.

    All I would like to do is build applications with the qt framework!

    So I am totally lost at this point?

  6. #21
    Join Date
    Jan 2006
    Location
    Singapore
    Posts
    6,765

    Re: Question about C++, compilers

    Quote Originally Posted by Chris Evil
    And in doing so requires you to use the 'make' command. Which I get an error for.
    A quick check brings up Installing Qt on Windows, which provides examples to the contrary (though it also states that "Open Source Versions of Qt is not officially supported for use with any version of Visual Studio").

    Quote Originally Posted by Chris Evil
    So I tried to install minGW stand alone and see what this whole make thing is, but the make command still is not recognized.
    You could use mingw32-make, or install MSYS and then use make. I am afraid that I am not clear of the differences.
    C + C++ Compiler: MinGW port of GCC
    Build + Version Control System: SCons + Bazaar

    Look up a C/C++ Reference and learn How To Ask Questions The Smart Way
    Kindly rate my posts if you found them useful

  7. #22
    Join Date
    Jul 2005
    Location
    Netherlands
    Posts
    2,042

    Re: Question about C++, compilers

    Quote Originally Posted by laserlight View Post
    A quick check brings up Installing Qt on Windows,
    I recently build Qt using VS2005 following this guide. You have to read well, take things one step at a time and have some perseverance if you want to make it, but it's not impossible. By the way, I don't think this will be easier using another compiler/IDE.

    A few problems I ran into:
    - Make sure you have enough disk space. Building debug and release libraries (dynamic only, no static ones) took up 10 GB.
    - Make sure you run the commands from the command line tool inside Visual Studio. Don't just run "cmd", else the nmake command/program won't work.
    - I had to first build the libraries with support for QT3, which would give errors somewhere halfway, then start again building without support for QT3. Probably due to some incorrect dependency in some library, but I didn't bother to investigate.
    Cheers, D Drmmr

    Please put [code][/code] tags around your code to preserve indentation and make it more readable.

    As long as man ascribes to himself what is merely a posibility, he will not work for the attainment of it. - P. D. Ouspensky

  8. #23
    Join Date
    Jun 2007
    Location
    Aurora CO USA
    Posts
    137

    Re: Question about C++, compilers

    Quote Originally Posted by Chris Evil View Post
    And in doing so requires you to use the 'make' command. Which I get an error for.
    And reading on it seems make is not from qt but your compiler?
    Mostly correct. The make utility is sometimes provided by a compiler install, sometimes as a stand-alone utility. More on this below.
    So I tried to install minGW stand alone and see what this whole make thing is, but the make command still is not recognized.

    All I would like to do is build applications with the qt framework!

    So I am totally lost at this point?
    Not at all. I haven't tried this in a while, but Nokia supports an IDE and compiler for every platform QT is supported on:
    Qt Creator is a new cross-platform integrated development environment (IDE) tailored to the needs of Qt developers. Qt Creator is available bundled together with the latest Qt libraries and additional development tools as part of the Qt SDK, which provides everything you need to get started with cross-platform Qt development in a single install.
    Go to the QT downloads page and download the Qt Creator 2.0.0 Binary for Windows. It should give you everything you need to create and build QT projects. I believe there is even a set of tutorials built in.

    Apart from what they are, is there no 'native' make command for windows? So are you not mean/encouraged to compile C++ files with windows?
    Windows is distributed as a general purpose operating system. You are supposed to install whatever applications you need to make it what you want (at least, that's the theory). As such, it doesn't have native tools for a lot of things.

    If you want to do code development, you have to find/buy all the tools you need and install them. Make is not provided as part of the "out of the box" Windows install. I'm not familiar with what is provided by MinGW, although it appears from their web site that make is in there in some fashion (either as part of MinGW or from the msys add on, or both). At one time, Borland C++ also provided a make utility (in the bin folder), not sure if it still does or not. Cygwin can also install make for you. As others have said, Visual Studio provides nmake, which is not fully compatible with make.

    A quick check brings up Installing Qt on Windows, which provides examples to the contrary (though it also states that "Open Source Versions of Qt is not officially supported for use with any version of Visual Studio").
    Note that this appears to be using the Daily Dev Snapshot of QT which is not something I'd recommend for someone just starting out.

    Hope this helps you out. Again, the first thing I would try is using the QT provided IDE as that's where you'll get the best QT support. Good Luck!
    Last edited by ajhampson; July 26th, 2010 at 02:55 PM. Reason: One final comment

  9. #24
    Join Date
    Apr 2010
    Posts
    14

    Re: Question about C++, compilers

    What I asked about a native make command for windows, what I meant is does it natively have any support for this make command?

    I do have qt creator. And it does work, was just interested to get it to 'compile' projects on a more low level - just to understand this whole compilation, QT framework thing...

    As for QT with visual studio that's not really what I'm looking for..

    Hmmmm...

    Would it be an easy task to write a C++ source file with notepad and compile it with MinGW? Without using code::blocks?

  10. #25
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: Question about C++, compilers

    Yeah, not that hard to compile using gcc.

  11. #26
    Join Date
    Jun 2007
    Location
    Aurora CO USA
    Posts
    137

    Re: Question about C++, compilers

    Quote Originally Posted by Chris Evil View Post
    What I asked about a native make command for windows, what I meant is does it natively have any support for this make command?
    I thought I answered that:
    Windows is distributed as a general purpose operating system. You are supposed to install whatever applications you need to make it what you want (at least, that's the theory). As such, it doesn't have native tools for a lot of things.

    If you want to do code development, you have to find/buy all the tools you need and install them. Make is not provided as part of the "out of the box" Windows install. I'm not familiar with what is provided by MinGW, although it appears from their web site that make is in there in some fashion (either as part of MinGW or from the msys add on, or both). At one time, Borland C++ also provided a make utility (in the bin folder), not sure if it still does or not. Cygwin can also install make for you. As others have said, Visual Studio provides nmake, which is not fully compatible with make.
    Am I just not understanding your question?

  12. #27
    Join Date
    Aug 2009
    Location
    Romania->Felnac
    Posts
    48

    Re: Question about C++, compilers

    The original problem was "working" Qt...
    I really recommend to download (and install) the Qt SDK for Windows, witch comes bundled with MingW compiler (and make tool) with qmake (tool specific to Qt for project files, running their "compilers" <moc and uic> that generate c++ code, that can be compiled by mingw) and everything running out_of_the_box (just install and works with Qt Creator IDE)

    You just need to add to the PATH if you want to run Qt applications without coping the dll's.

    NOTE: if you try to integrate Qt with Codeblocks or other compiler/IDE you will need to provide some batch files (compiler options... etc) to run qmake on the Qt files (the ones with Q_OBJECT classes) because if you don't, the c++ compiler doesn't know what signals/slots(and other Qt language above C++) are, so you can't build from the IDE.

    There are some plug-ins for Visual Studio and Eclipse that include all the tools (and possibly you need to build Qt from source, but for VS i think they give pre-build Qt libraries, but i'm not sure, i use Qt Creator for Qt applications )

    LE: the link is to the open source (LGPL) version of Qt.
    Last edited by Zlatomir; August 1st, 2010 at 04:20 AM.

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured