Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22024

How to use the -MG flag in cc 4.4.1?

$
0
0

I've recently upgraded my Ubuntu installation from Jaunty to Karmic. This apparently includes an update of the GNU C compiler, because code that compiled previously no longer does.

Running cc 4.4.1 (Ubuntu 4.4.1-4ubuntu8) now produces the following error, on code that worked fine in the cc 4.3.3 (Ubuntu 4.3.3-5ubuntu4):

$ makecc -c -MMD -MG -MP -MF lex.d -g -Wall -O -o lex.o lex.ccc1: error: -MG may only be used with -M or -MM

Adding either the -M or -MM flag resulted in the following message:

[...]flex -o lex.c lex.lcc -c -MM -MG -MP -MF lex.d -g -Wall -O -o lex.o lex.c[...]cc -g -Wall -O -o translate lex.o grammar.tab.o main.o list.o salloc.o suffixed.o expr.o emit.o optimize.o -lfllex.o: file not recognized: File truncatedcollect2: ld returned 1 exit statusmake: *** [translate] Error 1

I've been told that the various -Mx tell flags make how the various c files depend on .h files.My best fix so far is to tell make explicitly that all .c files depend on all .h files, to make sure everything stays up to date.However, this does induce a lot of unnecessary work at compile time.

My question therefore is: How do I need to adjust the flags for cc to have it handle dependencies automatically again?


Viewing all articles
Browse latest Browse all 22024

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>