Skip to content

Cmake build of project crashing after including 1DS libs and header files #1045

@finalreq

Description

@finalreq

Hi all,

I hope this is the correct place to post this question. I've managed to build this code base inside visual studio 19 and now I'm trying to import it into a simple C++ hello world application that is being build by cmake (I'm trying to test our E2E functionality of getting data all the way to geneva before importing it into our actual codebase). It seems like no matter what I do a cmake build of the hello world program crashes with the following error: main.obj : error LNK2001: unresolved external symbol evt_api_call_default. The program doesn't actually make any calls to the code. All I'm trying to do for now is #inlclude "LogManager.hpp" and I get that error.

As far as I can tell, I've included all the libraries correctly in the CMakeLists.txt file as seen here:

cmake_minimum_required(VERSION 3.0)
add_executable(hworld main.cpp)
#project(hello_world)
find_library(ONEDS NAMES ClientTelemetry Microsoft.Applications.Telemetry.Windows.native zlib
                PATHS   D:/hworld/oneds/libs/EventSender
                        D:/hworld/oneds/libs/win10-lib
                        D:/hworld/oneds/libs/win32-lib
                        D:/hworld/oneds/libs/zlib
            )

target_link_libraries (hworld ${ONEDS})
target_include_directories(hworld PUBLIC ./oneds/public)
target_link_libraries(hworld ${CMAKE_THREAD_LIBS_INIT})

In searching for a solution to this, I came across an open PR about adding cmake build support to windows (#1011). Is the error happening because of this? Our code base in defender is built using cmake. We do not use visual studio for development.

Could you please let me know if I'm doing something wrong or if this is not possible for now because of the cmake build not being supported yet.

Thanks
Armin

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions