Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
395 views
in Technique[技术] by (71.8m points)

c++ - Disable only warning D9024 (unrecognised file type; object file assumed)

I have an OS-agnostic makefile (ugh, I know) which supports both GNU and MSVC compilers (among others). It always generates .o object files when compiling, even when compiling for MSVC (which expects .obj files). This is not a major problem; cl issues warning

cl : Command line warning D9024 : unrecognized source file type '.o', object file assumed

and carries on, successfully compiling.

I'd like to remove this unsightly command line warning, and only this warning, but can't figure out any way to do it.

Arguments like IGNORE don't seem to suppress it, e.g. using

cl -IGNORE:D9024 ...

and techniques (like this one) to suppress warnings generated in-code don't apply for this command line warning.

Is there any way to suppress D9024?

Otherwise (and preferably), is there a way to tell MSVC that the provided .o files ARE object files, so that it needn't assume so?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Simplified by performing no linking with cl, instead explicitly invoking MSVC's link


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...