c++compilation

C++ compiler questions


I was just wondering how C++ compilers deal with certain things:
First, how do I find out which C++ compiler I have? (gcc? gnu? or something...)
Then, how does the compiler hide the console window when I'm programming a windows gui?
(or is hiding the console done in code?)
Also, how do I include dlls when compiling?
And is there any place I could learn everything else about my compiler?

EDIT: @StuartGolodetz I think I have minGW, actually (I'm using DevCpp); and what I meant when I asked how to hide the console window or how to include dlls is not how to set it up in the IDE I'm using, but rather, how do I do it at the command line?


Solution

  • Difficult question to answer, because you might have many different compilers on your system, and it's really a question of which one you're using :) That said, gcc/g++ is a common compiler on UNIX-based systems, and Visual C++ is a common compiler on Windows - there's a reasonable chance you'll be using one of those.

    If you're on a UNIX-based system and you want to find out if you've got g++, say, you can do:

    which g++
    

    To find out which version (if you've got it), do:

    g++ --version
    

    In terms of Visual C++ hiding the console window when you're programming a Windows GUI, it just doesn't show it if you've set the subsystem to Windows in your project settings.


    You don't include DLLs when compiling, you link against the .lib file corresponding to them and then make sure they can be found at run-time. Note the (important) distinction between compilation and linking. This seems like a reasonable link:

    http://edmulroy.portbridge.com/oview.htm


    Assuming your compiler is Visual C++ (which is what it sounds like), you can just read through MSDN.


    EDIT:

    In response to your new question, see here:

    How to stop Mingw (g++) opening a console window in windows

    Re. DLLs, you don't include them - you link against the import library for the DLL using -l<libname> and then make sure the DLL itself is either in the same directory as the executable or on the system path at runtime.