All my programs require libgcc_s_dw2-1.dll and libstdc++-6.dll

This is a discussion on All my programs require libgcc_s_dw2-1.dll and libstdc++-6.dll within the C++ Programming forums, part of the General Programming Boards category; Hi Since i installed GNU/Gcc 4.x i cant compile a single cpp program without needing the libgcc_s_dw2-1.dll and libstdc++-6.dll for ...

  1. #1
    Registered User
    Join Date
    May 2010
    Posts
    84

    All my programs require libgcc_s_dw2-1.dll and libstdc++-6.dll

    Hi

    Since i installed GNU/Gcc 4.x i cant compile a single cpp program without needing the libgcc_s_dw2-1.dll and libstdc++-6.dll for it to run. As it is quite anoying to always have to ship my programs with those 2 dlls, even when they are simple as hell, i would like to know if im doing anything wrong.

    this simple program requires those dlls:
    Code:
    #include <iostream>
    
    main() {
    	std::cout <<"HEEEEEEERE'S JOHNNY";
    	std::cin.get();
    }
    And btw, the programs only require those 2 dlls on other machines, in mine they work fine, so does this mean that when i installed mingw, it installed those two in my system32 folder?

    If thats the case, is there any way to make it work without having the dlls?? if yes, how?

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    libstdc++ is the C++-runtime. That is, it has the code for things like "printing to the screen" which is going to be different from system to system (which is why it isn't in C++ itself). You can't escape the C++ runtime.

  3. #3
    Registered User
    Join Date
    May 2010
    Posts
    84
    Quote Originally Posted by tabstop View Post
    libstdc++ is the C++-runtime. That is, it has the code for things like "printing to the screen" which is going to be different from system to system (which is why it isn't in C++ itself). You can't escape the C++ runtime.
    hmm, so why didnt i need them when i used gcc 3.x?

    and isnt there any way to merge them with the .exe so i can ship only one .exe file??

  4. #4
    Registered User
    Join Date
    Mar 2009
    Posts
    343
    Add -static to the linker command line options.

  5. #5
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    Quote Originally Posted by shiroaisu View Post
    hmm, so why didnt i need them when i used gcc 3.x?

    and isnt there any way to merge them with the .exe so i can ship only one .exe file??
    You did. They might have been called something else (I don't remember right now whether 3.x used the old msvcrt that's shipped by default).

  6. #6
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    4,145
    O_o

    The MinGW port of GCC never used the "MSVCRT.DLL" for the C++ runtime and still uses it for the C runtime. (You need both.)

    The difference is that the old version linked statically by default.

    Soma

  7. #7
    Registered User
    Join Date
    May 2010
    Posts
    84
    Quote Originally Posted by tabstop View Post
    You did. They might have been called something else (I don't remember right now whether 3.x used the old msvcrt that's shipped by default).
    Quote Originally Posted by phantomotap View Post
    O_o

    The MinGW port of GCC never used the "MSVCRT.DLL" for the C++ runtime and still uses it for the C runtime. (You need both.)

    The difference is that the old version linked statically by default.
    Ah, i see, tks then. Btw when i said i didnt need them i wanted to say that i didnt need to add the dlls with the .exe .

    Quote Originally Posted by KCfromNC View Post
    Add -static to the linker command line options.
    Tks, that was it.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 03-18-2009, 03:32 PM
  2. libstdc++.so.5 not found
    By quickNitin in forum Tech Board
    Replies: 1
    Last Post: 09-06-2006, 09:26 AM
  3. Missing libstdc++ on linux
    By hbennion in forum C++ Programming
    Replies: 2
    Last Post: 11-18-2005, 08:26 PM
  4. g++ error (/usr/lib/libstdc++.so.4)
    By ginoitalo in forum C++ Programming
    Replies: 1
    Last Post: 02-11-2005, 10:06 PM
  5. why do we require sleep?
    By jinx in forum A Brief History of Cprogramming.com
    Replies: 43
    Last Post: 07-14-2004, 08:21 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21