Comments (3)
We need more information. We have an MSVC build but we don't see this error. Given the macro definition that you supplied above it isn't obvious why we don't see the error. Can you provide a minimal example, build commands, exact error messages, and/or build logs?
from abseil-cpp.
I would have thought you could disable this with -D _CRT_USE_BUILTIN_OFFSETOF
but I get
warning C4117: macro name '_CRT_USE_BUILTIN_OFFSETOF' is reserved, '#define' ignored
Edit: nvm that wouldn't make sense
from abseil-cpp.
Sorry, you're right! Here's a more detailed repro. It looks a little involved, but as far as I can tell, this is the canonical way to use Conan.
I have the following Conan profile (created by conan profile --detect --name debug
and changing build_type=Release
to build_type=Debug
:
arch=x86_64
build_type=Debug
compiler=msvc
compiler.cppstd=20
compiler.runtime=dynamic
compiler.version=193
os=Windows
Create a directory test
with conanfile.txt
:
[requires]
abseil/20230125.3
[generators]
CMakeDeps
CMakeToolchain
Run the following to install abseil via Conan:
test $ conan install . --build missing --output-folder conan-build-debug --profile debug
Create an example main.cpp
script to compile:
#include <absl/containers/flat_hash_map.h>
int main() { return 0; }
A CMakeLists.txt
:
cmake_minimum_required(VERSION 3.20)
set(CMAKE_CXX_STANDARD 20)
project(test)
add_executable(main main.cpp)
find_package(absl REQUIRED)
target_link_libraries(main abseil::abseil)
target_include_directories(main PRIVATE ${absl_INCLUDE_DIRS})
Run cmake
in a build directory, e.g. cmake-build-debug
. I've included the top of my output for reference:
test\cmake-build-debug $ cmake .. -DCMAKE_TOOLCHAIN_FILE=../conan-build-debug/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=debug
-- Building for: Visual Studio 17 2022
-- Using Conan toolchain: E:/Repositories/noahbkim/test/conan-build-debug/conan_toolchain.cmake
-- Conan toolchain: C++ Standard 20 with extensions OFF
-- The C compiler identification is MSVC 19.37.32824.0
-- The CXX compiler identification is MSVC 19.37.32824.0
...
Build; I've included output
test\cmake-build-debug $ cmake --build .
MSBuild version 17.7.2+d6990bcfa for .NET Framework
main.cpp
~\.conan2\p\b\abseiebe27282a3fe3\p\include\absl/strings/internal/cord_rep_flat.h(45,39): error C2131: e
xpression did not evaluate to a constant [test\cmake-build-debug\main.vcxproj]
~\.conan2\p\b\abseiebe27282a3fe3\p\include\absl/strings/internal/cord_rep_flat.h(45,39): message : a no
n-constant (sub-)expression was encountered [test\cmake-build-debug\main.vcxproj]
~\.conan2\p\b\abseiebe27282a3fe3\p\include\absl/strings/cord_buffer.h(327,31): error C2131: expression
did not evaluate to a constant [test\cmake-build-debug\main.vcxproj]
~\.conan2\p\b\abseiebe27282a3fe3\p\include\absl/strings/cord_buffer.h(327,31): message : failure was ca
used by non-constant arguments or reference to a non-constant symbol [test\cmake-build-debug\m
ain.vcxproj]
~\.conan2\p\b\abseiebe27282a3fe3\p\include\absl/strings/cord_buffer.h(327,31): message : see usage of '
absl::lts_20230125::CordBuffer::Rep::Short::raw_size' [test\cmake-build-debug\main.vcxproj]
from abseil-cpp.
Related Issues (20)
- [Bug]: AddressSanitizer error using flat_hash_set HOT 1
- [Bug]: Add Privacy Manifest HOT 1
- [Bug]: Unit tests fails to compile using LTS 20240116.0 HOT 1
- [cmake] Cannot find libabsl_scoped_set_env.so
- [Bug]: Problems with inline namespaces in 20240116 HOT 7
- [Bug]: inlined_vector implicitly assumes Pointer<A> is a native pointer type
- [Bug]: missing Mutex::Dtor on linux? HOT 17
- [Bug]: Parameter pack workaround fails with nvcc HOT 17
- [Bug]: Missing constructor for `absl::synchronization_internal::KernelTimeout` in shared builds HOT 5
- [Bug]: Constexpr expansion compilation error with GCC's UndefinedBehaviorSanitizer HOT 5
- [Bug]: internal/hash.h failed to compile in C++17 on GCC 7 HOT 1
- [Bug]: -Wmaybe-uninitialized warnings in InlinedVector
- [Bug]: Proto_library fails to build with abseil-cpp version = "20240116.0" HOT 2
- [Bug]: Unusable for installable projects whose other dependencies also define a `check` target HOT 3
- Resolving linking order is a nightmare on alpine HOT 4
- mismatched types โabsl::lts_2020_09_23::FormatSpec<Args ...>โ and โconst char [34]โ HOT 1
- [Bug]: Compilation error on mac: xcode command line interface 15.3
- [Bug]: Make absl::InitializeLog safe to be called multiple times
- [Bug]: Cant compile app on windows with MinGW that use Absl::Flags target.
- [Bug]: Can't build on macOS: `'linux/futex.h' file not found`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from abseil-cpp.