Visual Studio 2008 Solution - How to specify where to get dependent .lib
-
sábado, 03 de marzo de 2012 20:30
I am modifying my VS 2008 configuration. For each Project I clicked Properties and...
I set Linker-General-Output File to $(OutDir)\$(ProjectName).dll
I set Configuration Properties-General-Output Directory to $(SolutionDir)\G\$(ConfigurationName) and Intermediate Directory to $(ConfigurationName)
Now I am getting xxx.lib not found error because it is being sought under \G\... What should I do to make it search under "Project"\Debug\xxx.lib - instead of \G\Debug\xxx.lib the linker is doing right now?
Thank you
Makoto
Todas las respuestas
-
domingo, 04 de marzo de 2012 2:53
The usual way to specify an additional library
for a build is to set the project properties:
Configuration Properties->Linker->General
and set the path for the .lib file in
"Additional Library Directories"
Also go to:
Configuration Properties->Linker->Input
and set the .lib file name in
"Additional Dependencies"
- Wayne- Marcado como respuesta Jesse JiangMicrosoft Contingent Staff, Moderator lunes, 19 de marzo de 2012 9:12
-
domingo, 04 de marzo de 2012 3:30
Thank you for the instruction.
If Project G requires two libraries, A.lib & B.lib, am I adding both "..\A\Debug" & "..\B\Debug" in Additional Library Directories?
That is, I cannot just use a $(macro), but need to specify individual folder names?
Makoto
-
domingo, 04 de marzo de 2012 15:55
If Project G requires two libraries, A.lib & B.lib, am I adding both "..\A\Debug" & "..\B\Debug" in Additional Library Directories?
VB folks could add both (or more) paths, but we VC++ users do something smarter.
We set all projects in the solution so that the build output (.libs. .dlls) go to one directory: usually $(SolutionDir)$(ConfigurationName) , and specify that in Additional Library Directories.
-- pa
-
martes, 06 de marzo de 2012 7:33
Thank you for your help...
I set Linker-General-Output File to be --> $(OutDir)\$(ProjectName).dll
So, now I am getting my dll in the folder I want (as above), but my lib is created in the Project folder. I want my lib to be in the same folder as my dll. How do I specify where my lib is created ?And once this is done, how do I specify to search this folder for lib?
I put $(SolutionDir)$(ConfigurationName) in Additional Library Directories, but I got "cannot open..." linker error, looking for a wrong folder.
Makoto
-
jueves, 08 de marzo de 2012 6:42
The answer was : Linker-Advanced-Import Librariy. This is how I specify where my lib goes. I also set Additional Library Directories as above.
Now, I am getting a "cannot open .......lib" linker error. The reason is the folder the linker is looking for has "..\ProjectName" prefixed on top of my Additional Library Directories specification. Could you tell me why or how to fix it?
Thank you.
Makoto
-
viernes, 09 de marzo de 2012 3:20
Wayne already told you how to do that . But still if you want a lib inside your project you can use additional dependency or
you can use
#pragma comment( lib,"your library")
if path is a problem then specify the path of lib or copy it to your local project directory.
Thanks
Rupesh Shukla
- Marcado como respuesta Jesse JiangMicrosoft Contingent Staff, Moderator lunes, 19 de marzo de 2012 9:12
-
lunes, 19 de marzo de 2012 9:13Moderador
Hi Makoto,
I marked these replies as answer, if your issue have not been solved please unmark it and update more information about this issue.
Best regards,
JesseJesse Jiang [MSFT]
MSDN Community Support | Feedback to us

