Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I finally tracked down the reason for the unresolved symbol which has been bugging me for a year. Whenever compiling with -O2 it showed up:
root.exe: symbol lookup error: /direct/phenix+u/pinkenbu/workarea/sPHENIX/gitrepov5/install/lib/libsphenixnpc.so.0.0.0: undefined symbol: ZN15nopayloadclient15NoPayloadClient8makeRespIN8nlohmann10basic_jsonISt3mapSt6vectorNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEblmdSaNS2_14adl_serializerES5_IhSaIhEEEEEESF_T
[pinkenbu@sphnxdev01 CDBTest]$ c++filt ZN15nopayloadclient15NoPayloadClient8makeRespIN8nlohmann10basic_jsonISt3mapSt6vectorNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEblmdSaNS2_14adl_serializerES5_IhSaIhEEEEEESF_T
nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, bool, long, unsigned long, double, std::allocator, nlohmann::adl_serializer, std::vector<unsigned char, std::allocator > > nopayloadclient::NoPayloadClient::makeResp<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, bool, long, unsigned long, double, std::allocator, nlohmann::adl_serializer, std::vector<unsigned char, std::allocator > > >(nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, bool, long, unsigned long, double, std::allocator, nlohmann::adl_serializer, std::vector<unsigned char, std::allocator > >)
Googling pointed to similar problems, it was this template declaration:
template
json NoPayloadClient::makeResp(T msg) {
return {{"code", 0}, {"msg", msg}};
}
it needs to be explicitly instantiated in the .cpp file so the optimizer doesn't get rid of it. Just adding a single line:
template json NoPayloadClient::makeResp(json);
fixes this. This PR sits on top of my previous 2 PR's