You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It only happens if I use "preinstalled" abseil AND if I usee C++17.
If I do add_subdirectory it works, or if I change to C++14 it also works.
Here's CMakeLists.txt
project(abseil-bug)
set(CMAKE_CXX_STANDARD 17)
# This works with 17
add_subdirectory(abseil-cpp)
# Fails with 17, works with 14
#set(abseil_prefix ${PROJECT_SOURCE_DIR}/abseil-cpp/install/)
#include(${abseil_prefix}/lib64/cmake/absl/abslConfig.cmake)
# Fails with 17, works with 14
#find_package(absl REQUIRED PATHS ${PROJECT_SOURCE_DIR}/abseil-cpp/install/)
add_executable(abseil-bug main.cpp)
target_link_libraries(abseil-bug absl::strings absl::str_format)
and here's main.cpp
#include "absl/strings/ascii.h"
#include "absl/strings/str_format.h"
int main()
{
std::string x = absl::StrFormat("Why? %s\n", absl::StripAsciiWhitespace(" foo "));
printf("%s\n", x.c_str());
}
and the Makefile that drives it all
default: all
.ONESHELL:
all: abseil-cpp
mkdir -p build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ../
make -j 8
abseil-cpp:
git clone --depth 1 https://github.com/abseil/abseil-cpp
cd abseil-cpp
mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=../install -DCMAKE_BUILD_TYPE=Release ../
make -j 8
make install
clean:
rm -rf abseil-cpp build
The text was updated successfully, but these errors were encountered:
I'm having issues linking with abseil when using a pre-installed abseil:
It only happens if I use "preinstalled" abseil AND if I usee C++17.
If I do
add_subdirectory
it works, or if I change to C++14 it also works.Here's
CMakeLists.txt
and here's
main.cpp
and the
Makefile
that drives it allThe text was updated successfully, but these errors were encountered: