User forums > General (but related to Code::Blocks)

TDM's unofficial GCC 4.2.0 for MinGW (now with OpenMP, Fortran and Obj-C)

<< < (10/22) > >>

eloj:
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:


--- Code: ---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'

--- End code ---

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.

Zoinky:

--- Quote from: TDragon on June 28, 2007, 07:50:36 pm ---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:

--- Code: ---#include <wx/wx.h>

int main()
{
return 0;
}

--- End code ---
... and here is the command line:

--- Code: ---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
--- End code ---

Cheers,
John E. / TDM

--- End quote ---

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>):


--- Code: ---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.
--- End code ---

nenin:
Problems with cc1.exe and cc1plus.exe from tdm-2 confirmed. They can not find standard "include" path.

eloj:
Here's the difference in plain text, tdm-1 first, tdm-2 second:


--- Code: ---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.
--- End code ---

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.

nenin:
eloj, it work. I also have mingw in c:/mingw, and correction of cc1 and cc1plus resolve problem, at least on simple project.  :D

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version