Most compilers support some way of specifying a search path for #include files. For example, unix compilers (which include proprietary compilers from sun, sgi, etc etc as well as freely available compilers like gcc) accept a command line argument "-I" which allows specification of an include path.

For example, gcc -I ../SharedLib <other options> file will provide a means of achieving what you want. The difference is that the magic to make it happen will need to be in build scripts or makefiles, not in your source code.