Do C/C++ compilers search the whole build folder for include files?
Just started trying to port some Wiznet code for RP2040...
It seems the main program includes files that are buried deep in a folder tree.
FlexProp doesn't seem to look outside the main folder.
Do other compilers search inside all subfolders in the build folder by default?
Or, maybe I need to include the build folder as a library folder?
Just trying to figure out the best approach...
I typically just put everything in the build folder, but maybe better to have drivers in subfolders?
Comments
No, including a file from a subdirectory requires specifying it (
#include "folder/something.h"
). Though perhaps the makefile or whatever you got for it adds some of these onto the include path through the command line arguments.Ok, there is a makefile. That must be how they do it.
Can makefile work with FlexC ?
It that I’d do it, just curious …
Mayhaps. If you set CC=flexcc...
Shouldn't '[ -L or -I ] add a directory to the include path' do that?
Is from: https://github.com/totalspectrum/spin2cpp/blob/master/Flexspin.md
Generally this is true, but all such behavior is implementation-defined, so best not to rely too heavily on it.