Sorry for not being enough clear, why I need to do this, is because in some header file I need to import a .lib file, but I figured out that MS-VS 2003 (maybe 2005 handle it differently!) can't just stick to the relative path of my header file.
Let's say I have "C:\project" where my project file is located, with folder "C:\project\source" being a root directory for source files... Then, I also have a secondary directory for other source files, say "C:\project\source\other"...
If I have a file: "C:\project\source\something.cpp" and in it I want to include some header file located in directory "other", I will be able to write only:
Code:
#include "other\\some_other_file.h"
But my problem is that if I try to include a .lib file the same way, it won't work:
Code:
#pragma comment (lib, "other\\some_lib.lib")
Instead, I have to write:
Code:
#pragma comment (lib, "C:\\project\\source\\other\\some_lib.lib")
I just don't understand why "#pragma comment" paths don't work the same way as "#include" does, so I thought about using a macro to get to the same result:
Code:
#define MY_PATH "##__CURRENT_FILE_DIRECTORY__##other\\some_lib.lib"
#pragma comment (lib, MY_PATH)
So basically that's what I was trying to build... A macro command that would get me the relative path to that .lib file. I would like to stick to relative paths instead of absolute! ^^
But if you know a better way to import lib files in code, I would like to know it because I can't import .lib files using "#include" I know I can possibly set this in the project's options, but I'd like to have it directly in a file, so I would never forget to change options when I start a new application with the same sources....
Sorry for the long post!!