Skip to content

[question] No such file or directory in sub-dependency #29236

@Womps

Description

@Womps

What is your question?

Hello,

I'm trying to use net-snmp in my Windows C++ project with conan. I only want to consume this package. In the documentation, it is recommended to use a conanfile.txt for this.

I'm using the Conan version 2.23.0 and my default profile looks like this :

[settings]
arch=x86_64
build_type=Debug
compiler=msvc
compiler.cppstd=14
compiler.runtime=dynamic
compiler.version=194
os=Windows

My CMakeLists.txt looks like this :

cmake_minimum_required(VERSION 3.28)
project (MyApp LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(net-snmp REQUIRED CONFIG)

add_executable (MyApp
    src/main.cpp
    src/mib/MibManager.cpp
    src/mib/MibManager.h)

target_include_directories(MyApp PRIVATE src)

target_link_libraries(MyApp PRIVATE
    net-snmp::net-snmp
)

I install dependencies of my project using :

mkdir build && cd build
conan install ../ --build=missing

In my code, I'm including net-snmp headers using :

extern "C"
{
    #include <net-snmp/net-snmp-config.h>
    #include <net-snmp/net-snmp-includes.h>
}

When I try to build, either using my VS (using -DCMAKE_TOOLCHAIN_FILE), or via cmake directly in a command prompt, I get the following error :
C:\$HOME\.conan2\p\b\net-s5034841eeb4fb\p\include\net-snmp\library\scapi.h(14,10): error C1083: Cannot open included file : 'openssl/ossl_typ.h' : No such file or directory

I dont need openssl in my app, currently. Only net-snmp uses it in its dependencies. It looks like the toolchain does not set the include dirs or something like that. Can someone explain me what am I doing wrong here, please ?

Have you read the CONTRIBUTING guide?

  • I've read the CONTRIBUTING guide

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions