I have several compiling issues (mainly related to libxml2, libtiff, libpng) when compiling with the following mode :
- Windows 10 x64 (1803)
- Visual studio 15.8.1
- CMake 3.12.1
- DCMTK 3.6.3
- dcmtk-3.6.3-win64-support_MD-msvc-15.0
- building in x64
- /MD
I am building non shared lib with default cmake options and checked options to support libpng, libtiff, openssl, zlib, libxml2, iconv.
There are 14 projects that does not build :
dcmp2pgm, dcmprscp, dcml2pnm, dcmj2pnm, dcmprscu, dsr2html, dsrdump...
The errors are :
Also lots of warnings :12>OLDNAMES.lib(close.obi) : warning LNK4049: locally defined symbol _close imported
12>OLDNAMES.lib(read.obi) : warning LNK4049: locally defined symbol _read imported
12>OLDNAMES.lib(write.obi) : warning LNK4049: locally defined symbol _write imported
12>OLDNAMES.lib(getcwd.obi) : warning LNK4049: locally defined symbol _getcwd imported
12>OLDNAMES.lib(open.obi) : warning LNK4049: locally defined symbol _open imported
12>libxml2_o.lib(xmlIO.obj) : error LNK2019: unresolved external symbol __imp_close referenced in function xmlFdClose
12>libxml2_o.lib(catalog.obj) : error LNK2001: unresolved external symbol __imp_close
12>libxml2_o.lib(nanohttp.obj) : error LNK2001: unresolved external symbol __imp_close
12>OLDNAMES.lib(close.obi) : error LNK2001: unresolved external symbol __imp_close
12>libxml2_o.lib(xmlIO.obj) : error LNK2019: unresolved external symbol __imp_read referenced in function xmlFdRead
12>libxml2_o.lib(catalog.obj) : error LNK2001: unresolved external symbol __imp_read
12>OLDNAMES.lib(read.obi) : error LNK2001: unresolved external symbol __imp_read
12>libxml2_o.lib(xmlIO.obj) : error LNK2019: unresolved external symbol __imp_write referenced in function xmlFdWrite
12>libxml2_o.lib(nanohttp.obj) : error LNK2001: unresolved external symbol __imp_write
12>OLDNAMES.lib(write.obi) : error LNK2001: unresolved external symbol __imp_write
12>libxml2_o.lib(xmlIO.obj) : error LNK2019: unresolved external symbol __imp_getcwd referenced in function xmlParserGetDirectory
12>OLDNAMES.lib(getcwd.obi) : error LNK2001: unresolved external symbol __imp_getcwd
12>libxml2_o.lib(catalog.obj) : error LNK2019: unresolved external symbol __imp_open referenced in function xmlLoadFileContent
12>libxml2_o.lib(nanohttp.obj) : error LNK2001: unresolved external symbol __imp_open
12>OLDNAMES.lib(open.obi) : error LNK2001: unresolved external symbol __imp_open
...
I saw one post related to the following "error LNK2001: unresolved external symbol __imp_close..." but their problem is solved by building shared libs.>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
4>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
3>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
4>libxml2_o.lib(xmlreader.obj) : warning LNK4049: locally defined symbol __acrt_iob_func imported
3>libxml2_o.lib(xmlreader.obj) : warning LNK4049: locally defined symbol __acrt_iob_func imported
2>libtiff_o.lib(tif_close.obj) : warning LNK4217: locally defined symbol strncmp imported in function TIFFCleanup
4>libxml2_o.lib(debugXML.obj) : warning LNK4049: locally defined symbol __acrt_iob_func imported
4>libxml2_o.lib(xmlIO.obj) : warning LNK4217: locally defined symbol __acrt_iob_func imported in function xmlFileRead
4>libxml2_o.lib(relaxng.obj) : warning LNK4217: locally defined symbol __acrt_iob_func imported in function xmlRelaxNGCompile
4>libxml2_o.lib(xpath.obj) : warning LNK4049: locally defined symbol __acrt_iob_func imported
4>libxml2_o.lib(xmlregexp.obj) : warning LNK4217: locally defined symbol __acrt_iob_func imported in function xmlRegCheckCharacterRange
4>libxml2_o.lib(tree.obj) : warning LNK4217: locally defined symbol __acrt_iob_func imported in function xmlBufferDump
4>libxml2_o.lib(error.obj) : warning LNK4049: locally defined symbol __acrt_iob_func imported
4>libxml2_o.lib(parserInternals.obj) : warning LNK4049: locally defined symbol __acrt_iob_func imported
4>libxml2_o.lib(buf.obj) : warning LNK4049: locally defined symbol __acrt_iob_func imported
4>libxml2_o.lib(tree.obj) : warning LNK4217: locally defined symbol fwrite imported in function xmlBufferDump
4>libxml2_o.lib(buf.obj) : warning LNK4049: locally defined symbol fwrite imported
4>libxml2_o.lib(xmlIO.obj) : warning LNK4217: locally defined symbol fwrite imported in function xmlFileWrite
4>iconv_o.lib(localcharset.obj) : warning LNK4049: locally defined symbol __stdio_common_vsprintf imported
4>libxml2_o.lib(HTMLtree.obj) : warning LNK4049: locally defined symbol __stdio_common_vsprintf imported
4>libxml2_o.lib(nanohttp.obj) : warning LNK4049: locally defined symbol __stdio_common_vsprintf imported
4>libxml2_o.lib(nanoftp.obj) : warning LNK4049: locally defined symbol __stdio_common_vsprintf imported
4>libxml2_o.lib(debugXML.obj) : warning LNK4049: locally defined symbol __stdio_common_vsprintf imported
4>libxml2_o.lib(relaxng.obj) : warning LNK4217: locally defined symbol __stdio_common_vsprintf imported in function xmlRelaxNGCompile
4>libxml2_o.lib(xpath.obj) : warning LNK4049: locally defined symbol __stdio_common_vsprintf imported
4>libxml2_o.lib(xmlregexp.obj) : warning LNK4217: locally defined symbol __stdio_common_vsprintf imported in function xmlRegCheckCharacterRange
4>libxml2_o.lib(xmlreader.obj) : warning LNK4049: locally defined symbol __stdio_common_vsprintf imported
4>libxml2_o.lib(uri.obj) : warning LNK4049: locally defined symbol __stdio_common_vsprintf imported
4>libxml2_o.lib(HTMLparser.obj) : warning LNK4049: locally defined symbol __stdio_common_vsprintf imported
4>libxml2_o.lib(catalog.obj) : warning LNK4217: locally defined symbol __stdio_common_vsprintf imported in function xmlDumpXMLCatalogNode
4>libxml2_o.lib(xmlschemastypes.obj) : warning LNK4217: locally defined symbol __stdio_common_vsprintf imported in function xmlSchemaGetBuiltInType
4>libxml2_o.lib(parser.obj) : warning LNK4049: locally defined symbol __stdio_common_vsprintf imported
4>libxml2_o.lib(parserInternals.obj) : warning LNK4049: locally defined symbol __stdio_common_vsprintf imported
4>libxml2_o.lib(xmlschemas.obj) : warning LNK4049: locally defined symbol __stdio_common_vsprintf imported
4>libxml2_o.lib(entities.obj) : warning LNK4049: locally defined symbol __stdio_common_vsprintf imported
4>libxml2_o.lib(tree.obj) : warning LNK4217: locally defined symbol __stdio_common_vsprintf imported in function snprintf
4>libxml2_o.lib(xmlstring.obj) : warning LNK4049: locally defined symbol __stdio_common_vsprintf imported
4>libxml2_o.lib(error.obj) : warning LNK4049: locally defined symbol __stdio_common_vsprintf imported
4>libxml2_o.lib(encoding.obj) : warning LNK4049: locally defined symbol __stdio_common_vsprintf imported
4>libxml2_o.lib(xmlschemastypes.obj) : warning LNK4217: locally defined symbol memmove imported in function xmlSchemaGetBuiltInType
4>libxml2_o.lib(xpath.obj) : warning LNK4049: locally defined symbol memmove imported
4>libxml2_o.lib(nanohttp.obj) : warning LNK4049: locally defined symbol memmove imported
4>libxml2_o.lib(nanoftp.obj) : warning LNK4049: locally defined symbol memmove imported
4>libxml2_o.lib(tree.obj) : warning LNK4217: locally defined symbol memmove imported in function xmlBufferAdd
4>libxml2_o.lib(encoding.obj) : warning LNK4049: locally defined symbol memmove imported
3>libxml2_o.lib(debugXML.obj) : warning LNK4049: locally defined symbol __acrt_iob_func imported
3>libxml2_o.lib(xmlIO.obj) : warning LNK4217: locally defined symbol __acrt_iob_func imported in function xmlFileRead
3>libxml2_o.lib(relaxng.obj) : warning LNK4217: locally defined symbol __acrt_iob_func imported in function xmlRelaxNGCompile
3>libxml2_o.lib(xpath.obj) : warning LNK4049: locally defined symbol __acrt_iob_func imported
3>libxml2_o.lib(xmlregexp.obj) : warning LNK4217: locally defined symbol __acrt_iob_func imported in function xmlRegCheckCharacterRange
3>libxml2_o.lib(tree.obj) : warning LNK4217: locally defined symbol __acrt_iob_func imported in function xmlBufferDump
3>libxml2_o.lib(error.obj) : warning LNK4049: locally defined symbol __acrt_iob_func imported
3>libxml2_o.lib(parserInternals.obj) : warning LNK4049: locally defined symbol __acrt_iob_func imported
3>libxml2_o.lib(buf.obj) : warning LNK4049: locally defined symbol __acrt_iob_func imported
3>libxml2_o.lib(tree.obj) : warning LNK4217: locally defined symbol fwrite imported in function xmlBufferDump
...
Could you please give me some hints of what is going wrong ?
Thanks
K.