Hello
:?
did u try build console app by c++ by it ?
by this code only :(
#include <iostream>
using namespace std;
int main()
{
cout << "Hello world!" << endl;
return 0;
}
i got that error
c:\program files\codeblocks\bin\..\lib\gcc\mingw32\4.2.0\..\..\..\..\include\c++\4.2.0\cwctype:90: error: '::iswblank' has not been declared
:: === Build finished: 1 errors, 0 warnings ===
it's very strang :(
i have last build
AmR EiSa
I too have errors compiling the above mentioned simplest console program:
#include <iostream>
using namespace std;
int main()
{
cout << "Hello world!" << endl;
return 0;
}
...and got the following errors in CodeBlocks:
:: === consoleTest, Release ===
obj\Release\main.o:main.cpp:(.text+0x30):: undefined reference to `std::ios_base::Init::Init()'
obj\Release\main.o:main.cpp:(.text+0x3e):: undefined reference to `std::ios_base::Init::~Init()'
obj\Release\main.o:main.cpp:(.text+0x99):: undefined reference to `std::cout'
obj\Release\main.o:main.cpp:(.text+0x9e):: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
obj\Release\main.o:main.cpp:(.text+0xa5):: undefined reference to `std::cout'
obj\Release\main.o:main.cpp:(.text+0xaa):: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)'
:: === Build finished: 6 errors, 0 warnings ===
I did install TDragons gcc-4.1.2-mingw-setup.exe into a new directory, which should include all the necessary packages (except gdb) and just copied the files from gcc-4.2.0-tdm-1.7z over it. I manually replaced the gcc4.1.2 files in the bin directory with those from 4.2 and did the same in Codeblocks.
So, what is wrong??
ok this is the full compiler log:
mingw32-gcc-4.2.0.exe -Lh:\MinGW\lib -LH:\wxWidgets-2.8.4\lib -LH:\wxWidgets-2.8.4\lib\gcc_lib -o bin\Release\consoleTest.exe obj\Release\main.o -s -s
obj\Release\main.o:main.cpp:(.text+0x30): undefined reference to `std::ios_base::Init::Init()'
obj\Release\main.o:main.cpp:(.text+0x3e): undefined reference to `std::ios_base::Init::~Init()'
obj\Release\main.o:main.cpp:(.text+0x99): undefined reference to `std::cout'
obj\Release\main.o:main.cpp:(.text+0x9e): undefined reference to `std::basic_ostream >& std::__ostream_insert >(std::basic_ostream >&, char const*, int)'
obj\Release\main.o:main.cpp:(.text+0xa5): undefined reference to `std::cout'
obj\Release\main.o:main.cpp:(.text+0xaa): undefined reference to `std::basic_ostream >& std::endl >(std::basic_ostream
> >&)'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)
6 errors, 0 warnings
As I said before I don't think that this is a problem of TDragons GCC4.2 but rather of CodeBlocks.
FYI:
This is my Windows XP Batch file I use to get setting of my minGW Setups.
Adjust set MINGWBASEDIR= to your minGW install folder.
version-of-mingw.bat
::
:: Display the current version of GCC, NASM, ld, make and others.
::
@echo off
set MINGWBASEDIR=C:\apps\gcc-4.2.0-tdm-1
SET PATH=%MINGWBASEDIR%\bin;%SystemRoot%\system32
gcc -v 2>&1 | find "gcc version"
REM nasm -v
ld -v
windres --version | find "GNU windres"
mingw32-make -v | find "GNU Make"
type "%MINGWBASEDIR%\include\_mingw.h" | find "#define __MINGW32_VERSION"
type "%MINGWBASEDIR%\include\w32api.h" | find "__W32API_VERSION"
PAUSE
Output on my Computer
gcc version 4.2.0
GNU ld version 2.17.50 20060824
GNU windres 2.17.50 20060824
GNU Make 3.80
#define __MINGW32_VERSION 3.11
#define __W32API_VERSION 3.7
Press any key to continue . . .
@patlecat:
The problem is in your compiler settings in Code::Blocks, apparently. The (correct) default is for it to use mingw32-g++.exe to link your program: the g++ driver ensures that necessary libraries for C++ programs are linked in, whereas the gcc driver requires them to be linked explicitly. Since I don't know what other changes you've made, I would like it best if you could completely reset your compiler settings in C::B. If that's not an option for you, at least make sure that, as mentioned above, mingw32-g++.exe is being used rather than mingw32-gcc-4.2.0.exe.
AHHHH you're a genius man :P That worked, it compiles! I'm not accustomed to the GCC suite, yet. Unfortunately now the program wont run and I have this system error:
The procedure entry point _ctype count not be located in the dynamic link library msvcr71.dll
(I have VC2k3 installed so msvcr71.dll is installed on my pc)
And if I may also ask about the linker error I have when I try to compile the default wxWidgets project? There I get this error:
cc1plus.exe: warning: ./wx_pch.h.gch/Debug_wx_pch_h_gch: created by a different GCC executable
Linking executable: bin\Release\wixTest3.exe
h:/mingw/bin/../lib/gcc/mingw32/4.2.0/../../../../mingw32/bin/ld.exe: cannot find -lwxmsw28
collect2: ld returned 1 exit status
(I've had this problem from the beginning, a few weeks ago, when I first installed a nightly build of CB. And yes, both wxWidgets and this test program were built with the same compiler suite.)
PS: I've rebuilt/cleaned both projects several times
@TimS_: Kool script man, thanx. I've gotten this out of it:
gcc version 4.2.0
GNU ld version 2.17.50 20060824
GNU windres 2.17.50 20060824
GNU Make 3.81
#define __MINGW32_VERSION 3.11
#define __W32API_VERSION 3.7
Press any key to continue . . .
Things are getting weirder by the minute. I've rebuilt wxWidgets 2.8.4 after I copied runtime3.11 over the installation again. Then my wx project showed the same error but I noticed that it used the 2.8.3 directories, although I changed them to 2.8.4 in CB!
Ok so I deleted it and created a new default wxW project and now I have these totally different errors.... CB is driving me crazy :roll:
mingw32-gcc-4.2.0.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -Winvalid-pch -include wx_pch.h -DWX_PRECOMP -Wall -g -march=athlon-xp -O3 -W -pg -g -IH:\wxWidgets-2.8.4\include -IH:\wxWidgets-2.8.4\contrib\include -IH:\wxWidgets-2.8.4\lib\gcc_lib\msw -Ih:\MinGW\include -IH:\wxWidgets-2.8.4\include -IH:\wxWidgets-2.8.4\include\wx\msw -IH:\wxWidgets-2.8.4\contrib\include -IH:\wxWidgets-2.8.4\lib -IH:\wxWidgets-2.8.4\lib\gcc_lib -c H:\myProjects2\wixTest\wx_pch.h -o wx_pch.h.gch\Debug_wx_pch_h_gch
In file included from H:/wxWidgets-2.8.4/include/wx/defs.h:21,
from H:/wxWidgets-2.8.4/include/wx/wxprec.h:13,
from ./wx_pch.h:14,
from :0:
H:/wxWidgets-2.8.4/include/wx/platform.h:196:22: error: wx/setup.h: No such file or directory
In file included from H:/wxWidgets-2.8.4/include/wx/platform.h:279,
from H:/wxWidgets-2.8.4/include/wx/defs.h:21,
from H:/wxWidgets-2.8.4/include/wx/wxprec.h:13,
from ./wx_pch.h:14,
from :0:
H:/wxWidgets-2.8.4/include/wx/chkconf.h:98:9: error: #error "wxUSE_DYNLIB_CLASS must be defined."
H:/wxWidgets-2.8.4/include/wx/chkconf.h:106:9: error: #error "wxUSE_EXCEPTIONS must be defined."
H:/wxWidgets-2.8.4/include/wx/chkconf.h:114:9: error: #error "wxUSE_FILESYSTEM must be defined."
H:/wxWidgets-2.8.4/include/wx/chkconf.h:122:9: error: #error "wxUSE_FS_ARCHIVE must be defined."
...
H:/wxWidgets-2.8.4/include/wx/msw/wrapcctl.h: In function 'wxSetCCUnicodeFormat':
H:/wxWidgets-2.8.4/include/wx/msw/wrapcctl.h:48: error: expected expression before ':' token
H:/wxWidgets-2.8.4/include/wx/msw/wrapcctl.h:45: warning: unused parameter 'hwnd'
H:/wxWidgets-2.8.4/include/wx/msw/wrapcctl.h: At top level:
H:/wxWidgets-2.8.4/include/wx/msw/wrapcctl.h:58: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'wxFont'
H:/wxWidgets-2.8.4/include/wx/msw/wrapcctl.h:59: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'wxGetCCDefaultFont'
...
When creating a new wxW project, the wizard always says: A matching Debug/Release configuration cannot be found in the wxWidges directory you specified. This means that Debug/Release target of your project will not be built.
But I gave the right directory both in the wizard (why does he need that anyway??) and in the Settings-GlobalVariables.
ok I reinstalled the not-working version for you. And this is the output from DialogBlock:
----------------------- Configuration: MinGW Release -----------------------
In directory: H:\myProjects2\MarkThyBooks
mingw32-make.exe -f makefile.gcc CONFIG=release clean all
if exist MinGWRelease\*.o del MinGWRelease\*.o
if exist MinGWRelease\*.res del MinGWRelease\*.res
if exist MinGWRelease\MarkThyBooks.exe del MinGWRelease\MarkThyBooks.exe
g++.exe -c -o MinGWRelease/markthybooksapp.o -fno-rtti -fno-pcc-struct-return -fstrict-aliasing -Wall -D__WXMSW__ -D__GNUWIN32__ -D__WIN95__ -DUNICODE -O -Wall -I"H:/wxWidgets-2.8.4/include" -I"H:/wxWidgets-2.8.4/contrib/include" -I"H:/wxWidgets-2.8.4/lib/gcc_lib/mswu" markthybooksapp.cpp
*** In file included from H:/wxWidgets-2.8.4/include/wx/memory.h:16,
*** from H:/wxWidgets-2.8.4/include/wx/object.h:20,
*** from H:/wxWidgets-2.8.4/include/wx/wx.h:16,
*** from markthybooksapp.cpp:24:
*** H:/wxWidgets-2.8.4/include/wx/string.h:176:18: error: string: No such file or directory
*** In file included from H:/wxWidgets-2.8.4/include/wx/memory.h:16,
*** from H:/wxWidgets-2.8.4/include/wx/object.h:20,
*** from H:/wxWidgets-2.8.4/include/wx/wx.h:16,
*** from markthybooksapp.cpp:24:
*** H:/wxWidgets-2.8.4/include/wx/string.h:181: error: 'wstring' in namespace 'std' does not name a type
*** H:/wxWidgets-2.8.4/include/wx/string.h:714: error: expected ',' or '...' before '&' token
*** H:/wxWidgets-2.8.4/include/wx/string.h:714: error: ISO C++ forbids declaration of 'wxStdString' with no type
*** H:/wxWidgets-2.8.4/include/wx/string.h:714: error: 'wxString::wxString(int)' cannot be overloaded
*** H:/wxWidgets-2.8.4/include/wx/string.h:682: error: with 'wxString::wxString(int)'
*** H:/wxWidgets-2.8.4/include/wx/string.h: In constructor 'wxString::wxString(int)':
*** H:/wxWidgets-2.8.4/include/wx/string.h:715: error: 's' was not declared in this scope
*** In file included from H:/wxWidgets-2.8.4/include/wx/wx.h:21,
*** from markthybooksapp.cpp:24:
*** H:/wxWidgets-2.8.4/include/wx/hashmap.h: In member function 'wxLongToLongHashMap_wxImplementation_HashTable::Node** wxLongToLongHashMap_wxImplementation_HashTable::GetNodePtr(const long int&) const':
*** H:/wxWidgets-2.8.4/include/wx/hashmap.h:714: warning: dereferencing type-punned pointer will break strict-aliasing rules
*** In file included from H:/wxWidgets-2.8.4/include/wx/event.h:18,
*** from H:/wxWidgets-2.8.4/include/wx/wx.h:25,
*** from markthybooksapp.cpp:24:
*** H:/wxWidgets-2.8.4/include/wx/clntdata.h: In member function 'wxShadowObjectMethods_wxImplementation_HashTable::Node** wxShadowObjectMethods_wxImplementation_HashTable::GetNodePtr(const wxString&) const':
*** H:/wxWidgets-2.8.4/include/wx/clntdata.h:20: warning: dereferencing type-punned pointer will break strict-aliasing rules
*** H:/wxWidgets-2.8.4/include/wx/clntdata.h: In member function 'wxShadowObjectFields_wxImplementation_HashTable::Node** wxShadowObjectFields_wxImplementation_HashTable::GetNodePtr(const wxString&) const':
*** H:/wxWidgets-2.8.4/include/wx/clntdata.h:25: warning: dereferencing type-punned pointer will break strict-aliasing rules
*** In file included from H:/wxWidgets-2.8.4/include/wx/event.h:21,
*** from H:/wxWidgets-2.8.4/include/wx/wx.h:25,
*** from markthybooksapp.cpp:24:
*** H:/wxWidgets-2.8.4/include/wx/gdicmn.h: In member function 'wxStringToColourHashMap_wxImplementation_HashTable::Node** wxStringToColourHashMap_wxImplementation_HashTable::GetNodePtr(const wxString&) const':
*** H:/wxWidgets-2.8.4/include/wx/gdicmn.h:544: warning: dereferencing type-punned pointer will break strict-aliasing rules
*** In file included from H:/wxWidgets-2.8.4/include/wx/wx.h:45,
*** from markthybooksapp.cpp:24:
*** H:/wxWidgets-2.8.4/include/wx/image.h: In member function 'wxImageHistogramBase_wxImplementation_HashTable::Node** wxImageHistogramBase_wxImplementation_HashTable::GetNodePtr(const long unsigned int&) const':
*** H:/wxWidgets-2.8.4/include/wx/image.h:136: warning: dereferencing type-punned pointer will break strict-aliasing rules
*** mingw32-make.exe: *** [MinGWRelease/markthybooksapp.o] Error 1
Done.
8 errors, 5 warnings
dwmcqueen:
As far as I'm concerned, the most recent version I posted (gcc-4.2.0-tdm-2.7z) is as stable as the first. I applied no additional patches to the GCC source (or performed any other chages); the only difference between the first release and the second was some different command-line parameters during the build, to create (hopefully) faster compiler executables. So I would say you should use the second release (gcc-4.2.0-tdm-2.7z). Additionally...
patlecat:
I'm unable to reproduce the problem, and have never encountered a similar one. I recommend you check your Windows environment variables to make sure that no strange GCC-related ones are messing things up -- all you should have is "H:\MinGW\bin" (or wherever you chose to put it) in your PATH variable -- and completely clean out your MinGW directory, reinstalling from scratch. As always, install my GCC 4.2.0 package last and overwrite any duplicated files.
In case you're interested, here is the source I used to try to duplicate it:
#include <wx/wx.h>
int main()
{
return 0;
}
... and here is the command line:
g++.exe -c -o test.o -fno-rtti -fno-pcc-struct-return -fstrict-aliasing -Wall -D__WXMSW__ -D__GNUWIN32__ -D__WIN95__ -DUNICODE -O -Wall -I"G:\Libraries\wxMSW-2.8.4\include" -I"G:\Libraries\wxMSW-2.8.4\lib\gcc_dll\mswu" test.cpp
Cheers,
John E. / TDM
Something definitely changed with tdm-2, because when I put it over my tdm-1 installation I too started getting missing includes when compiling from another drive:
C:\>cat dummy.c
#include <stdlib.h>
int main(int argc, char* argv[])
{
char* c = malloc(10);
free(c);
}
C:\>gcc dummy.c
C:\>copy dummy.c h:\dev\WORK
1 file(s) copied.
C:\>h:
H:\dev\WORK>gcc dummy.c
dummy.c:1:20: error: stdlib.h: No such file or directory
dummy.c: In function 'main':
dummy.c:5: warning: incompatible implicit declaration of built-in function 'malloc'
edit: The above is a cc1.exe issue, because if I install TDM-2 and replace the cc1.exe with the one from TDM-1, it works again.
I should also say that with TDM-1 I was getting some annoying message box sometime since cc1.exe or the driver tried to access a volume (my CDROM) which had no disc. Cancelling the msgbox would allow the compilation to continue, but in the end I simply put a CD or DVD in to get rid of it. Never really tried to debug the issue. I assume this has to do with the "relocatable installation directory" modifications.
patlecat:
I'm unable to reproduce the problem, and have never encountered a similar one. I recommend you check your Windows environment variables to make sure that no strange GCC-related ones are messing things up -- all you should have is "H:\MinGW\bin" (or wherever you chose to put it) in your PATH variable -- and completely clean out your MinGW directory, reinstalling from scratch. As always, install my GCC 4.2.0 package last and overwrite any duplicated files.
In case you're interested, here is the source I used to try to duplicate it:
#include <wx/wx.h>
int main()
{
return 0;
}
... and here is the command line:
g++.exe -c -o test.o -fno-rtti -fno-pcc-struct-return -fstrict-aliasing -Wall -D__WXMSW__ -D__GNUWIN32__ -D__WIN95__ -DUNICODE -O -Wall -I"G:\Libraries\wxMSW-2.8.4\include" -I"G:\Libraries\wxMSW-2.8.4\lib\gcc_dll\mswu" test.cpp
Cheers,
John E. / TDM
I receive similar errors when using gcc 4.2.0 (thanks for providing it, by the way) to build wxWidgets 2.8.4, and I'm wondering if it's because of the include directories that it's looking in (since it can't find <string>):
C:\MinGW\libexec\gcc\mingw32\4.2.0>cc1plus -v
ignoring nonexistent directory "i:/MinGW/include/c++/4.2.0"
ignoring nonexistent directory "i:/MinGW/include/c++/4.2.0/mingw32"
ignoring nonexistent directory "i:/MinGW/include/c++/4.2.0/backward"
ignoring nonexistent directory "i:/MinGW/include"
ignoring nonexistent directory "i:/MinGW/lib/gcc/mingw32/4.2.0/include"
ignoring nonexistent directory "i:/MinGW/mingw32/include"
#include "..." search starts here:
#include <...> search starts here:
/mingw/include
/mingw/include
End of search list.
Here's the difference in plain text, tdm-1 first, tdm-2 second:
C:\MinGW\libexec\gcc\mingw32\4.2.0>cc1.exe -v
ignoring nonexistent directory "/extra/crossgcc/win-gcc/include"
ignoring nonexistent directory "/extra/crossgcc/win-gcc/include"
ignoring nonexistent directory "/extra/crossgcc/win-gcc/lib/gcc/mingw32/4.2.0/include"
ignoring nonexistent directory "/extra/crossgcc/win-gcc/mingw32/include"
#include "..." search starts here:
#include <...> search starts here:
/mingw/include
End of search list.
C:\MinGW\libexec\gcc\mingw32\4.2.0>cc1.exe -v
ignoring nonexistent directory "i:/MinGW/include"
ignoring nonexistent directory "i:/MinGW/lib/gcc/mingw32/4.2.0/include"
ignoring nonexistent directory "i:/MinGW/mingw32/include"
#include "..." search starts here:
#include <...> search starts here:
/mingw/include
/mingw/include
End of search list.
Since I have my installation in c:/mingw anyhow, I simply hex-edited cc1.exe and cc1plus.exe and changed "i:/MinGW" to "c:/MinGW", which seems to have solved the problem. I guess a "subst I: C:\" would work too, if you don't mind the extra mapping and if I: is available.
Great work, TDM, btw.
I got 4.2 to work, but is requires the following (for a simple hello world using iostreams):
C:\tmp>g++ -IC:\mingw\lib\gcc\mingw32\4.2.0\include -IC:\mingw\include\c++\4.2.0
-LC:\mingw\lib\gcc\mingw32\4.2.0 -IC:\mingw\include\c++\4.2.0\mingw32 -ofoo foo
.cpp
Why the need for the include / lib paths? I'm pretty sure gcc 3.4.5 could find those dirs by itself.
Also the resulting exe is ~1.7MB. I assuming this is because everything is linked in statically?
Stripping makes it 500KB. Still pretty big..
It does seem to complain about non existing dirs. Perhaps it is a vista issue?
C:\tmp>g++ -v -IC:\mingw\lib\gcc\mingw32\4.2.0\include -IC:\mingw\include\c++\4.
2.0 -LC:\mingw\lib\gcc\mingw32\4.2.0 -IC:\mingw\include\c++\4.2.0\mingw32 -ofoo
foo.cpp
Using built-in specs.
Target: mingw32
Configured with: ../gcc-4.2.0/configure --prefix=/extra/crossgcc/win-gcc --build
=i686-pc-linux-gnu --host=mingw32 --target=mingw32 --enable-languages=c,c++ --wi
th-as=/extra/crossgcc/cross-gcc/bin/mingw32-as --with-ld=/extra/crossgcc/cross-g
cc/bin/mingw32-ld --disable-shared --with-gcc --with-gnu-as --with-gnu-ld --disa
ble-debug --disable-nls --enable-threads=win32 --disable-win32-registry --enable
-sjlj-exceptions --enable-fully-dynamic-string --disable-libstdcxx-pch --with-mt
une=i686 --enable-libgomp
Thread model: win32
gcc version 4.2.0
cc1plus -quiet -v -IC:\mingw\lib\gcc\mingw32\4.2.0\include -IC:\mingw\include\c
++\4.2.0 -IC:\mingw\include\c++\4.2.0\mingw32 -iprefix c:\tmp\../lib/gcc/mingw32
/4.2.0/ foo.cpp -quiet -dumpbase foo.cpp -mtune=i386 -auxbase foo -version -o ./
ccfAj9ge.s
ignoring nonexistent directory "c:/tmp/../lib/gcc/mingw32/4.2.0/../../../../incl
ude/c++/4.2.0"
ignoring nonexistent directory "c:/tmp/../lib/gcc/mingw32/4.2.0/../../../../incl
ude/c++/4.2.0/mingw32"
ignoring nonexistent directory "c:/tmp/../lib/gcc/mingw32/4.2.0/../../../../incl
ude/c++/4.2.0/backward"
ignoring nonexistent directory "c:/tmp/../lib/gcc/mingw32/4.2.0/../../../../incl
ude"
ignoring nonexistent directory "c:/tmp/../lib/gcc/mingw32/4.2.0/include"
ignoring nonexistent directory "c:/tmp/../lib/gcc/mingw32/4.2.0/../../../../ming
w32/include"
ignoring nonexistent directory "/extra/crossgcc/win-gcc/include/c++/4.2.0"
ignoring nonexistent directory "/extra/crossgcc/win-gcc/include/c++/4.2.0/mingw3
2"
ignoring nonexistent directory "/extra/crossgcc/win-gcc/include/c++/4.2.0/backwa
rd"
ignoring nonexistent directory "/extra/crossgcc/win-gcc/include"
ignoring nonexistent directory "/extra/crossgcc/win-gcc/include"
ignoring nonexistent directory "/extra/crossgcc/win-gcc/lib/gcc/mingw32/4.2.0/in
clude"
ignoring nonexistent directory "/extra/crossgcc/win-gcc/mingw32/include"
#include "..." search starts here:
#include <...> search starts here:
C:/mingw/lib/gcc/mingw32/4.2.0/include
C:/mingw/include/c++/4.2.0
C:/mingw/include/c++/4.2.0/mingw32
/mingw/include
End of search list.
GNU C++ version 4.2.0 (mingw32)
compiled by GNU C version 4.2.0.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 18066f79fca492234e5b690bbee1824d
as -o ./cc4T7CrJ.o ./ccfAj9ge.s
ld -Bdynamic -ofoo.exe /mingw/lib/crt2.o -LC:\mingw\lib\gcc\mingw32\4.2.0 -L/mi
ngw/lib ./cc4T7CrJ.o -lstdc++ -lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt -lus
er32 -lkernel32 -ladvapi32 -lshell32 -lmingw32 -lgcc -lmoldname -lmingwex -lmsvc
rt
It is clean install using mingw-runtime-3.12.tar.gz, w32api-3.9.tar.gz, binutils-2.17.50-20070129-1.tar.gz, mingw-utils-0.3.tar.gz and gcc-4.2.0-tdm-3-omp.7z.
Thank you. I aplogize for the newbishness, I am trying to get a working mingw setup on vista, and am makin gsure I can compile known-good testcases before I really dig in.
here is the compileline I used (after doing one with clean attached):
mingw32-make -f makefile.gcc MONOLITHIC=1 SHARED=1 UNICODE=1 BUILD=release > errorlog.txt
the contents of the log reads:
gcc -c -o gcc_mswudll\wxregex_regcomp.o -O2 -mthreads -DHAVE_W32API_H -I..\..\include -I..\..\lib\gcc_dll\mswu -D__WXMSW__ -D_UNICODE -MTgcc_mswudll\wxregex_regcomp.o -MFgcc_mswudll\wxregex_regcomp.o.d -MD ../../src/regex/regcomp.c
I am using only the packages you suggest on your site, as linked through your signature (for example I am using the 20060824-1 binutils, not the newer one).
Thanks
I should've seen that coming. New variable CPLUS_INCLUDE_PATH, same value as C_INCLUDE_PATH. (In case you're interested, I'm getting these from http://gcc.gnu.org/onlinedocs/gcc-4.2.0/gcc/Environment-Variables.html.)
Also, here's a little experiment I thought up that will help me understand a bit better how GCC is working under Vista. If you could try it out and post your results, I'd appreciate it.
1. Remove all GCC/MinGW related environment variables, including any PATH entries.
2. Rename the base folder of your current MinGW installation to something like "testmingw". The idea is to make sure "\MinGW" doesn't exist.
3. Create a new text file called "gcc.bat" which contains the following two lines:
@ECHO OFF
C:\testmingw\bin\gcc.exe %*
where C:\testmingw corresponds to wherever your MinGW installation is.
Save the file somewhere other than in your MinGW folder -- i.e. "C:\testbat\gcc.bat"
4. Add the location of gcc.bat to your PATH environment variable -- i.e. "<other stuff>;C:\testbat"
5. Create a simple test file called "test.cpp" somewhere with the following code:
#include <cstdio>
#include <string>
int main()
{
return 0;
}
6. Open up a command prompt and enter the following commands (assuming you saved test.cpp to C:\anothertestfolder):
C:
cd \anothertestfolder
gcc -v -c test.cpp
Post the output (feel free to use the redirection trick to get something that's easier to copy'n'paste, but use 1> instead of 2> if you do).
Edit:
D'oh. <cstdio>, not <cstdio.h>...
What I mean is that it did nothing. It simply does not appear to detect gcc and returns the same error it would as if it did not exist at all:
C:\>gcc -v -c testing.cpp 1> log.txt
'gcc' is not recognized as an internal or external command,
operable program or batch file.
wait backup... silly me I should have followed your filenames exactly, I now see that "gcc.bat" is important :P I named it something else. okay, it works.
1> creates a blank text file
2> creates this:
Using built-in specs.
Target: mingw32
Configured with: ../gcc-4.2.0/configure --prefix=/extra/crossgcc/win-gcc --build=i686-pc-linux-gnu --host=mingw32 --target=mingw32 --enable-languages=c,c++,fortran,objc,java --with-as=/extra/crossgcc/cross-gcc/bin/mingw32-as --with-ld=/extra/crossgcc/cross-gcc/bin/mingw32-ld --with-gcj=/extra/crossgcc/cross-gcc/bin/mingw32-gcj --disable-shared --with-gcc --with-gnu-as --with-gnu-ld --disable-debug --disable-nls --enable-threads=win32 --disable-win32-registry --enable-sjlj-exceptions --enable-fully-dynamic-string --disable-libstdcxx-pch --with-mtune=i686 --enable-libgomp --with-gmp=/extra/crossgcc/win-gmp-install --with-mpfr=/extra/crossgcc/win-mpfr-install --enable-libgcj --without-x --disable-java-awt
Thread model: win32
gcc version 4.2.0
cc1plus -quiet -v -iprefix c:\testmingw\bin\../lib/gcc/mingw32/4.2.0/ testing.cpp -quiet -dumpbase testing.cpp -mtune=i386 -auxbase testing -version -o ./ccF2DNa1.s
gcc.exe: CreateProcess: No such file or directory
without using either 1> or 2>:
C:\>gcc -v -c test.cpp
Using built-in specs.
Target: mingw32
Configured with: ../gcc-4.2.0/configure --prefix=/extra/crossgcc/win-gcc --build=i686-pc-linux-gnu -
-host=mingw32 --target=mingw32 --enable-languages=c,c++,fortran,objc,java --with-as=/extra/crossgcc/
cross-gcc/bin/mingw32-as --with-ld=/extra/crossgcc/cross-gcc/bin/mingw32-ld --with-gcj=/extra/crossg
cc/cross-gcc/bin/mingw32-gcj --disable-shared --with-gcc --with-gnu-as --with-gnu-ld --disable-debug
--disable-nls --enable-threads=win32 --disable-win32-registry --enable-sjlj-exceptions --enable-ful
ly-dynamic-string --disable-libstdcxx-pch --with-mtune=i686 --enable-libgomp --with-gmp=/extra/cross
gcc/win-gmp-install --with-mpfr=/extra/crossgcc/win-mpfr-install --enable-libgcj --without-x --disab
le-java-awt
Thread model: win32
gcc version 4.2.0
cc1plus -quiet -v -iprefix c:\testmingw\bin\../lib/gcc/mingw32/4.2.0/ test.cpp -quiet -dumpbase tes
t.cpp -mtune=i386 -auxbase test -version -o ./ccKV7mkz.s
gcc.exe: CreateProcess: No such file or directory
C:\>
and your following request...
C:\>echo %PATH%
C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files\QuickTime\QTSystem\;C:\Pyth
on25\;C:\testbat\
hi i was having problems with netbeans too, but i finally worked it out.
i had to modify the file libgomp.spec in the lib directory so it looks like this:
# This spec file is read by gcc when linking. It is used to specify the
# standard libraries we need in order to link
with -fopenmp.
*link_gomp: -lgomp -lpthread
then i modified the file Makefile-Debug.mk (you should also modify Makefile-Release.mk if using that target; this file are
located in your project's "nbproject" directory)
adding "-fopenmp" (without quotes) to the CCFLAGS, CXXFLAGS, CFLAGS and LDLIBSOPTIONS lines. Maybe not
all of them are necessary but it works and it doesn't hurts xD you could figure out which one's are useless anyway.
sorry for posting info about other ide >_<