is there a better way ?

I'm new to C++.NET & for the 2 or 3 applications I've written that have used .lib files, I explicitly add them into Linker >> Input>> Additional Dependencies & type in the path for my computer. Thus works fine, but every time I transfer the application to another computer & I need to open up the project & chnage the path. Is there a better way to include the lib files

regards,
ak


Answer this question

is there a better way ?

  • JustJeff

    Another strategy is to use #pragma comment(lib).

    e.g. #pragma comment(lib,"OleAut32.lib")

    This inserts a special comment in the obj file, and is interpreted by the linker.  I use this technique often, especially if my code resides in shared headers that depend on a DLL.

    Brian

     


  • Michael Norton

    Linker - Input - Additional Dependencies are stored in the project file (.vcproj file).  You don't need to open the project every time, it will be saved in the project.  As long as your copy the .vcproj file with it, it should transfer over to the other computer just fine.

    Ted.

     


  • is there a better way ?