0

hi
i am using visual studio 2008 (c++ express edition )i have a generated code to handle xml parsing and i am trying to use this code in my project
so i build a .lib file with these setting
under precompiled header
*create precompiled header

* create\use stdafx.h

* precompiled header file $(IntDir)\$(TargetName).pch

and then i got that .lib file + .pch file and put it in another project

i included "xmlparser.pch"

but i dont know how to use classes from inside that lib file

every time i try to to take instance from classes inside lib file i get errors for not finding it
i dont know how to use static lib files that contain multiple classes and headers inside it

plz help

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by Ancient Dragon
0

The *.pch file is of no use outside the project that created it. Its only purpose it to speed up the compile process of a project.

What you have to do is add the *.lib file to the project. There are two ways to do it:
1) Put this in one of the *.c or *.cpp files: #pragma comment(lib,"xmlparser.lib") or
2) Select menu Project --> Properties --> Congiguration Properties -->
linker --> Input. On the rightside of the screen add xmlparser.lib to the "Additional Dependencies" edit control

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.