Rafey Rafey - 4 months ago 18
C++ Question

Is there any other location than VC++ Directories to specify lib and include folders?

My work mate has shared a project that compiles correctly on his machine. But I have to manually set include folders that are 'sub-folders' of project and 'libs' using Tools / Options / Projects and Solutions / VC++ Directories / Include (or Lib) files.

I am wondering why my work mate is not getting an include or lib file compilation error while I am getting compilation errors? Why I have to correct it as said above? Is there any other location/file than VC++ Directories to specify lib and include folders that my work mate is using?

Answer

If I understand it right your work mate include a file like "file.h" from a project subfolder in the project like:

#include "file.h"

and set the subfolder in the project settings. If you not use the project settings you have to set the settings on your self like you do.

If you write:

#include "subfolder/file.h"

it also should work on yout system without setting the project settings (onlye maybe setting $(ProjectDir))

If you use extern libs which are not saved in the project directory you can set SystemVariabel (google for windows) and use this in the project to make it easier to share.

e.g.

You want to load a lib from folder C:/somelib so you can set up a system variabel "SomeLibPath" with this directory and setup yout project settings with $(SomeLibPath). So over workers have only to setup this system variabel for correct include.

Hope it helps.