Author Topic: How to suppress warnings from 3rd party include files using -isystem  (Read 3305 times)

Offline flyingllama

  • Single posting newcomer
  • *
  • Posts: 2
General Goal: How to suppress warnings from 3rd party include files so that the only warnings I see in the build log are from my own code.

Specific Question: How can I change Code Blocks' instruction to the compiler from

-I"C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include"

to

-isystem"C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include"

Background: I'm trying to teach myself programming and specifically how to use DirectX, and I'm getting annoyed with all the warnings I'm getting from DirectX files that I don't care about. I still want to know about warnings from my own code so -w isn't a solution. After looking around a bit I think either the -isystem or just -i commands may be what I'm looking for, and my understanding is that either of them would be used in place of the -I command.

This is what is currently in Code Blocks' build log when I build my project (-w added to remove warning spam):

mingw32-g++.exe  -w -Wfatal-errors    -I"C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include"  -c "C:\Users\Stephen\Programming Projects\Create Surface\main.cpp" -o obj\Debug\main.o
mingw32-g++.exe -L"C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Lib\x86"  -o "bin\Debug\Create Surface.exe" obj\Debug\main.o    -ld3d9 -ld3dx9  -mwindows
Output size is 945.82 KB


What I want to do is change that -I to -isystem. Is there any way to do that? If not, is there some other way to get rid of the warning spam?

Offline scarphin

  • Lives here!
  • ****
  • Posts: 644
Re: How to suppress warnings from 3rd party include files using -isystem
« Reply #1 on: January 28, 2015, 11:46:56 am »
Remove the entry 'C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include' from 'Project -> Build options -> Search Directories -> Compiler' and add '-isystem"C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include"' to 'Project -> Build options -> Compiler settings -> Other options'. Be sure to select the correct target on the tree at the left.

Offline flyingllama

  • Single posting newcomer
  • *
  • Posts: 2
Re: How to suppress warnings from 3rd party include files using -isystem
« Reply #2 on: January 28, 2015, 06:16:38 pm »
It worked great, thanks so much!