Community
Participate
Working Groups
Build Identifier: 20100917-0705 Every executable project in debug configuration with gcc 4.5.1 (both C and C++) generates the following error: cc1: error: to generate dependencies you must specify either -M or -MM Reproducible: Always Steps to Reproduce: 1. New->Project->C Project 2. then choose Executable->Hello World C Project 3. then Build Configuration -> Build Selected -> Debug
I can't reproduce this, what is the command generated? I copied the command from the Console view and tried it outside of Eclipse and it also worked: ~/workspace/hello/Debug$ ~/gcc-4.5.1-build/bin/gcc -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/hello.d" -MT"src/hello.d" -o"src/hello.o" "../src/hello.c" then ~/workspace/hello/Debug$ ~/gcc-4.5.1-build/bin/gcc -o"hello" ./src/hello.o am I doing something wrong?
That's my console output: **** Build of configuration Debug for project Hello **** make all Building file: ../src/Hello.cpp Invoking: GCC C++ Compiler g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/Hello.d" -MT"src/Hello.d" -o"src/Hello.o" "../src/Hello.cpp" cc1plus: error: to generate dependencies you must specify either -M or -MM make: *** [src/Hello.o] Errore 1 and it's the same with C compiler in place of g++. You can also take a look at the following discussion: http://www.eclipse.org/forums/index.php?t=msg&th=199435&start=0&S=0d1c0aaf6c3cb4fb0a53c382086a5c62 What's your gcc version? This error happened to me when I started using 4.5.1 version.
(In reply to comment #2) > What's your gcc version? This error happened to me when I started using 4.5.1 > version. I compiled gcc 4.5.1 from source and also tried the gcc-4.5 package in Ubuntu 10.10 and I removed gcc-4.4 to make sure it's not using it. How did you get yours?
My distribution is Fedora 14 x86_64 and that's my gcc version: $ gcc --version gcc (GCC) 4.5.1 20100924 (Red Hat 4.5.1-4) Copyright (C) 2010 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Let me know if you need to know something else.
There was a change recently where space has been added to options like [-MF "src/Hello.d"]. Not sure if it applies here though. Marc, are you using CDT from HEAD?
I was testing with 8.0.0.201011161204 but I just tried 7.0.1 and it still works on Ubuntu. I will test on Fedora tonight.
I can't reproduce this on Fedora 14 i686 and Fedora 14 x86_64. Can you try this in command line? g++ -MMD Hello.cpp and if this works, the full command line g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/Hello.d" -MT"src/Hello.d" -o"src/Hello.o" "../src/Hello.cpp" in your project/Debug folder? Here's what I have: Linux fedora 2.6.35.6-48.fc14.x86_64 gcc (GCC) 4.5.1 20100924 (Red Hat 4.5.1-4). make 3.82-3.fc14 Eclipse IDE for C/C++ Linux Developers (CDT 7.0.1) with -XX:-UseCompressedOops workaround found here https://bugzilla.redhat.com/show_bug.cgi?id=647737#c31 and I also tried the package eclipse-cdt-1:7.0.1-2.fc14 (x86_64)
(In reply to comment #7) I tried both your request and the first works but the second keeps throwing the same error. Here some additional info about my system: make-3.82-3.fc14.x86_64 and I tried both "original eclipse helios" and the eclipse built for fedora. Let me know if you need to know something more-
I am also having the same problem on Fedora 14 64bit... g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/SPcap.d" -MT"src/SPcap.d" -o"src/SPcap.o" "../src/SPcap.cpp" cc1plus: error: to generate dependencies you must specify either -M or -MM
Having the same problem with gcc 4.5.1 under Fedora 14 > gcc --version gcc (GCC) 4.5.1 20100924 (Red Hat 4.5.1-4) I can confirm, that some blanks should fix the problem: > g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/CppHelloWorld.d" -MT"src/CppHelloWorld.d" -o"src/CppHelloWorld.o" "../src/CppHelloWorld.cpp" cc1plus: error: to generate dependencies you must specify either -M or -MM whereas > g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF "src/CppHelloWorld.d" -MT "src/CppHelloWorld.d" -o"src/CppHelloWorld.o" "../src/CppHelloWorld.cpp" works. (Note, that following gcc's initial message by adding either -M or -MM leads to an empty object file.)
Apparently there is something wrong with ccache. If you disable ccache (add CCACHE_DISABLE=1 environment variable to eclipse project settings or run 'export CCACHE_DISABLE=1 in bash and then run make all in the Debug directory), you won't see this error.
Fixed in ccache 3.1.3: https://bugzilla.redhat.com/show_bug.cgi?id=657857 https://bugzilla.samba.org/show_bug.cgi?id=7827
(In reply to comment #12) > Fixed in ccache 3.1.3: Closing this bug then. Note that recent CDT 8.0 builds do not have this problem because now spaces are added to options, see bug 232373.