Omnimaga

General Discussion => Technology and Development => Computer Programming => Topic started by: ruler501 on January 26, 2012, 12:18:22 pm

Title: Getting GCC Working on Windows
Post by: ruler501 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
Title: Re: Getting GCC Working on Windows
Post by: systwo 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)
Title: Re: Getting GCC Working on Windows
Post by: ruler501 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