ljfa-ag / libnbtplusplus

A C++ library for Minecraft's file format NBT
GNU Lesser General Public License v3.0
78 stars 25 forks source link

Build successfully with Visual Studio 2017 (x64 Debug/Release) #10

Closed minexew closed 7 years ago

minexew commented 7 years ago

This certainly shouldn't break anything (tested on Linux), and probably works for 32-bit builds as well.

There are still a bunch of warnings you might want to look into.

1>e:\mcgen\dependencies\libnbtplusplus\include\tag_array.h(128): warning C4661: 'void nbt::tag_array<int8_t>::read_payload(nbt::io::stream_reader &)': no suitable definition provided for explicit template instantiation request
1>e:\mcgen\dependencies\libnbtplusplus\include\tag_array.h(107): note: see declaration of 'nbt::tag_array<int8_t>::read_payload'
1>e:\mcgen\dependencies\libnbtplusplus\include\tag_array.h(128): warning C4661: 'void nbt::tag_array<int8_t>::write_payload(nbt::io::stream_writer &) const': no suitable definition provided for explicit template instantiation request
1>e:\mcgen\dependencies\libnbtplusplus\include\tag_array.h(112): note: see declaration of 'nbt::tag_array<int8_t>::write_payload'
1>e:\mcgen\dependencies\libnbtplusplus\include\tag_array.h(129): warning C4661: 'void nbt::tag_array<int32_t>::read_payload(nbt::io::stream_reader &)': no suitable definition provided for explicit template instantiation request
1>e:\mcgen\dependencies\libnbtplusplus\include\tag_array.h(107): note: see declaration of 'nbt::tag_array<int32_t>::read_payload'
1>e:\mcgen\dependencies\libnbtplusplus\include\tag_array.h(129): warning C4661: 'void nbt::tag_array<int32_t>::write_payload(nbt::io::stream_writer &) const': no suitable definition provided for explicit template instantiation request
1>e:\mcgen\dependencies\libnbtplusplus\include\tag_array.h(112): note: see declaration of 'nbt::tag_array<int32_t>::write_payload'
1>e:\mcgen\dependencies\libnbtplusplus\include\tag_array.h(119): warning C4661: 'void nbt::tag_array<int8_t>::read_payload(nbt::io::stream_reader &)': no suitable definition provided for explicit template instantiation request
1>e:\mcgen\dependencies\libnbtplusplus\include\tag_array.h(107): note: see declaration of 'nbt::tag_array<int8_t>::read_payload'
1>e:\mcgen\dependencies\libnbtplusplus\include\tag_array.h(119): warning C4661: 'void nbt::tag_array<int8_t>::write_payload(nbt::io::stream_writer &) const': no suitable definition provided for explicit template instantiation request
1>e:\mcgen\dependencies\libnbtplusplus\include\tag_array.h(112): note: see declaration of 'nbt::tag_array<int8_t>::write_payload'
1>e:\mcgen\dependencies\libnbtplusplus\include\tag_array.h(119): warning C4661: 'void nbt::tag_array<int32_t>::read_payload(nbt::io::stream_reader &)': no suitable definition provided for explicit template instantiation request
1>e:\mcgen\dependencies\libnbtplusplus\include\tag_array.h(107): note: see declaration of 'nbt::tag_array<int32_t>::read_payload'
1>e:\mcgen\dependencies\libnbtplusplus\include\tag_array.h(119): warning C4661: 'void nbt::tag_array<int32_t>::write_payload(nbt::io::stream_writer &) const': no suitable definition provided for explicit template instantiation request
1>e:\mcgen\dependencies\libnbtplusplus\include\tag_array.h(112): note: see declaration of 'nbt::tag_array<int32_t>::write_payload'
ljfa-ag commented 7 years ago

Thanks!

Neither gcc nor clang is producing this kind of warning, unfortunately I can't test it on Visual C++. Maybe it can be fixed by moving the explicit instantiations into the source rather than the header file, but that caused other problems for me.