fatal error: EthernetInterface.h: No such file or directory #446
Unanswered
NeitsabTeguom
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Hi, You may need to link mbed-emac explicitly: target_link_libraries(${PROJECT_NAME} PUBLIC mbed-os mbed-emac) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I'm working on converting my MBed OS (Mbed Studio) project to MBed CE (VSCode), i'm using a NUCLEO STM32F767ZI.
I followed the Wiki's instructions, but I can't get it to compile correctly.
I added add_subdirectory(mbed-os) to CMakeLists.txt.
I got an error during the build:
[build] D:/Perso/MyProject/main.cpp:2:10: fatal error: EthernetInterface.h: No such file or directory
[build] 2 | #include "EthernetInterface.h"
Any ideas?
Thanks
My CMake file:
cmake_minimum_required(VERSION 3.19)
cmake_policy(VERSION 3.19...3.22)
set(MBED_APP_JSON_PATH mbed_app.json5)
include(mbed-os/tools/cmake/mbed_toolchain_setup.cmake)
project(MyProject
# VERSION 1.0.0
LANGUAGES C CXX ASM)
include(mbed_project_setup)
add_subdirectory(mbed-os)
include_directories("${PROJECT_SOURCE_DIR}/")
file(GLOB LIB_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/lib/*")
foreach(dir ${LIB_INCLUDE_DIRS})
if(IS_DIRECTORY ${dir})
message(STATUS " - ${dir}")
include_directories(${dir})
endif()
endforeach()
file(GLOB_RECURSE LIB_SOURCES lib/.cpp)
file(GLOB_RECURSE LIB_HEADERS lib/.hpp)
set(SRC
${LIB_SOURCES}
${LIB_HEADERS}
)
add_executable(${PROJECT_NAME} main.cpp)
target_sources(${PROJECT_NAME} PRIVATE ${SRC})
target_link_libraries(${PROJECT_NAME} PUBLIC mbed-os) # Can also link to mbed-baremetal here
#target_link_libraries(${PROJECT_NAME} PUBLIC mbed-core-flags)
mbed_set_post_build(${PROJECT_NAME})
Beta Was this translation helpful? Give feedback.
All reactions