(solved) problem converting C program to C++
Posted: Thu Dec 27, 2018 7:52 pm
Hi all -
I was hoping not to have to drag this subject up again, but...I've reviewed my old posts on this topic and can't find what I'm doing wrong.
I began with a copy of a C project (https://github.com/OLIMEX/ESP32-POE/tre ... E_Ethernet) and renamed the two C files to .cpp. I added the extern "C" linkage as follows:
and did the same for olimex_ethernet.cpp and olimex_ethernet.h. Ran a make using msys2, and got this error:
I was hoping not to have to drag this subject up again, but...I've reviewed my old posts on this topic and can't find what I'm doing wrong.
I began with a copy of a C project (https://github.com/OLIMEX/ESP32-POE/tre ... E_Ethernet) and renamed the two C files to .cpp. I added the extern "C" linkage as follows:
Code: Select all
extern "C" void app_main(void)
{
...
Can someone remind me what I'm forgetting? Thanks.$ make
CXX build/main/main.o
AR build/main/libmain.a
LD build/ESP32-PoE.elf
C:/esp32_projects/esp32_poe_ethernet/build/main\libmain.a(main.o):(.literal.app_main+0x28): undefined reference to `testEthernet'
C:/esp32_projects/esp32_poe_ethernet/build/main\libmain.a(main.o): In function `app_main':
C:/esp32_projects/esp32_poe_ethernet/main/main.cpp:64: undefined reference to `testEthernet'