Azure / azure-storage-cpplite

Lite version of C++ Client Library for Microsoft Azure Storage
MIT License
26 stars 44 forks source link

Build fails on Windows 10 Enterprise #57

Closed asafka-zerto closed 4 years ago

asafka-zerto commented 4 years ago

I've followed the build instructions but when in the last build step (cmake --build . --config Release) I get a bunch of "warning C4273: ... inconsistent dll linkage", which are treated as errors and fail the build:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86\CL.exe /c /I"C:\projects\azure-storage-cpplite\include" /I"C:\projects\vcpkg\installed\x86-windows\include" /nologo /W4 /WX /di agnostics:classic /O2 /Ob2 /Oy- /D WIN32 /D _WINDOWS /D NDEBUG /D "CMAKE_INTDIR=\"Release\"" /D _MBCS /Gm- /EHsc /MD /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /GR /Fo"azure-storage-lite.dir\Release\" /Fd"azure-storage-lite. dir\Release\azure-storage-lite.pdb" /Gd /TP /analyze- /FC /errorReport:queue "C:\projects\azure-storage-cpplite\src\l ogging.cpp" "C:\projects\azure-storage-cpplite\src\base64.cpp" "C:\projects\azure-storage-cpplite\src\constants.cpp" "C:\projects\azure-storage-cpplite\src\hash.cpp" "C:\projects\azure-storage-cpplite\src\utility.cpp" "C:\projects\azu re-storage-cpplite\src\tinyxml2.cpp" "C:\projects\azure-storage-cpplite\src\tinyxml2_parser.cpp" "C:\projects\azure-s torage-cpplite\src\storage_account.cpp" "C:\projects\azure-storage-cpplite\src\storage_credential.cpp" "C:\projects\a zure-storage-cpplite\src\storage_url.cpp" "C:\projects\azure-storage-cpplite\src\get_blob_request_base.cpp" "C:\proje cts\azure-storage-cpplite\src\put_blob_request_base.cpp" "C:\projects\azure-storage-cpplite\src\delete_blob_request_b ase.cpp" "C:\projects\azure-storage-cpplite\src\copy_blob_request_base.cpp" "C:\projects\azure-storage-cpplite\src\cr eate_container_request_base.cpp" "C:\projects\azure-storage-cpplite\src\delete_container_request_base.cpp" "C:\projec ts\azure-storage-cpplite\src\set_container_metadata_request_base.cpp" "C:\projects\azure-storage-cpplite\src\list_con tainers_request_base.cpp" "C:\projects\azure-storage-cpplite\src\list_blobs_request_base.cpp" "C:\projects\azure-stor age-cpplite\src\get_blob_property_request_base.cpp" "C:\projects\azure-storage-cpplite\src\set_blob_metadatarequest base.cpp" "C:\projects\azure-storage-cpplite\src\get_block_list_request_base.cpp" "C:\projects\azure-storage-cpplite\ src\get_container_property_request_base.cpp" "C:\projects\azure-storage-cpplite\src\put_block_request_base.cpp" "C:\p rojects\azure-storage-cpplite\src\put_block_list_request_base.cpp" "C:\projects\azure-storage-cpplite\src\append_bloc k_request_base.cpp" "C:\projects\azure-storage-cpplite\src\put_page_request_base.cpp" "C:\projects\azure-storage-cppl ite\src\get_page_ranges_request_base.cpp" "C:\projects\azure-storage-cpplite\src\http\libcurl_http_client.cpp" "C:\pr ojects\azure-storage-cpplite\src\blob\blob_client.cpp" "C:\projects\azure-storage-cpplite\src\blob\blob_client_wrappe r.cpp" logging.cpp c:\projects\azure-storage-cpplite\src\logging.cpp(12): error C2220: warning treated as error - no 'object' file generat ed [C:\projects\azure-storage-cpplite\build.release\azure-storage-lite.vcxproj] c:\projects\azure-storage-cpplite\src\logging.cpp(12): warning C4273: 's_logger': inconsistent dll linkage [C:\projects \azure-storage-cpplite\build.release\azure-storage-lite.vcxproj] c:\projects\azure-storage-cpplite\include\logging.h(101): note: see previous definition of 'protected: static std::fu nction<void __cdecl(azure::storage_lite::log_level,std::basic_string<char,std::char_traits,std::allocator

const &)> azure::storage_lite::logger::s_logger' c:\projects\azure-storage-cpplite\src\logging.cpp(12): error C2491: 'azure::storage_lite::logger::s_logger': definition of dllimport static data member not allowed [C:\projects\azure-storage-cpplite\build.release\azure-storage-lite.vcxpro j] base64.cpp c:\projects\azure-storage-cpplite\src\base64.cpp(38): error C2220: warning treated as error - no 'object' file generate d [C:\projects\azure-storage-cpplite\build.release\azure-storage-lite.vcxproj] c:\projects\azure-storage-cpplite\src\base64.cpp(38): warning C4273: 'azure::storage_lite::to_base64': inconsistent dll linkage [C:\projects\azure-storage-cpplite\build.release\azure-storage-lite.vcxproj] c:\projects\azure-storage-cpplite\include\base64.h(10): note: see previous definition of 'to_base64' c:\projects\azure-storage-cpplite\src\base64.cpp(43): warning C4273: 'azure::storage_lite::to_base64': inconsistent dll linkage [C:\projects\azure-storage-cpplite\build.release\azure-storage-lite.vcxproj] c:\projects\azure-storage-cpplite\include\base64.h(11): note: see previous definition of 'to_base64' c:\projects\azure-storage-cpplite\src\base64.cpp(94): warning C4273: 'azure::storage_lite::from_base64': inconsistent d ll linkage [C:\projects\azure-storage-cpplite\build.release\azure-storage-lite.vcxproj] c:\projects\azure-storage-cpplite\include\base64.h(12): note: see previous definition of 'from_base64' constants.cpp c:\projects\azure-storage-cpplite\include\constants.dat(1): error C2220: warning treated as error - no 'object' file ge nerated [C:\projects\azure-storage-cpplite\build.release\azure-storage-lite.vcxproj] c:\projects\azure-storage-cpplite\include\constants.dat(1): warning C4273: 'azure::storage_lite::constants::http_delete ': inconsistent dll linkage [C:\projects\azure-storage-cpplite\build.release\azure-storage-lite.vcxproj] c:\projects\azure-storage-cpplite\include\constants.dat(1): note: see previous definition of 'http_delete' ... 217 Warning(s) 34 Error(s)

Jinming-Hu commented 4 years ago

Hi @asafka-zerto Thanks for your feedback, please try the latest commit, it should be fixed. Feel free to reopen this issue if you have any other questions.