Quantcast
Channel: WE MOVED to github.com/microsoft/cpprestsdk. This site is not monitored!
Viewing all articles
Browse latest Browse all 4845

Commented Unassigned: Static linking on linux [102]

$
0
0
Hi,

I made this changes to try to build a static version of casablanca :
```
diff --git a/Release/CMakeLists.txt b/Release/CMakeLists.txt
index 779d470..62e1491 100644
--- a/Release/CMakeLists.txt
+++ b/Release/CMakeLists.txt
@@ -69,6 +69,14 @@ elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fno-strict-aliasing")
set(STRICT_CXX_FLAGS ${WARNINGS} "-Werror -pedantic")
+
+ if(NOT BUILD_SHARED_LIBS)
+ add_definitions(
+ -D_NO_ASYNCRTIMP
+ -D_NO_PPLXIMP
+ )
+ message("-- Static compilation.")
+ endif()
else()
message("-- Unknown compiler, success is doubtful.")
endif()
```

But when I try to compile my service against casablanca I have this link error :

``` PowerShell
/usr/local/lib/casablanca/libcasablanca.a(asyncrt_utils.cpp.o): In function `utility::conversions::usascii_to_utf16(std::string const&)':
asyncrt_utils.cpp:(.text+0xd70): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> > boost::locale::conv::to_utf<char>(char const*, char const*, std::string const&, boost::locale::conv::method_type)'

/usr/local/lib/casablanca/libcasablanca.a(asyncrt_utils.cpp.o): In function `utility::conversions::latin1_to_utf16(std::string const&)':
asyncrt_utils.cpp:(.text+0xe60): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> > boost::locale::conv::to_utf<char>(char const*, char const*, std::string const&, boost::locale::conv::method_type)'

/usr/local/lib/casablanca/libcasablanca.a(asyncrt_utils.cpp.o): In function `std::basic_string<char, std::char_traits<char>, std::allocator<char> > boost::locale::conv::to_utf<char>(char const*, char const*, std::locale const&, boost::locale::conv::method_type)':
asyncrt_utils.cpp:(.text._ZN5boost6locale4conv6to_utfIcEESbIT_St11char_traitsIS3_ESaIS3_EEPKcS9_RKSt6localeNS1_11method_typeE[_ZN5boost6locale4conv6to_utfIcEESbIT_St11char_traitsIS3_ESaIS3_EEPKcS9_RKSt6localeNS1_11method_typeE]+0x18): undefined reference to `boost::locale::info::id'
asyncrt_utils.cpp:(.text._ZN5boost6locale4conv6to_utfIcEESbIT_St11char_traitsIS3_ESaIS3_EEPKcS9_RKSt6localeNS1_11method_typeE[_ZN5boost6locale4conv6to_utfIcEESbIT_St11char_traitsIS3_ESaIS3_EEPKcS9_RKSt6localeNS1_11method_typeE]+0x76): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> > boost::locale::conv::to_utf<char>(char const*, char const*, std::string const&, boost::locale::conv::method_type)'

/usr/local/lib/casablanca/libcasablanca.a(pplxlinux.cpp.o): In function `pplx::details::platform::YieldExecution()':
pplxlinux.cpp:(.text+0x21): undefined reference to `boost::this_thread::yield()'
```

Do I am missing to link against extra libraries ?

FYI : my service use Boost also internally and I also add definitions _NO_ASYNCRTIMP and _NO_PPLXIMP to my project

Thanks
Comments: I consider more relevant to discuss of this problem before openning this issue. I open this thread : https://casablanca.codeplex.com/discussions/542485 and so this issue can be closed.

Viewing all articles
Browse latest Browse all 4845

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>