diff --git a/examples/cpp_example.cpp b/examples/cpp_example.cpp index f491bb4..a5c62eb 100644 --- a/examples/cpp_example.cpp +++ b/examples/cpp_example.cpp @@ -66,7 +66,7 @@ void badEncoding() { std::string bstr = bech32::encode(hrp, data); } catch (std::exception &e) { - assert(strcmp(e.what(), "data value is out of range") == 0); + assert(std::string(e.what()) == "data value is out of range"); } } diff --git a/test/testbech32/CMakeLists.txt b/test/testbech32/CMakeLists.txt index 5771191..95380ea 100644 --- a/test/testbech32/CMakeLists.txt +++ b/test/testbech32/CMakeLists.txt @@ -20,6 +20,7 @@ add_executable(bech32_c_api_tests ) target_compile_features(bech32_c_api_tests PRIVATE c_std_99) +target_compile_options(bech32_c_api_tests PRIVATE "-fPIC") set_target_properties(bech32_c_api_tests PROPERTIES C_EXTENSIONS OFF) target_link_libraries(bech32_c_api_tests PUBLIC bech32)