Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dd-opentracing-cpp Win x64 - fatal error C1083: Cannot open include file: 'curl/curl.h': No such file or directory #265

Open
buzz3791 opened this issue Jul 17, 2023 · 2 comments

Comments

@buzz3791
Copy link

buzz3791 commented Jul 17, 2023

When building dd-opentracing-cpp on Windows x64 Visual Studio C++ 2022 using the instructions at [1]
I'm encountering the following error:
C:\Users\first.last\dd-opentracing-cpp\src\agent_writer.h(4,10): fatal error C1083: Cannot open include file: 'curl/curl.h': No such file or directory [C:\Users\first.last\dd-opentracing-cpp\.build\dd_opentracing.vcxproj]

I installed vcpkg, cmake, and ran all previous build steps successfully including
cmake -DCMAKE_TOOLCHAIN_FILE=%HOMEPATH%\vcpkg\scripts\buildsystems\vcpkg.cmake ..

But the following command is failing:
cmake --build . -- -p:Configuration=RelWithDebInfo
when trying to find third party include header files.
Build output:

C:\Users\first.last\dd-opentracing-cpp\.build>cmake --build . -- -p:Configuration=RelWithDebInfo
MSBuild version 17.4.0+18d5aef85 for .NET Framework
1>Checking Build System
Building Custom Rule C:/Users/first.last/dd-opentracing-cpp/CMakeLists.txt
agent_writer.cpp
C:\Users\first.last\dd-opentracing-cpp\src\agent_writer.h(4,10): fatal error C1083: Cannot open include file: 'curl/curl.h': No such file or directory [C:\Users\first.last\dd-opentracing-cpp\.build\dd_opentracing.vcxproj]
bool.cpp
dynamic_load.cpp
C:\Users\first.last\dd-opentracing-cpp\include\datadog/opentracing.h(19,10): fatal error C1083: Cannot open include file: 'opentracing/tracer.h': No such file or directory [C:\Users\first.last\dd-opentracing-cpp\.build\dd_opentracing.vcxproj]
encoder.cpp
C:\Users\first.last\dd-opentracing-cpp\include\datadog/opentracing.h(19,10): fatal error C1083: Cannot open include file: 'opentracing/tracer.h': No such file or directory [C:\Users\first.last\dd-opentracing-cpp\.build\dd_opentracing.vcxproj]
glob.cpp
C:\Users\first.last\dd-opentracing-cpp\src\glob.h(15,10): fatal error C1083: Cannot open include file: 'opentracing/string_view.h': No such file or directory [C:\Users\first.last\dd-opentracing-cpp\.build\dd_opentracing.vcxproj]
limiter.cpp
--snip---

1 - https://github.com/DataDog/dd-opentracing-cpp#datadog-opentracing-c-client

@buzz3791
Copy link
Author

I worked around the issue:

PS C:\Users\first.last\dd-opentracing-cpp> git diff .\CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt
index fc121ca..30964b8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -36,9 +36,12 @@ set(CMAKE_LIBRARY_PATH deps/lib)
# Dependencies
find_path(OPENTRACING_INCLUDE_DIR NAMES opentracing/tracer.h)
+include_directories(${OPENTRACING_INCLUDE_DIR})
find_library(OPENTRACING_LIB opentracing)
find_library(MSGPACK_LIB msgpack)
-find_package(CURL)
+find_path(CURL_INCLUDE_DIR curl/curl.h)
+include_directories(${CURL_INCLUDE_DIR})
+find_package(CURL CONFIG REQUIRED)
find_package(Threads REQUIRED)
# Code Sanitizers
PS C:\Users\first.last\dd-opentracing-cpp>

@dgoffredo
Copy link
Contributor

Thanks for leaving this detailed bug report together with its solution, @buzz3791. You also did the same in #266.

Windows builds are the least frequently tested part of this project. My teammate and I do not have ready access to Windows workstations, and our CI pipeline does not build or test on Windows. You've done us a favor by reporting and working around these build issues on Windows.

When we revisit Windows support (which it appears, from your investigations, we should soon), we'll integrate your changes or something like them. For now, I'm glad you found workarounds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants