mapbox / windows-builds

DEPRECATED! build scripts for mapnik dependencies, mapnik, node-mapnik, node, libosmiom, osmium-tool
38 stars 22 forks source link

LNK4098 when mapnik.dll is created #12

Closed springmeyer closed 9 years ago

springmeyer commented 9 years ago

@BergWerkGIS - this is the warning that I mentioned worries me. So here's a ticket to track finding how the cause of this. It looks like it might be a dependency that is built in debug?

         LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library [c:\code\mapnik-deps-64\packages\ma
       pnik-master\mapnik-gyp\build\mapnik.vcxproj]
alex85k commented 9 years ago

Had this error! (when building debug version) Some of the dependenices were built with release runtime flags. You can find the exact library by searching for string VCRT" in .lib files. In my case it was libxml2 or BZIP because default linker flags for them was /MD (and should be /MDd ).

/p:Configuration="Release" in msbuild command line can also be a problem for debug version.

Or vice versa, you are building release and have accidentally built one library with debug (VCRTD in .lib)...

wilhelmberg commented 9 years ago

Try to run linktype.bat which calls linktype.ps1 that shows all libs linked with /MT, /MTd or /MDd.

Example output from latest build:

MT or MTd C:\mb\mapnik-dependencies-64\packages\expat\win32\bin\Release\libexpatMT.lib
MT or MTd C:\mb\mapnik-dependencies-64\packages\expat\win32\bin\Release\libexpatwMT.lib
MDd C:\mb\mapnik-dependencies-64\packages\harfbuzz-build\harfbuzz.lib
MDd C:\mb\mapnik-dependencies-64\packages\mapnik-master\mapnik-gyp\mapnik-sdk\libs\harfbuzz.lib
wilhelmberg commented 9 years ago

Seems to be gone after explicitly defining CMAKE_BUILD_TYPE=Release for harfbuzz.

wilhelmberg commented 9 years ago

@alex85k Building debug version is not yet implemented. At the moment it's release only, that's why there is /p:Configuration="Release". But, building a debug version is in the works.

wilhelmberg commented 9 years ago

Verified with a new build. LNK4098 is gone. But there's another one: LNK4075 #13