Author Topic: Getting GCC Working on Windows  (Read 2848 times)

0 Members and 1 Guest are viewing this topic.

Offline ruler501

  • Meep
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2475
  • Rating: +66/-9
  • Crazy Programmer
    • View Profile
Getting GCC Working on Windows
« on: January 26, 2012, 12:18:22 pm »
I am running Windows 7 Home Premuim 64 bit

When trying to compile any program with mingw's gcc or g++ I get these errors

Code: [Select]
-------------- Build: Release in File io ---------------

Compiling: Main.cpp
In file included from c:\mingw\bin\../lib/gcc/mingw32/4.6.1/include/c++/bits/postypes.h:42:0,
                 from c:\mingw\bin\../lib/gcc/mingw32/4.6.1/include/c++/iosfwd:42,
                 from c:\mingw\bin\../lib/gcc/mingw32/4.6.1/include/c++/ios:39,
                 from c:\mingw\bin\../lib/gcc/mingw32/4.6.1/include/c++/ostream:40,
                 from c:\mingw\bin\../lib/gcc/mingw32/4.6.1/include/c++/iostream:40,
                 from E:\C++\Tests\File io\Main.cpp:2:
c:\mingw\bin\../lib/gcc/mingw32/4.6.1/include/c++/cwchar:250:11: error: '::wcstold' has not been declared
c:\mingw\bin\../lib/gcc/mingw32/4.6.1/include/c++/cwchar:266:22: error: '__gnu_cxx::wcstold' has not been declared
In file included from c:\mingw\bin\../lib/gcc/mingw32/4.6.1/include/c++/fstream:43:0,
                 from E:\C++\Tests\File io\Main.cpp:3:
c:\mingw\bin\../lib/gcc/mingw32/4.6.1/include/c++/cstdio:166:11: error: '::snprintf' has not been declared
c:\mingw\bin\../lib/gcc/mingw32/4.6.1/include/c++/cstdio:167:11: error: '::vfscanf' has not been declared
c:\mingw\bin\../lib/gcc/mingw32/4.6.1/include/c++/cstdio:168:11: error: '::vscanf' has not been declared
c:\mingw\bin\../lib/gcc/mingw32/4.6.1/include/c++/cstdio:169:11: error: '::vsnprintf' has not been declared
c:\mingw\bin\../lib/gcc/mingw32/4.6.1/include/c++/cstdio:170:11: error: '::vsscanf' has not been declared
c:\mingw\bin\../lib/gcc/mingw32/4.6.1/include/c++/cstdio:176:22: error: '__gnu_cxx::snprintf' has not been declared
c:\mingw\bin\../lib/gcc/mingw32/4.6.1/include/c++/cstdio:177:22: error: '__gnu_cxx::vfscanf' has not been declared
c:\mingw\bin\../lib/gcc/mingw32/4.6.1/include/c++/cstdio:178:22: error: '__gnu_cxx::vscanf' has not been declared
c:\mingw\bin\../lib/gcc/mingw32/4.6.1/include/c++/cstdio:179:22: error: '__gnu_cxx::vsnprintf' has not been declared
c:\mingw\bin\../lib/gcc/mingw32/4.6.1/include/c++/cstdio:180:22: error: '__gnu_cxx::vsscanf' has not been declared
Process terminated with status 1 (0 minutes, 0 seconds)
12 errors, 0 warnings

I installed mingw with Code::Blocks with this installer codeblocks-10.05mingw-setup.exe
I have also tried using mingw64 which works fine till I try to run the compiled program. AT which point it says it is missing a library called libgcc_s_sjilj-1.dll

Does anyone know how I can get gcc working so I can compile my programs on windows?

EDIT: I got mingw64 working by adding the lib folder to the path
« Last Edit: January 26, 2012, 01:52:47 pm by ruler501 »
I currently don't do much, but I am a developer for a game you should totally try out called AssaultCube Reloaded download here https://assaultcuber.codeplex.com/
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/CS/M/S d- s++: a---- C++ UL++ P+ L++ E---- W++ N o? K- w-- o? !M V?
PS+ PE+ Y+ PGP++ t 5? X R tv-- b+++ DI+ D+ G++ e- h! !r y

Offline systwo

  • LV2 Member (Next: 40)
  • **
  • Posts: 25
  • Rating: +7/-0
    • View Profile
Re: Getting GCC Working on Windows
« Reply #1 on: January 26, 2012, 02:02:59 pm »
libgcc_s_sjilj-1.dll should present somewhere in the mingw folder (bin/ probably). Just copy that to the folder of your compiled executable and it should work. If it doesn't you can try grabbing it from the net (no guarantees if it works)
« Last Edit: January 26, 2012, 02:03:32 pm by systwo »

Offline ruler501

  • Meep
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2475
  • Rating: +66/-9
  • Crazy Programmer
    • View Profile
Re: Getting GCC Working on Windows
« Reply #2 on: January 26, 2012, 02:07:40 pm »
yeah I got it working by adding the lib folder to the path. thanks for the tips
I currently don't do much, but I am a developer for a game you should totally try out called AssaultCube Reloaded download here https://assaultcuber.codeplex.com/
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/CS/M/S d- s++: a---- C++ UL++ P+ L++ E---- W++ N o? K- w-- o? !M V?
PS+ PE+ Y+ PGP++ t 5? X R tv-- b+++ DI+ D+ G++ e- h! !r y