Thread: Compiling in windows

  1. #16
    Registered User
    Join Date
    Dec 2006
    Location
    Canada
    Posts
    3,229
    You need all the exe's because gcc/g++ calls them in background for you.

    For example,
    ld.exe is the linker
    as.exe is the assembler
    ar.exe is the archiver (for making libraries)

    gdb.exe is the GNU Debugger
    gprof.exe is the GNU profiler (tells you where your program spends its time)
    gcov.exe is a test coverage program (tells you what lines of your code are actually run)
    make.exe is a build system (makes building multi-file projects easier)

    Those are the ones I know... I'm sure you can Google the rest up if you wanted to.

  2. #17
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    I'd like to point out that "gcc -c" will compile to object file, and it will "do the right thing" if your file is called .cpp for example, and compile it as C++. The -x option is only meaningful when the extension is "wrong" - e.g. someone copied a load of .C files to a machine which doesn't make a distinction between .c and .C (the latter is a C++ file in Unix/linux-land) - then instead of renaming all the files to .cpp, you could use "gcc -x C++" (or whatever the syntax is).

    However, when building the final executable, g++, as Laserlight hints, will include the C++ standard library, as well as the C standard library. gcc will only include the C standard library - if you have C++ code that uses the C++ standard library [and it may well do that even if you didn't think so, since a fair amount of C++ "behind the scenes" are solved by linking to the library functions - for example constructors/destructors for global variables are handled by the C++ library, as well as some of the handling of exceptions.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compiling for Windows on Linux
    By Tzu in forum C++ Programming
    Replies: 9
    Last Post: 08-20-2006, 10:08 AM
  2. Network Programming in C for Windows
    By m.mixon in forum C Programming
    Replies: 7
    Last Post: 06-19-2006, 08:27 PM
  3. Compiling for Windows CE
    By LiX in forum Windows Programming
    Replies: 1
    Last Post: 12-06-2004, 08:53 AM
  4. compiling gaim for windows
    By the Wookie in forum C++ Programming
    Replies: 8
    Last Post: 10-05-2003, 06:12 AM
  5. Manipulating the Windows Clipboard
    By Johno in forum Windows Programming
    Replies: 2
    Last Post: 10-01-2002, 09:37 AM