Skip to content

Can't link wpcap.lib when using SOEM with cmake fetch_content #785

@limymy

Description

@limymy

MSVC is unable to link wpcap.lib when using this repository as a sub-project via the CMake fetch_content module. The error message is as follows:

[build] LINK : fatal error LNK1104: 无法打开文件“wpcap.lib” [E:\mycode\soem_test\build\cpp_test.vcxproj]

This issue may be related to the following lines in the CMakeLists.txt file:

SOEM/CMakeLists.txt

Lines 25 to 30 in 1817b8b

include_directories(oshw/win32/wpcap/Include)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
link_directories(${CMAKE_CURRENT_LIST_DIR}/oshw/win32/wpcap/Lib/x64)
elseif(CMAKE_SIZEOF_VOID_P EQUAL 4)
link_directories(${CMAKE_CURRENT_LIST_DIR}/oshw/win32/wpcap/Lib)
endif()

It appears that the directory is not being passed to the parent project.

Metadata

Metadata

Assignees

No one assigned

    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