Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ld: error: undefined symbol: Json::Value::operator=(Json::Value&&) when compiling 5.3.0 on FreeBSD #10289

Closed
PaddyMac opened this issue Aug 12, 2020 · 6 comments
Labels
@ Build CMake, build scripts, official builds, compiler and linker errors Unconfirmed bug Bug report that has not been confirmed to exist/be reproducible

Comments

@PaddyMac
Copy link

PaddyMac commented Aug 12, 2020

Minetest version
5.3.0
OS / Hardware

Operating system: FreeBSD 12.1-STABLE r363327
CPU: Dual Intel Xeon X5680

Summary

I had to delete libevent temporarily from my system to circumvent issue #9078 . The only configuration option I passed was:

cmake .. -DCMAKE_EXE_LINKER_FLAGS="-L/usr/local/lib"

so that the build system would bind libintl. I ran make, and I got the following error output:

[100%] Building CXX object src/CMakeFiles/minetest.dir/voxel.cpp.o
[100%] Building CXX object src/CMakeFiles/minetest.dir/voxelalgorithms.cpp.o
[100%] Linking CXX executable ../../bin/minetest
ld: error: undefined symbol: Json::Value::operator=(Json::Value&&)

referenced by clientlauncher.cpp
CMakeFiles/minetest.dir/client/clientlauncher.cpp.o:(ClientLauncher::launch_game(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >&, bool, GameParams&, Settings const&))
referenced by clientlauncher.cpp
CMakeFiles/minetest.dir/client/clientlauncher.cpp.o:(ClientLauncher::launch_game(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >&, bool, GameParams&, Settings const&))
referenced by clientlauncher.cpp
CMakeFiles/minetest.dir/client/clientlauncher.cpp.o:(ClientLauncher::launch_game(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >&, bool, GameParams&, Settings const&))
referenced by clientlauncher.cpp
CMakeFiles/minetest.dir/client/clientlauncher.cpp.o:(ClientLauncher::launch_game(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >&, bool, GameParams&, Settings const&))
referenced by mods.cpp
CMakeFiles/minetest.dir/content/mods.cpp.o:(ModMetadata::save(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&))
referenced by mods.cpp
CMakeFiles/minetest.dir/content/mods.cpp.o:(ModMetadata::load(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&))
referenced by c_content.cpp
CMakeFiles/minetest.dir/script/common/c_content.cpp.o:(read_json_value(lua_State*, Json::Value&, int, unsigned char))
referenced by c_content.cpp
CMakeFiles/minetest.dir/script/common/c_content.cpp.o:(read_json_value(lua_State*, Json::Value&, int, unsigned char))
referenced by c_content.cpp
CMakeFiles/minetest.dir/script/common/c_content.cpp.o:(read_json_value(lua_State*, Json::Value&, int, unsigned char))
referenced by c_content.cpp
CMakeFiles/minetest.dir/script/common/c_content.cpp.o:(read_json_value(lua_State*, Json::Value&, int, unsigned char))
referenced 45 more times
did you mean: Json::Value::operator=(Json::Value)
defined in: ../lib/jsoncpp/libjsoncpp.a(jsoncpp.cpp.o)

ld: error: undefined symbol: Json::Value::operator=(Json::Value const&)

referenced by c_content.cpp
CMakeFiles/minetest.dir/script/common/c_content.cpp.o:(read_json_value(lua_State*, Json::Value&, int, unsigned char))
referenced by c_content.cpp
CMakeFiles/minetest.dir/script/common/c_content.cpp.o:(read_json_value(lua_State*, Json::Value&, int, unsigned char))
referenced by serverlist.cpp
CMakeFiles/minetest.dir/serverlist.cpp.o:(ServerList::getOnline())
referenced by serverlist.cpp
CMakeFiles/minetest.dir/serverlist.cpp.o:(ServerList::serializeJson(std::__1::vector<Json::Value, std::__1::allocatorJson::Value > const&))
referenced by serverlist.cpp
CMakeFiles/minetest.dir/serverlist.cpp.o:(std::__1::vector<Json::Value, std::__1::allocatorJson::Value >::insert(std::__1::__wrap_iter<Json::Value const*>, Json::Value const&))
referenced by tool.cpp
CMakeFiles/minetest.dir/tool.cpp.o:(ToolGroupCap::toJson(Json::Value&) const)
referenced by tool.cpp
CMakeFiles/minetest.dir/tool.cpp.o:(ToolCapabilities::serializeJson(std::__1::basic_ostream<char, std::__1::char_traits >&) const)
referenced by tool.cpp
CMakeFiles/minetest.dir/tool.cpp.o:(ToolCapabilities::serializeJson(std::__1::basic_ostream<char, std::__1::char_traits >&) const)

