Thank you very much, Timo, for taking your time to develop an example:
I tried to recreate your workspace structure.
Initially I created a project and added two more projects to the workspace. But then I couldn't add files from one project to the other, because they have to be under the directory the project is in.
So to mimic your directory structure, I did the following (I attached the resultant files, just stubs, to this message):
1. Created a project in directory newLib
2. Created project BagInt (no files added) in directory BagInt under newLib
3. Created project mainBag (no files added) in director mainBag under the same directory newLib
4. Moved BagInt.ppj, .ppx up one level from directory Bagint to directory new Lib
5. Did the same to mainBag from directory mainBag
6. Added files to each project. BagInt.c compiles ok.
7. Opened project newLib.ppj and added projects BagInt.ppj and mainBag.ppj to the workspace. newLib.ppw was created, so I deleted newLib.ppj
8. Now I can open newLibb.ppw, and add BagInt.c to mainBag.exe. Automatically BagInt.h appears under include files in mainBag.exe. Looks very good.
So far, it is very similar to your example, but when I compile main.c, I get fatal error #1035: Can't find include file "BagInt.h", even though it appears under include files in mainBag.exe.
Any idea what I am missing?