0

I'm actually trying to include the Expat library in a C Visual Studio project but I don't know how to do this. I spent a lot of time to search how to do it but nothing works, do you know how to do this ?

I tried to link all the headers and C files, build with cmake and link it but nothing works. To be precise I download the library on GitHub and follow the README file to build it.

1 Answer 1

1

I tested the whole process of importing and configuring Expat Library, and successfully used the project to parse .xml. I suggest you try my method: Be prepared to download the compiled library, I downloaded (expat-win32bin-2.6.2.zip). After downloading, put it in a location you are familiar with. I wrote it down and replaced this location with . Next, use VS to create a new C++ project. Change the project to a 32-bit (x86) project (must be changed because the downloaded library is 32-bit, otherwise it will report Link Error). Then complete these operations on the configuration page of the project file:

1.Project Properties -->Configuration Properties > C/C++ > General --> Additional Include Directories add /Source/lib 2. .Project Properties -->Configuration Properties Configuration Properties > Linker > General --> Additional Library Directories add /Bin 3. Configuration Properties > Linker > Input --> Additional Dependencies add libexpat.lib

If you are prompted that you cannot find libexpat.dll in the specified directory, please remember to manually paste this file into the Debug directory of the project from the Bin subdirectory of the expat folder. If you encounter other problems or any errors, feel free to ask me.

New contributor
Dennis Li is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.