Thread: Make problem

  1. #1
    Registered User
    Join Date
    Mar 2005
    Posts
    28

    Unhappy Make problem

    I'm trying to wrestle my C tools into compiling the Gaim source code on Windoze with little luck. I'm using the MingW version that came with Dev-C++ 4.9.9.2; until now I've never used a command line compiler. At any rate, I managed to get make to accept the makefile and start working on it, and it then gave me a whole slew of errors like this one:
    Code:
    gcc.exe: installation problem, cannot exec `cc1': No such file or directory
    C:\DEV-CPP\BIN\MAKE.EXE: *** [win32/win32dep.o] Error 1
    So what is cc1 and why is it trying to execute it? I see no reference to a "cc1" in the makefile, and indeed, the error seems to be gcc's fault. What's up?
    Last edited by Orborde; 06-26-2005 at 01:08 AM. Reason: fix error order

  2. #2
    Registered User
    Join Date
    Jun 2005
    Posts
    6,815
    cc1 is one of the programs used by gcc. The way the gcc command works is that it is really a small driver program, which runs other programs to do various things (eg preprocessing, compilation after preprocessing, linking, etc). cc1 is one of those backend programs: I'm not sure which offhand, but suspect it is actually the compiler itself (which gets executed after the preprocessor).

    If you have installed Dev-C++ correctly, make should be able to find gcc, and that will (in turn) be able to find the programs it needs. Either the program wasn't successfully installed, or some system setting (eg the path, some environment variable that identifies location of headers or libraries) is not set up correctly. The installation instructions with dev-c++ should give you information on what the correct settings are.

  3. #3
    Registered User
    Join Date
    Mar 2005
    Posts
    28
    Mmkay...I see what you're saying...
    However, I still have a problem.
    I did the following:
    Code:
    C:\Dev-Cpp\bin>gcc -print-prog-name=cc1
    C:/DEV-CPP/BIN/../libexec/gcc/mingw32/3.4.2/cc1.exe
    That file exists.

    So, I went to the Makefile and replaced
    Code:
    %.o: %.c
    	$(CC) $(CFLAGS) $(INCLUDE_PATHS) $(DEFINES) -c $< -o $@
    with
    Code:
    %.o: %.c
    	$(CC) -print-prog-name=cc1
    . This is what I got in the make output:
    Code:
    gcc.exe -print-prog-name=cc1
    cc1
    It appears that make is overriding gcc's path information and causing failure. How can I fix this?

  4. #4
    Registered User
    Join Date
    Jun 2005
    Posts
    6,815
    Now I'm not sure.

    make does not tend to specifically override settings like path, although settings in your Makefile might.

    Things to check;
    1) Settings in your makefile (eg path, the setting of CC, etc)
    2) Use forward slashes rather than backslashes in paths in the makefile
    3) Installation of dev-cpp, as I've already suggested.
    4) Installation of make
    5) Setting of environment variables that may confuse make or gcc. You will find info on environment variables that affect program behaviour in relevant documentation with those programs.

    It is possible, if you have another development environment or multiple versions of the programs installed, that you are invoking a different version of make than you think you are.

  5. #5
    Registered User
    Join Date
    Mar 2005
    Posts
    28
    Okay, I'll go through the list:
    1) Settings in your makefile (eg path, the setting of CC, etc)
    Code:
    CC = gcc.exe
    2) Use forward slashes rather than backslashes in paths in the makefile
    -Tried it; no cigar as far as I can tell
    3) Installation of dev-cpp, as I've already suggested.
    -I don't really know where to look
    4) Installation of make
    -Again, I don't know where to look
    5) Setting of environment variables that may confuse make or gcc. You will find info on environment variables that affect program behaviour in relevant documentation with those programs.
    -As of yet, I don't know where to look there, either.


    I'm sitting here looking at the make manual and the gcc manual and being confused, mostly.

    It is possible, if you have another development environment or multiple versions of the programs installed, that you are invoking a different version of make than you think you are.
    Checked that. I only have one make.exe on my entire system, and anyways, I'm running it within its own folder, as I haven't bothered to make it a console command.

    I did pipe make's output to a file, though, and this is what I got:
    Code:
    C:\DEV-CPP\BIN\MAKE.EXE: Entering directory `C:/Dev-Cpp/projects/gaim/gaim-1.3.0/src'
    gcc.exe  -O2 -Wall -mno-cygwin -mms-bitfields -I. -I.\win32 -I.\win32\mingw_plus -I..\src\win32\IdleTracker -I.. -I..\..\win32-dev/gtk_2_0\include -I..\..\win32-dev/gtk_2_0\include\gtk-2.0 -I..\..\win32-dev/gtk_2_0\include\glib-2.0 -I..\..\win32-dev/gtk_2_0\include\pango-1.0 -I..\..\win32-dev/gtk_2_0\include\atk-1.0 -I..\..\win32-dev/gtk_2_0\lib\glib-2.0\include -I..\..\win32-dev/gtk_2_0\lib\gtk-2.0\include -I..\..\win32-dev/aspell-dev-0-50-3-3\include -I..\..\win32-dev/gtkspell-2.0.6 -I..\..\win32-dev\nss-3.9\include -I..\..\win32-dev\nspr-4.4.1\include  -DVERSION=\"\" -DHAVE_CONFIG_H -c account.c -o account.o
    C:\DEV-CPP\BIN\MAKE.EXE: Leaving directory `C:/Dev-Cpp/projects/gaim/gaim-1.3.0/src'
    Starting with the second line, I cut out all the -I arguments except the first one (the Windoze DOS prompt refused to paste them all...) and compiled a test file without problem from the command line.

    I thought of a possible problem, though. What if make is entering the target directory (as seen in the first line), calling gcc from there, and then somehow gcc uses that folder as the start location for its tools search? It does seem to be using the path
    Code:
    ../libexec/gcc/mingw32/3.4.2/cc1.exe
    as its search path...

  6. #6
    Registered User
    Join Date
    Mar 2005
    Posts
    28
    Another question: How do I modify environment variables, assuming there are any on Windoze?

  7. #7
    Registered User
    Join Date
    Mar 2005
    Posts
    28
    Hm...problem "solved" with
    Code:
    $(CC) -BC:\Dev-Cpp\libexec\gcc\mingw32\3.4.2 $(CFLAGS) $(INCLUDE_PATHS) $(DEFINES) -c $< -o $@
    (bolded bit was just inserted).

    So now I have a slew of compiler-generated errors to deal with instead. Ah, the joys of compiler wrestling!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compile problem on linux
    By cnb in forum C Programming
    Replies: 3
    Last Post: 09-29-2008, 04:14 AM
  2. Problem with passing structs to a function.
    By darsh1120 in forum C Programming
    Replies: 7
    Last Post: 03-11-2008, 04:36 AM
  3. Input File HELP, weird problem
    By gravity-1 in forum C++ Programming
    Replies: 5
    Last Post: 03-29-2005, 08:43 PM
  4. Question about atheists
    By gcn_zelda in forum A Brief History of Cprogramming.com
    Replies: 160
    Last Post: 08-11-2003, 11:50 AM
  5. 'functions' in make?
    By mart_man00 in forum C Programming
    Replies: 1
    Last Post: 06-21-2003, 02:16 PM