summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2025-06-04 22:15:10 +0800
committerErik Kundiman <erik@megapahit.org>2025-06-04 22:15:10 +0800
commit7be4892f658d2ac1a63c656bed4cb5628898be98 (patch)
tree2ee9dd0a8d28d7ea5f95dd9ff20ea3222de7a1a3
parentb7c12f52ef1848afec6e31ccea32ca86cd7ceef2 (diff)
Fix vcpkg Boost JSON linking errors
The error was "definition of dllimport static data member not allowed", and not "definition of dllimport function not allowed" as mentioned in commit 2bf9d234aac30ed4a85282730da0ffc83acf9adf description. Basically there were about 5 offending files, and all had BOOST_JSON_REQUIRE_CONST_INIT in them. Not including json/src.hpp (that includes them among others), fixes those errors, but then there are definitions in them that are actually used by llsdjson. After doing so many searches, I came across this: https://stackoverflow.com/questions/3491990/c-definition-of-dllimport-static-data-member and just from the first paragraph in the accepted answer, I realised llsdjson can still have those definitions, just not from the offending headers, but by simply linking to Boost JSON compiled library instead.
-rw-r--r--indra/cmake/Boost.cmake1
-rw-r--r--indra/llcommon/llsdjson.cpp2
2 files changed, 2 insertions, 1 deletions
diff --git a/indra/cmake/Boost.cmake b/indra/cmake/Boost.cmake
index 9ea1f6c9a6..764019408b 100644
--- a/indra/cmake/Boost.cmake
+++ b/indra/cmake/Boost.cmake
@@ -20,6 +20,7 @@ target_link_libraries( ll::boost INTERFACE
boost_context${sfx}
boost_fiber${sfx}
boost_filesystem${sfx}
+ boost_json${sfx}
boost_program_options${sfx}
boost_regex${sfx}
boost_system${sfx}
diff --git a/indra/llcommon/llsdjson.cpp b/indra/llcommon/llsdjson.cpp
index 655869a704..a3f80b7c2e 100644
--- a/indra/llcommon/llsdjson.cpp
+++ b/indra/llcommon/llsdjson.cpp
@@ -35,7 +35,7 @@
#include "llerror.h"
#include "../llmath/llmath.h"
-#include <boost/json/src.hpp>
+#include <boost/json.hpp>
//=========================================================================
LLSD LlsdFromJson(const boost::json::value& val)