steinbergmedia / vst3sdk

VST 3 Plug-In SDK
Other
1.63k stars 162 forks source link

Invalid include paths #15

Closed lmdsp closed 6 years ago

lmdsp commented 6 years ago

Many files have includes which cause build errors if additional include paths are not defined / amalgamated builds.

For example in plugininterfaces/base/funknown.h:

#include "pluginterfaces/base/fplatform.h"
#include "pluginterfaces/base/ftypes.h"
#include "pluginterfaces/base/smartpointer.h"

There is no need to repeat the "pluginterfaces/base part as they're in the same folder !

This works fine:

#include "fplatform.h"
#include "ftypes.h"
#include "smartpointer.h"
ygrabit commented 6 years ago

This is the way we choose some years ago...this will be not changed... root is defined as include path.

lmdsp commented 6 years ago

@ygrabit That's a pity, it seems overly complicated and error prone to reference an include from the same folder by going up to root and then down again. Also needs a lot more typing whenever files are moved around .. Just my 2 cents

aclex commented 6 years ago

@ygrabit @lmdsp I'm actually not so critical on the existing approach, it even looks less problematic and confusing to me, considering namespace features of C++. Filesystem structure usually reflects the namespace hierarchy in the code, so it's quite often, that you have some types of usual name (e.g. device or buffer) here and there in different namespaces in the corresponding files, and only more qualified names allow one to avoid collisions. Generally, the more relative includes are, the more they depend on the include path of the compiler. I agree, that there's no problem with relative includes in the same directory, but, in my opinion, existing includes look equally neat.