I honestly don't know how important these warnings are - I don't do
much on Windows.  As far as I'm aware the declspec should be #defined
correctly, could that have something to do with it?

-Robert Middleton

On Mon, May 3, 2021 at 2:20 PM Patrick Mills
<patrick.mi...@cerberusftp.com.invalid> wrote:
>
> Anyone else building DLLs in Windows environment?
>
> I'm seeing lots of warnings in VS 2019. Wondering if these should be
> disabled or a note added about ignoring them.
>
> Or perhaps I'm doing something wrong in my cmake build:
>
> cmake -DCMAKE_GENERATOR_PLATFORM=x64 -DCMAKE_BUILD_TYPE=Release
> -DCMAKE_INSTALL_PREFIX="<MYFULLPATH_REMOVED>" -DBUILD_SHARED_LIBS=ON
> -DAPR_STATIC=ON -DAPU_STATIC=ON -DLOG4CXX_INSTALL_PDB=ON
> -DBUILD_TESTING=OFF ..
> cmake --build . --config RelWithDebInfo --target install
>
> Here are the warnings I'm seeing:
>
> Tons of these relating to std::xyz which I believe can mostly be safely
> ignored as long as the compiler versions are the same. (
> https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4251?view=msvc-160
> )
> apache-log4cxx-0.12.0\src\main\include\log4cxx/helpers/loglog.h(50,19):
> warning C4251: 'log4cxx::helpers::LogLog::mutex': class 'std::mutex' needs
> to have dll-interface to be used by clients of class
> 'log4cxx::helpers::LogLog'
> [apache-log4cxx-0.12.0\CFS_Build\src\main\cpp\log4cxx.vcxproj]
>
> apache-log4cxx-0.12.0\src\main\include\log4cxx/rolling/timebasedrollingpolicy.h(291,1):
> warning C4250: 'log4cxx::rolling::TimeBasedRollingPolicy': inherits
> 'log4cxx::rolling::RollingPolicyBase::log4cxx::rolling::RollingPolicyBase::setOption'
> via dominance [apache-log4cxx-0.12.0\CFS_Build\src\main\cpp\log4cxx.vcxproj]
>
> Lots of these too...
> apache-log4cxx-0.12.0\CFS_Build\src\main\include\log4cxx/private/log4cxx_private.h(67,1):
> warning C4005: 'LOG4CXX_MEMSET_IOS_BASE': macro redefinition
> [apache-log4cxx-0.12.0\CFS_Build\src\main\cpp\log4cxx.vcxproj]
>
> apache-log4cxx-0.12.0\src\main\cpp\charsetencoder.cpp(472,16): warning
> C4244: '=': conversion from 'const wchar_t' to 'char', possible loss of
> data [apache-log4cxx-0.12.0\CFS_Build\src\main\cpp\log4cxx.vcxproj]
> apache-log4cxx-0.12.0\src\main\cpp\nteventlogappender.cpp(246,56): warning
> C4267: 'argument': conversion from 'size_t' to 'DWORD', possible loss of
> data [apache-log4cxx-0.12.0\CFS_Build\src\main\cpp\log4cxx.vcxproj]
> apache-log4cxx-0.12.0\src\main\cpp\nteventlogappender.cpp(248,56): warning
> C4267: 'argument': conversion from 'size_t' to 'DWORD', possible loss of
> data [apache-log4cxx-0.12.0\CFS_Build\src\main\cpp\log4cxx.vcxproj]
> apache-log4cxx-0.12.0\src\main\cpp\rollingpolicybase.cpp(117,39): warning
> C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of
> data [apache-log4cxx-0.12.0\CFS_Build\src\main\cpp\log4cxx.vcxproj]
> apache-log4cxx-0.12.0\src\main\cpp\simpledateformat.cpp(143,7): warning
> C4244: 'argument': conversion from 'wchar_t' to 'char', possible loss of
> data [apache-log4cxx-0.12.0\CFS_Build\src\main\cpp\log4cxx.vcxproj]
> apache-log4cxx-0.12.0\src\main\cpp\socket.cpp(124,26): warning C4267: '+=':
> conversion from 'size_t' to 'int', possible loss of data
> [apache-log4cxx-0.12.0\CFS_Build\src\main\cpp\log4cxx.vcxproj]
> apache-log4cxx-0.12.0\src\main\cpp\syslogwriter.cpp(64,29): warning C4267:
> 'argument': conversion from 'size_t' to 'int', possible loss of data
> [apache-log4cxx-0.12.0\CFS_Build\src\main\cpp\log4cxx.vcxproj]
> apache-log4cxx-0.12.0\src\main\cpp\transcoder.cpp(380,17): warning C4244:
> 'argument': conversion from 'const wchar_t' to 'const _Elem', possible loss
> of data [apache-log4cxx-0.12.0\CFS_Build\src\main\cpp\log4cxx.vcxproj]

Reply via email to