How can I eliminate compile warnings using ZLib in Visual Studio

30 Views Asked by At

I built Zlib 1.3.1 in VS 2019 using the ReleaseWithoutAsm platform for 32-bit and 64-bit.

I am adding compress2/uncompress to an existing VS 2019 project that I create 32-bit and 64-bit versions of. The Release builds of both are working but there are some odd warning messages only appearing in the 64-bit Release build that I'd like to eliminate if possible.

I added this to the top of my code file:

#define ZLIB_WINAPI
#include "zlib.h"

These are the compiler settings for the 64-bit Release build:

Runtime Library:                Multi-threaded (/MT)
Additional Library Directories: .\ZLib\libs\x64
Additional Dependencies:        zlibstat.lib

Here are the compile messages:

Build started...
1>------ Build started: Project: TopwizClient, Configuration: Release x64 ------
1>functions.cpp
1>   Creating library C:\Users\topwi\source\vs2019\TopwizClient\x64\Release\TopwizClient.lib and object C:\Users\topwi\source\vs2019\TopwizClient\x64\Release\TopwizClient.exp
1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>Generating code
1>2 of 286 functions ( 0.7%) were compiled, the rest were copied from previous compilation.
1>  0 functions were new in current compilation
1>  1 functions had inline decision re-evaluated but remain unchanged
1>Finished generating code
1>LINK : warning LNK4286: symbol 'free' defined in 'libucrt.lib(free.obj)' is imported by 'zlibstat.lib(zutil.obj)'
1>LINK : warning LNK4286: symbol 'malloc' defined in 'libucrt.lib(malloc.obj)' is imported by 'zlibstat.lib(zutil.obj)'
1>TopwizClient.vcxproj -> C:\Users\topwi\source\vs2019\TopwizClient\x64\Release\TopwizClient.pbx
1>Done building project "TopwizClient.vcxproj".
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
0

There are 0 best solutions below