In my project I am using a third-party lib which is included dynamically - i. e. via an import *.lib-file and an *.h-file. The *.h-file of the lib has an include guard. I #included
this file in one of my project headers, which starts from #pragma once
. The latter in its turn is also included in several *.cpp-files of my project.
Here is the scheme:
third-party lib include 'blah_blah.h'
#ifndef BLAH_BLAH_H
#define BLAH_BLAH_H
/* stuff here */
#endif
my project header 'my.h'
#pragma once
#include "blah_blah.h"
/* stuff here */
one of my cpp files
#include "my.h"
/* stuff here */
The problem is the following. Although there are neither errors nor warnings during compilation, I see that "blah_blah.h"
gets included several times - at least, the warnings, which are produced by its code, appear in the output window of Visual Studio 2017 about 5 times and the compilation lasts like forever. What can I do to avoid this?