Closed hobu closed 6 years ago
Reproduced with: cmake ../ -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON
Works with: cmake ../ -G "Visual Studio 15 2017" -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON cmake ../ -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release
Does this mean that Draco is MSVC 2017+ only?
C:\projects\draco\src\draco/mesh/mesh.h(136): warning C4267: 'argument': conversion from 'size_t' to 'const int32_t', possible loss of data NMAKE : fatal error U1073: don't know how to make 'dracodec.lib'
That's a warning. Have you added -DENABLE_WERROR=1 to your CMake command line, or somehow added /WX to your cl.exe command lines?
Yes, there were a number of warnings. That's ok The error that matters to me is the inability of 2015 to make the library.
NMAKE : fatal error U1073: don't know how to make 'dracodec.lib'
Sorry, I forgot to mention that it builds just fine for me on both 2017 and 2015 with -DBUILD_SHARED_LIBS=OFF
Can you run the nmake build in verbose mode? This should work: $ nmake VERBOSE=1
Is any additional information provided w/VERBOSE enabled?
Are any targets working? Which target is NMake building when the error is reported?
draco_version.cc
[ 79%] Linking CXX shared library dracodec.dll
"C:\Program Files\CMake\bin\cmake.exe" -E vs_link_dll --intdir=CMakeFiles\dracodec.dir --manifests -- C:\PROGRA
~2\MICROS~1.0\VC\bin\amd64\link.exe @CMakeFiles\dracodec.dir\objects1.rsp @C:\Users\hobu\AppData\Local\Temp\nmF580.tmp
Visual Studio Non-Incremental Link
LINK:
C:\PROGRA~2\MICROS~1.0\VC\bin\amd64\link.exe @CMakeFiles\dracodec.dir\objects1.rsp /out:dracodec.dll /implib:dracodec.li
b /pdb:C:\projects\draco\build\dracodec.pdb /dll /version:0.0 /machine:x64 /INCREMENTAL:NO kernel32.lib user32.lib gdi32
.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:dracodec
.dll.manifest
Microsoft (R) Incremental Linker Version 14.00.24210.0
Copyright (C) Microsoft Corporation. All rights reserved.
CMakeFiles/dracodec.dir/draco_version.cc.obj CMakeFiles/draco_attributes.dir/src/draco/attributes/attribute_octahedron_t
ransform.cc.obj CMakeFiles/draco_attributes.dir/src/draco/attributes/attribute_quantization_transform.cc.obj CMakeFiles/
draco_attributes.dir/src/draco/attributes/attribute_transform.cc.obj CMakeFiles/draco_attributes.dir/src/draco/attribute
s/geometry_attribute.cc.obj CMakeFiles/draco_attributes.dir/src/draco/attributes/point_attribute.cc.obj CMakeFiles/draco
_compression_attributes_dec.dir/src/draco/compression/attributes/attributes_decoder.cc.obj CMakeFiles/draco_compression_
attributes_dec.dir/src/draco/compression/attributes/kd_tree_attributes_decoder.cc.obj CMakeFiles/draco_compression_attri
butes_dec.dir/src/draco/compression/attributes/sequential_attribute_decoder.cc.obj CMakeFiles/draco_compression_attribut
es_dec.dir/src/draco/compression/attributes/sequential_attribute_decoders_controller.cc.obj CMakeFiles/draco_compression
_attributes_dec.dir/src/draco/compression/attributes/sequential_integer_attribute_decoder.cc.obj CMakeFiles/draco_compre
ssion_attributes_dec.dir/src/draco/compression/attributes/sequential_normal_attribute_decoder.cc.obj CMakeFiles/draco_co
mpression_attributes_dec.dir/src/draco/compression/attributes/sequential_quantization_attribute_decoder.cc.obj CMakeFile
s/draco_compression_decode.dir/src/draco/compression/decode.cc.obj CMakeFiles/draco_compression_mesh_dec.dir/src/draco/c
ompression/mesh/mesh_decoder.cc.obj CMakeFiles/draco_compression_mesh_dec.dir/src/draco/compression/mesh/mesh_edgebreake
r_decoder.cc.obj CMakeFiles/draco_compression_mesh_dec.dir/src/draco/compression/mesh/mesh_edgebreaker_decoder_impl.cc.o
bj CMakeFiles/draco_compression_mesh_dec.dir/src/draco/compression/mesh/mesh_sequential_decoder.cc.obj CMakeFiles/draco_
compression_point_cloud_dec.dir/src/draco/compression/point_cloud/point_cloud_decoder.cc.obj CMakeFiles/draco_compressio
n_point_cloud_dec.dir/src/draco/compression/point_cloud/point_cloud_kd_tree_decoder.cc.obj CMakeFiles/draco_compression_
point_cloud_dec.dir/src/draco/compression/point_cloud/point_cloud_sequential_decoder.cc.obj CMakeFiles/draco_core.dir/sr
c/draco/core/cycle_timer.cc.obj CMakeFiles/draco_core.dir/src/draco/core/data_buffer.cc.obj CMakeFiles/draco_core.dir/sr
c/draco/core/decoder_buffer.cc.obj CMakeFiles/draco_core.dir/src/draco/core/divide.cc.obj CMakeFiles/draco_core.dir/src/
draco/core/draco_types.cc.obj CMakeFiles/draco_core.dir/src/draco/core/encoder_buffer.cc.obj CMakeFiles/draco_core.dir/s
rc/draco/core/hash_utils.cc.obj CMakeFiles/draco_core.dir/src/draco/core/options.cc.obj CMakeFiles/draco_core.dir/src/dr
aco/core/quantization_utils.cc.obj CMakeFiles/draco_core.dir/src/draco/core/shannon_entropy.cc.obj CMakeFiles/draco_core
.dir/src/draco/core/symbol_coding_utils.cc.obj CMakeFiles/draco_core.dir/src/draco/core/symbol_decoding.cc.obj CMakeFile
s/draco_core.dir/src/draco/core/symbol_encoding.cc.obj CMakeFiles/draco_core_bit_coders.dir/src/draco/core/bit_coders/ad
aptive_rans_bit_decoder.cc.obj CMakeFiles/draco_core_bit_coders.dir/src/draco/core/bit_coders/adaptive_rans_bit_encoder.
cc.obj CMakeFiles/draco_core_bit_coders.dir/src/draco/core/bit_coders/direct_bit_decoder.cc.obj CMakeFiles/draco_core_bi
t_coders.dir/src/draco/core/bit_coders/direct_bit_encoder.cc.obj CMakeFiles/draco_core_bit_coders.dir/src/draco/core/bit
_coders/rans_bit_decoder.cc.obj CMakeFiles/draco_core_bit_coders.dir/src/draco/core/bit_coders/rans_bit_encoder.cc.obj C
MakeFiles/draco_core_bit_coders.dir/src/draco/core/bit_coders/symbol_bit_decoder.cc.obj CMakeFiles/draco_core_bit_coders
.dir/src/draco/core/bit_coders/symbol_bit_encoder.cc.obj CMakeFiles/draco_dec_config.dir/draco_dec_config.cc.obj CMakeFi
les/draco_io.dir/src/draco/io/mesh_io.cc.obj CMakeFiles/draco_io.dir/src/draco/io/obj_decoder.cc.obj CMakeFiles/draco_io
.dir/src/draco/io/obj_encoder.cc.obj CMakeFiles/draco_io.dir/src/draco/io/parser_utils.cc.obj CMakeFiles/draco_io.dir/sr
c/draco/io/ply_decoder.cc.obj CMakeFiles/draco_io.dir/src/draco/io/ply_encoder.cc.obj CMakeFiles/draco_io.dir/src/draco/
io/ply_reader.cc.obj CMakeFiles/draco_io.dir/src/draco/io/point_cloud_io.cc.obj CMakeFiles/draco_mesh.dir/src/draco/mesh
/corner_table.cc.obj CMakeFiles/draco_mesh.dir/src/draco/mesh/mesh.cc.obj CMakeFiles/draco_mesh.dir/src/draco/mesh/mesh_
are_equivalent.cc.obj CMakeFiles/draco_mesh.dir/src/draco/mesh/mesh_attribute_corner_table.cc.obj CMakeFiles/draco_mesh.
dir/src/draco/mesh/mesh_cleanup.cc.obj CMakeFiles/draco_mesh.dir/src/draco/mesh/mesh_misc_functions.cc.obj CMakeFiles/dr
aco_mesh.dir/src/draco/mesh/mesh_stripifier.cc.obj CMakeFiles/draco_mesh.dir/src/draco/mesh/triangle_soup_mesh_builder.c
c.obj CMakeFiles/draco_metadata.dir/src/draco/metadata/geometry_metadata.cc.obj CMakeFiles/draco_metadata.dir/src/draco/
metadata/metadata.cc.obj CMakeFiles/draco_metadata_dec.dir/src/draco/metadata/metadata_decoder.cc.obj CMakeFiles/draco_p
oint_cloud.dir/src/draco/point_cloud/point_cloud.cc.obj CMakeFiles/draco_point_cloud.dir/src/draco/point_cloud/point_clo
ud_builder.cc.obj CMakeFiles/draco_points_dec.dir/src/draco/compression/point_cloud/algorithms/dynamic_integer_points_kd
_tree_decoder.cc.obj CMakeFiles/draco_points_dec.dir/src/draco/compression/point_cloud/algorithms/float_points_tree_deco
der.cc.obj
MT:
C:/Program Files (x86)/Windows Kits/8.1/bin/x64/mt.exe /nologo /manifest dracodec.dll.manifest /outputresource:dracodec.
dll;#2
[ 79%] Built target dracodec
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\nmake.exe" -f CMakeFiles\draco_decoder.dir\bui
ld.make /nologo -L CMakeFiles\draco_decoder.dir\depend
"C:\Program Files\CMake\bin\cmake.exe" -E cmake_depends "NMake Makefiles" C:\projects\draco C:\projects\draco C:
\projects\draco\build C:\projects\draco\build C:\projects\draco\build\CMakeFiles\draco_decoder.dir\DependInfo.cmake --co
lor=
Dependee "C:\projects\draco\build\CMakeFiles\draco_decoder.dir\DependInfo.cmake" is newer than depender "C:/projects/dra
co/build/CMakeFiles/draco_decoder.dir/depend.internal".
Dependee "C:/projects/draco/build/CMakeFiles/CMakeDirectoryInformation.cmake" is newer than depender "C:/projects/draco/
build/CMakeFiles/draco_decoder.dir/depend.internal".
Scanning dependencies of target draco_decoder
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\nmake.exe" -f CMakeFiles\draco_decoder.dir\bui
ld.make /nologo -L CMakeFiles\draco_decoder.dir\build
[ 80%] Building CXX object CMakeFiles/draco_decoder.dir/src/draco/tools/draco_decoder.cc.obj
C:\PROGRA~2\MICROS~1.0\VC\bin\amd64\cl.exe @C:\Users\hobu\AppData\Local\Temp\nmFDDC.tmp
Microsoft (R) C/C++ Optimizing Compiler Version 19.00.24210 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
cl /TP -IC:\projects\draco\..\googletest -IC:\projects\draco\src /DWIN32 /D_WINDOWS /W3 /GR /EHsc -DDRACO_POINT_CLOUD
_COMPRESSION_SUPPORTED -DDRACO_MESH_COMPRESSION_SUPPORTED -DDRACO_STANDARD_EDGEBREAKER_SUPPORTED -DDRACO_PREDICTIVE_EDGE
BREAKER_SUPPORTED -DDRACO_BACKWARDS_COMPATIBILITY_SUPPORTED -DDRACO_ATTRIBUTE_DEDUPLICATION_SUPPORTED /MT /O2 /Ob2 /DNDE
BUG /FoCMakeFiles\draco_decoder.dir\src\draco\tools\draco_decoder.cc.obj /FdCMakeFiles\draco_decoder.dir\ /FS -c C:\proj
ects\draco\src\draco\tools\draco_decoder.cc
draco_decoder.cc
C:\projects\draco\src\draco/attributes/point_attribute.h(68): warning C4267: '=': conversion from 'size_t' to 'unsigned
int', possible loss of data
C:\projects\draco\src\draco/metadata/metadata.h(134): warning C4267: 'return': conversion from 'size_t' to 'int', possib
le loss of data
C:\projects\draco\src\draco/point_cloud/point_cloud.h(57): warning C4267: 'return': conversion from 'size_t' to 'int32_t
', possible loss of data
C:\projects\draco\src\draco/mesh/mesh.h(51): warning C4267: 'argument': conversion from 'size_t' to 'const uint32_t', po
ssible loss of data
C:\projects\draco\src\draco/mesh/mesh.h(61): warning C4267: 'return': conversion from 'size_t' to 'unsigned int', possib
le loss of data
C:\projects\draco\src\draco/mesh/mesh.h(136): warning C4267: 'argument': conversion from 'size_t' to 'const uint32_t', p
ossible loss of data
NMAKE : fatal error U1073: don't know how to make 'dracodec.lib'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\nmake.exe"' : return code
'0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\nmake.exe"' : return code
'0x2'
Thanks for the fix. I just tried it out and I get past building the draco.dll, but the tests do not build completely (they build without trouble in a static, non-BUILD_SHARED_LIBS=ON
configuration, however).
[ 96%] Linking CXX executable draco_tests.exe
LINK: command "C:\PROGRA~2\MICROS~1.0\VC\bin\amd64\link.exe /nologo @CMakeFiles\draco_tests.dir\objects1.rsp /out:draco_tests.exe /implib:draco_tests.lib /pdb:C:\projects\draco\build\draco_tests.pdb /version:0.0 /machine:x64 /INCREMENTAL:NO /subsystem:console draco.lib googletest\googlemock\gtest\gtest.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:draco_tests.exe.manifest" failed (exit code 1120) with the following output:
mesh_encoder_test.cc.obj : error LNK2019: unresolved external symbol "class testing::internal::Mutex testing::internal::g_linked_ptr_mutex" (?g_linked_ptr_mutex@internal@testing@@3VMutex@12@A) referenced in function "class testing::internal::linked_ptr<struct testing::internal::ParameterizedTestCaseInfo<class draco::MeshEncoderTest>::TestInfo> * __cdecl std::_Uninitialized_move_al_unchecked1<class testing::internal::linked_ptr<struct testing::internal::ParameterizedTestCaseInfo<class draco::MeshEncoderTest>::TestInfo> *,class testing::internal::linked_ptr<struct testing::internal::ParameterizedTestCaseInfo<class draco::MeshEncoderTest>::TestInfo> *,class std::allocator<class testing::internal::linked_ptr<struct testing::internal::ParameterizedTestCaseInfo<class draco::MeshEncoderTest>::TestInfo> > >(class testing::internal::linked_ptr<struct testing::internal::ParameterizedTestCaseInfo<class draco::MeshEncoderTest>::TestInfo> *,class testing::internal::linked_ptr<struct testing::internal::ParameterizedTestCaseInfo<class draco::MeshEncoderTest>::TestInfo> *,class testing::internal::linked_ptr<struct testing::internal::ParameterizedTestCaseInfo<class draco::MeshEncoderTest>::TestInfo> *,struct std::_Wrap_alloc<class std::allocator<class testing::internal::linked_ptr<struct testing::internal::ParameterizedTestCaseInfo<class draco::MeshEncoderTest>::TestInfo> > > &,struct std::_General_ptr_iterator_tag,struct std::_Any_tag)" (??$_Uninitialized_move_al_unchecked1@PEAV?$linked_ptr@UTestInfo@?$ParameterizedTestCaseInfo@VMeshEncoderTest@draco@@@internal@testing@@@internal@testing@@PEAV123@V?$allocator@V?$linked_ptr@UTestInfo@?$ParameterizedTestCaseInfo@VMeshEncoderTest@draco@@@internal@testing@@@internal@testing@@@std@@@std@@YAPEAV?$linked_ptr@UTestInfo@?$ParameterizedTestCaseInfo@VMeshEncoderTest@draco@@@internal@testing@@@internal@testing@@PEAV123@00AEAU?$_Wrap_alloc@V?$allocator@V?$linked_ptr@UTestInfo@?$ParameterizedTestCaseInfo@VMeshEncoderTest@draco@@@internal@testing@@@internal@testing@@@std@@@0@U_General_ptr_iterator_tag@0@U_Any_tag@0@@Z)
draco_tests.exe : fatal error LNK1120: 1 unresolved externals
I won't have time to look into this for at least a couple of days, as far as workarounds go: Just disable the tests when doing shared library builds for now.
I suspect the fix for this may be to avoid use of the CMake support in googletest in favor of referencing the sources directly as a static library in the Draco CMake file. If you want to try that yourself it's not very difficult. Basically:
include_directories("${GTEST_SRC_DIR}/googletest")
add_library(gtest STATIC "${GTEST_SRC_DIR}/googletest/gtest-all.cc")
I think that's it. If you try this and run into any issues: Please post them here.
Reporting back that the tests are running for me now. There's a failure, but I'll make a new ticket for it.
Configuring with
-DBUILD_SHARED_LIBS=ON
fails with MSVC 2015: