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.