Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » How to remove the options of "-MMD -MP -MF" of C++ complier
How to remove the options of "-MMD -MP -MF" of C++ complier [message #175459] Fri, 25 August 2006 01:46 Go to next message
Eclipse UserFriend
Originally posted by: lserlohn.163.com

I use Eclipse with CDT 3.0 to build my project for Embeded System of ARM,
which is C++ program.

But some option such as "-MMD -MP -MF" are not support by
ARM-cross-complier,so every time I uses:

arm-linux-g++ -O0 -g3 -Wall -MMD -MP -MF"main.d" -MT"main.d" -o"main.o"
"../main.cpp"

there always shows errors:
arm-linux-g++: unrecognized option `-MP'
arm-linux-g++: unrecognized option `-MFmain.d'
arm-linux-g++: unrecognized option `-MTmain.d'

I want to delete these options, but I don't know how to. I don't see these
options in project properties.I edited subdir.mk, but nothing changed.
What should I do?

Thanks
Re: How to remove the options of "-MMD -MP -MF" of C++ complier [message #197111 is a reply to message #175459] Sat, 14 July 2007 01:01 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: gridtest.gmail.com

Has anyone come up with a solution to this type of problem yet? I must
use an older toolchain for an embedded project and get the same type of
errors.


lserlohn wrote:
> I use Eclipse with CDT 3.0 to build my project for Embeded System of
> ARM, which is C++ program.
>
> But some option such as "-MMD -MP -MF" are not support by
> ARM-cross-complier,so every time I uses:
>
> arm-linux-g++ -O0 -g3 -Wall -MMD -MP -MF"main.d" -MT"main.d" -o"main.o"
> "../main.cpp"
>
> there always shows errors:
> arm-linux-g++: unrecognized option `-MP'
> arm-linux-g++: unrecognized option `-MFmain.d'
> arm-linux-g++: unrecognized option `-MTmain.d'
>
> I want to delete these options, but I don't know how to. I don't see
> these options in project properties.I edited subdir.mk, but nothing
> changed. What should I do?
>
> Thanks
>
>
Re: How to remove the options of "-MMD -MP -MF" of C++ complier [message #197324 is a reply to message #197111] Mon, 16 July 2007 09:36 Go to previous messageGo to next message
Jens Seidel is currently offline Jens SeidelFriend
Messages: 88
Registered: July 2009
Member
djanovy wrote:

> Has anyone come up with a solution to this type of problem yet? I must
> use an older toolchain for an embedded project and get the same type of
> errors.
>
> lserlohn wrote:
>> But some option such as "-MMD -MP -MF" are not support by
>> ARM-cross-complier,so every time I uses:

Why don't you write a small wrapper script which just ignores "-MMD -MP -MF"
and passes all other arguments to the compiler?

Something similar to the following should work (maybe with $* instead of
$@ ...)

#!/bin/bash
arm-g++ $(echo "$@" | sed -e s/-MMD//g -e s/-MP//g)
Re: How to remove the options of "-MMD -MP -MF" of C++ complier [message #197407 is a reply to message #175459] Mon, 16 July 2007 14:28 Go to previous messageGo to next message
Chris Recoskie is currently offline Chris RecoskieFriend
Messages: 163
Registered: July 2009
Senior Member
lserlohn wrote:
> I use Eclipse with CDT 3.0 to build my project for Embeded System of
> ARM, which is C++ program.
>
> But some option such as "-MMD -MP -MF" are not support by
> ARM-cross-complier,so every time I uses:
>
> arm-linux-g++ -O0 -g3 -Wall -MMD -MP -MF"main.d" -MT"main.d" -o"main.o"
> "../main.cpp"
>
> there always shows errors:
> arm-linux-g++: unrecognized option `-MP'
> arm-linux-g++: unrecognized option `-MFmain.d'
> arm-linux-g++: unrecognized option `-MTmain.d'
>
> I want to delete these options, but I don't know how to. I don't see
> these options in project properties.I edited subdir.mk, but nothing
> changed. What should I do?

These options are used to output dependency information to the .d file,
which is then included by the makefile in order to properly react to
changes in files that your source files are dependent upon. E.g., this
is how header dependencies are handled so that if you change a header
file, the source files that include it are recompiled.

The options (actually the entire command) are provided by the dependency
calculator class. To get rid of them you'd have to create your own GNU
toolchain that used a different dependency calculator of your own devising.

Alternatively, you could use the internal builder rather than the
generated makefile. This tracks dependencies via the index, so it
doesn't rely on compiler invocations.

===========================

Chris Recoskie
Team Lead, IBM CDT Team
IBM Toronto
http://www.eclipse.org/cdt
Re: How to remove the options of "-MMD -MP -MF" of C++ complier [message #197570 is a reply to message #197407] Tue, 17 July 2007 16:57 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dmc.danielchisholm.com

Chris Recoskie wrote:

>> But some option such as "-MMD -MP -MF" are not support by
>> ARM-cross-complier,so every time I uses:
>>
>> arm-linux-g++ -O0 -g3 -Wall -MMD -MP -MF"main.d" -MT"main.d" -o"main.o"
>> "../main.cpp"

Same thing here, but with g++ 2.8.1 on Solaris. Is my g++ too old to
recognize "-MMD" etc and generate dependency info?

> Alternatively, you could use the internal builder rather than the
> generated makefile. This tracks dependencies via the index, so it
> doesn't rely on compiler invocations.

(Sorry, total newbie to Eclipse here.... :-( Apologies in advance for an
RTFM question...)

How would I do that ("use the internal builder rather than the generated
makefile")? And would I even want to? (I'm trying to migrate a big C++
project currently under sniff/cvs, into Eclipse/CDT/ClearCase/Maven)

Thanks and best regards,

- Daniel
Fredericton, NB Canada
Re: How to remove the options of "-MMD -MP -MF" of C++ complier [message #197595 is a reply to message #197570] Tue, 17 July 2007 18:36 Go to previous message
Chris Recoskie is currently offline Chris RecoskieFriend
Messages: 163
Registered: July 2009
Senior Member
Daniel Chisholm wrote:
> Chris Recoskie wrote:
>
>>> But some option such as "-MMD -MP -MF" are not support by
>>> ARM-cross-complier,so every time I uses:
>>>
>>> arm-linux-g++ -O0 -g3 -Wall -MMD -MP -MF"main.d" -MT"main.d"
>>> -o"main.o" "../main.cpp"
>
> Same thing here, but with g++ 2.8.1 on Solaris. Is my g++ too old to
> recognize "-MMD" etc and generate dependency info?
>

Not sure. Check the man page?


>> Alternatively, you could use the internal builder rather than the
>> generated makefile. This tracks dependencies via the index, so it
>> doesn't rely on compiler invocations.
>
> (Sorry, total newbie to Eclipse here.... :-( Apologies in advance for
> an RTFM question...)
>
> How would I do that ("use the internal builder rather than the generated
> makefile")? And would I even want to? (I'm trying to migrate a big C++
> project currently under sniff/cvs, into Eclipse/CDT/ClearCase/Maven)
>
> Thanks and best regards,
>
> - Daniel
> Fredericton, NB Canada
>
>

If you select the project, you can view the properties on it with either
a right click or via the Project->Properties item. You can then go to
the C/C++ Build preferences and change the builder in the Builder
Settings Tab.

It's preferable to use the internal builder if you are able to do all
your builds inside Eclipse, because the internal builder is much faster
and scales much better. If you need to do command line builds at any
point though then you'll want the external builder with makefile
generation turned on.

===========================

Chris Recoskie
Team Lead, IBM CDT Team
IBM Toronto
http://www.eclipse.org/cdt
Previous Topic:Debugger will not stop at breakpoint
Next Topic:Compile only?
Goto Forum:
  


Current Time: Sat Apr 27 04:13:54 GMT 2024

Powered by FUDForum. Page generated in 0.03059 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top