mardi 21 février 2017

How to hide warnings in compilation from external libraries

I have a main.cpp file which only has this code:

#include <iostream>
#include "include/rapi/RApi.h"

using namespace std;

int main() {
    std::cout << "Test\n";
    return 0;
}

When I compile, I want to see warnings from my code, but not from external included files. I have been able to achieve this in the past, but I might be missing something here in the compilation flags, as I keep on seing errors from the included header file, when I don't want to see them.

This is my compile command:

g++ -isystem include -pedantic -Wall -Wextra main.cpp -o main.o

I want to see warnings and errors from main.cpp, but not from files in the include folder.

I have tried -isysteminclude -isysteminclude/rapi, passing the -isystem to the end of the flags, but to no avail.

Am I missing something here?

Aucun commentaire:

Enregistrer un commentaire