ld: error: undefined symbol: Json::StreamWriterBuilder::operator[](std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&)

referenced by convert_json.cpp
CMakeFiles/minetest.dir/convert_json.cpp.o:(fastWriteJson(Json::Value const&))
ld: error: undefined symbol: Json::ValueIteratorBase::deref()
referenced by serverlist.cpp
CMakeFiles/minetest.dir/serverlist.cpp.o:(ServerList::getOnline())
referenced by tool.cpp
CMakeFiles/minetest.dir/tool.cpp.o:(ToolCapabilities::deserializeJson(std::__1::basic_istream<char, std::__1::char_traits >&))
referenced by tool.cpp
CMakeFiles/minetest.dir/tool.cpp.o:(ToolCapabilities::deserializeJson(std::__1::basic_istream<char, std::__1::char_traits >&))
c++: error: linker command failed with exit code 1 (use -v to see invocation)
--- ../bin/minetest ---
*** [../bin/minetest] Error code 1

make[2]: stopped in /usr/home/patrick/work/minetest/minetest-5.3.0/build
1 error

make[2]: stopped in /usr/home/patrick/work/minetest/minetest-5.3.0/build
--- src/CMakeFiles/minetest.dir/all ---
*** [src/CMakeFiles/minetest.dir/all] Error code 2

make[1]: stopped in /usr/home/patrick/work/minetest/minetest-5.3.0/build
1 error

make[1]: stopped in /usr/home/patrick/work/minetest/minetest-5.3.0/build
*** [all] Error code 2

make: stopped in /usr/home/patrick/work/minetest/minetest-5.3.0/build
1 error

make: stopped in /usr/home/patrick/work/minetest/minetest-5.3.0/build

@PaddyMac PaddyMac added the Unconfirmed bug Bug report that has not been confirmed to exist/be reproducible label Aug 12, 2020
@sfan5
Copy link
Member

sfan5 commented Aug 12, 2020

try with -DENABLE_SYSTEM_JSONCPP=1 in your cmake options.

@PaddyMac
Copy link
Author

I had tried that previously, and the program failed to run. So I thought it was a no-go. It turned out that it failed to run because I didn't have minetest_game installed yet. So upon trying it again after installing the game, it does appear that using the system jsoncpp works fine for the server.

My only concern is that CMake warns that this, "May cause segfaults and other memory errors!".

@sfan5
Copy link
Member

sfan5 commented Aug 13, 2020

That warning text is old and should probably be removed.

@PaddyMac
Copy link
Author

I've been doing some testing. Apparently the build failures I was experiencing were resulting from enabling the PostGreSQL or SpatialIndex backends while using the bundled jsoncpp. Enabling either of these feaures will build successfully if using the system jsoncpp.

The only other issue I found which I wanted to bring up is that if gettext is enabled for native language support, and only the server is built but not the client, Minetest will build but the installation will fail due to missing minetest.mo files.

@smeagolthellama
Copy link

smeagolthellama commented Feb 14, 2021

Having the same issue on devuan, with postgres installed. trying the -DENABLE_SYSTEM_JSONCPP=1 thing now.

UPDATE: the system_jsoncpp thing fixed it for me. the cmake warnings are very annoying, but it works.

@Zughy Zughy added the @ Build CMake, build scripts, official builds, compiler and linker errors label May 11, 2022
@savilli
Copy link
Contributor

savilli commented Jun 5, 2022

Can't reproduce, it builds with -DENABLE_SYSTEM_JSONCPP=1 and with -DENABLE_SYSTEM_JSONCPP=0. Guess some jsoncpp update has fixed it.

@Zughy Zughy closed this as completed Jun 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@ Build CMake, build scripts, official builds, compiler and linker errors Unconfirmed bug Bug report that has not been confirmed to exist/be reproducible
Projects
None yet
Development

No branches or pull requests

5 participants