I am porting some c++ code that was compiled with cmake and gcc under Linux to a larger Windows project. We are using Microsoft Visual Studio 2013, and the project is a simple command line tool, built in release mode, x64. I am getting a bunch of linker errors when linking against libxml2 and libxslt. First I tried downloading prebuilt binaries, but when this didn't work, I tried building libxml2 and libxslt myself. I downloaded the source for libxml2-2.7.8, and built it like so:
cscript configure.js compiler=msvc-12.0 modules=no http=no ftp=no python=no schematron=no iconv=no static=yes
nmake
This was successful, yielding libxml2.lib and libxml2_a.lib. I then added the paths to these libraries to the linker path in my project settings, and added the library names to the linker input additional dependencies. I followed these same instructions for libxslt. When I build my project in MSVC, I get the following errors:
Error 1 error LNK2001: unresolved external symbol xsltParseStylesheetFile C:\Users\aday\Source\Workspaces\Illumina.Isis\Dev\Trunk\Src\bcl2fastq\DemuxReportGenerator.obj bcl2fastq
Error 2 error LNK2001: unresolved external symbol xmlSubstituteEntitiesDefault C:\Users\aday\Source\Workspaces\Illumina.Isis\Dev\Trunk\Src\bcl2fastq\DemuxReportGenerator.obj bcl2fastq
Error 3 error LNK2001: unresolved external symbol xmlFreeDoc C:\Users\aday\Source\Workspaces\Illumina.Isis\Dev\Trunk\Src\bcl2fastq\DemuxReportGenerator.obj bcl2fastq
Error 4 error LNK2001: unresolved external symbol xmlCleanupParser C:\Users\aday\Source\Workspaces\Illumina.Isis\Dev\Trunk\Src\bcl2fastq\DemuxReportGenerator.obj bcl2fastq
Error 5 error LNK2001: unresolved external symbol xsltCleanupGlobals C:\Users\aday\Source\Workspaces\Illumina.Isis\Dev\Trunk\Src\bcl2fastq\DemuxReportGenerator.obj bcl2fastq
Error 6 error LNK2001: unresolved external symbol xmlLoadExtDtdDefaultValue C:\Users\aday\Source\Workspaces\Illumina.Isis\Dev\Trunk\Src\bcl2fastq\DemuxReportGenerator.obj bcl2fastq
Error 7 error LNK2001: unresolved external symbol xsltFreeStylesheet C:\Users\aday\Source\Workspaces\Illumina.Isis\Dev\Trunk\Src\bcl2fastq\DemuxReportGenerator.obj bcl2fastq
Error 8 error LNK2001: unresolved external symbol xsltApplyStylesheet C:\Users\aday\Source\Workspaces\Illumina.Isis\Dev\Trunk\Src\bcl2fastq\DemuxReportGenerator.obj bcl2fastq
Error 9 error LNK2001: unresolved external symbol exsltRegisterAll C:\Users\aday\Source\Workspaces\Illumina.Isis\Dev\Trunk\Src\bcl2fastq\DemuxReportGenerator.obj bcl2fastq
Error 10 error LNK2001: unresolved external symbol xmlParseFile C:\Users\aday\Source\Workspaces\Illumina.Isis\Dev\Trunk\Src\bcl2fastq\DemuxReportGenerator.obj bcl2fastq
I have no idea why these linker errors are occurring. The libraries are in the path, and explicitly linked against. If I move the library aside, and try to build, I get an error message telling me it can't find the file. So I know that it sees the files, but for some reason it can't read the symbols out of them. I tried building the libraries with every conceivable combination of parameters without success. I tried linking against libxml2_a.lib and libxml2.lib. I am successfully linking against similarly built boost libraries. Why am I getting these linker errors?