Thread: g++ for Win32

  1. #1
    Registered User xds4lx's Avatar
    Join Date
    Nov 2001
    Posts
    630

    g++ for Win32

    Ok, I have two questions, first how do i get rid of that anoying console window that opens behind my program if i compile with g++ for Win32? Also, how do I compile a DLL with g++? Thanx
    "only two things are infinite, the universe and human stupidity, and im not sure about the former." - albert einstein

  2. #2
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    no console:

    'Linker flags' -mwindows
    'Compiler flags' -c

    Usually does it for me. There should be a massive html help file with binutils that, although an extraordinary dull read, does describe these things - somewhere or other. If you use devc++ ide then I think there is a project switch that amounts to the same thing. If you use mingw (g++) from the cmd line then take a look at some of the examples on my wee, humble website as they contain instructions/make/batch files for windows builds.

    As for dll's there is a great link from http://www.mingw.org site; I think it's Colin Peter's site but I can't remember for the life of me what the link is. There is also the tedious process of studying that html help file I referred to above...but i'd only recommend that if you're seriously insomniac like me.

  3. #3
    Registered User xds4lx's Avatar
    Join Date
    Nov 2001
    Posts
    630
    No im not using either of those ide's, I have to use the one my school recomends which is pcGrasp (its for C/C++, Java, Ada).
    "only two things are infinite, the universe and human stupidity, and im not sure about the former." - albert einstein

  4. #4
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    I only mentioned one IDE ie DevC++. MinGW is a windows port of gcc, as is cygwin. I think dgpp may be too (uses cygwin?) but since i've never gotten round to tryingit i'm not too sure.

    So if you are using g++ then linker and compiler flags should be the same or similar, regardless of ide. But ide's may implement them in different ways. I'm unfamiliar with pcGrasp, though.

    Checkout which port of gcc you are using and it should be an easy step from there to determine the correct compiler/linker switches.

    In any event a look around mingw.org won't do any harm; the Colin Peter's dll tutorial is rather good (but I still don't remember the exact link)

    Sorry I can't be more helpful on this but good luck anyway.

Popular pages Recent additions subscribe to a feed