Closed Aistify closed 3 years ago
@Aistify it seems that there is an error in CMakeLists.txt file of the main component: https://github.com/Silvanosky/PositionEstimator/blob/22b0e785c00b2cc1ba031ad36e9c4b9ed0971a90/position/main/CMakeLists.txt#L1
The errors reported are for class ICM_20948, defined in ICM_20948.cpp. However the CMakeLists.txt file only compiles "Icm20948.cpp". It seems that other source files might also need to be compiled. For example, the missing FusionBiasInitialise
function is defined in FusionBias.c.
You have mentioned,
I've edited one of the CMakeLists.txt files to have proper extensions to fix some issues but I keep getting errors near the end.
However the file Position/main/CMakeLists.txt in the attached archive appears to be exactly the same as https://github.com/Silvanosky/PositionEstimator/blob/master/position/main/CMakeLists.txt.
Since this doesn't appear to be an issue in ESP-IDF project, I'll close this ticket. Please open the issue in the correct project for further support: https://github.com/Silvanosky/PositionEstimator/issues.
If you believe this is a bug in ESP-IDF, please feel free to provide more information and reopen the issue.
Undefined references fo functions usually mean that some of your source files are not compiled. You're using the include files that declare a function so you can reference it, but the linker is unable to find their definition when it links the final executable.
I suggest you go through the functions that appear undefined, find the source files (.c and .cpp, header files don't matter here) that contain their definition and see if they are compiled before. If they are not, then you need to add those files to the list of files to be compiled. This is done through the CMakeLists.txt of the component that contains them. See the docs for details.
Another scenario that can cause this is when you're mixing C code with C++. If you're trying to call a C function from a C++ source file, that function needs to be declared extern "C"
, otherwise the linker won't see it because of different calling conventions for C and C++. That will cause the same error message.
Undefined references fo functions usually mean that some of your source files are not compiled. You're using the include files that declare a function so you can reference it, but the linker is unable to find their definition when it links the final executable.
I suggest you go through the functions that appear undefined, find the source files (.c and .cpp, header files don't matter here) that contain their definition and see if they are compiled before. If they are not, then you need to add those files to the list of files to be compiled. This is done through the CMakeLists.txt of the component that contains them. See the docs for details.
Another scenario that can cause this is when you're mixing C code with C++. If you're trying to call a C function from a C++ source file, that function needs to be declared
extern "C"
, otherwise the linker won't see it because of different calling conventions for C and C++. That will cause the same error message.
I am getting the same problem, but I am not getting the long output as shown above, and yea, I have merged 2 codes, one is IPv6 from a git repo(Link is given below) and the second code is esp32 with google sheet(Link is attached), help please, and I am not sure that the IPv6 code is working correctly or not but I have managed to get serial output. take me as a very beginner in IDF, thank you
GitHub for IPv6: https://github.com/amitesh-singh/EspDDNS_with_IDF
ESP32 and Google Sheet automation: https://iotdesignpro.com/articles/esp32-data-logging-to-google-sheets-with-google-scripts
Environment
git describe --tags
to find it): // v4.1 and v4.2-238-g8cd16b60fxtensa-esp32-elf-gcc --version
to find it): // xtensa-esp32-elf-gcc (crosstool-NG esp-2020r3) 8.4.0Problem Description
I'm trying to build https://github.com/Silvanosky/PositionEstimator
I've edited one of the CMakeLists.txt files to have proper extensions to fix some issues but I keep getting errors near the end.
esptool.py v3.0 Generated C:/ESP/examples/Position/build/bootloader/bootloader.bin [934/935] Linking CXX executable Position.elf FAILED: Position.elf ...... (Full Log in "Other items if possible" section) collect2.exe: error: ld returned 1 exit status ninja: build stopped: subcommand failed. ninja failed with exit code 1
Expected Behavior
Project should finish building
Actual Behavior
Building fails near end
Steps to reproduce
// If possible, attach a picture of your setup/wiring here.
Code to reproduce this issue
Position.zip
Debug Logs
Log.txt
Other items if possible
build
folder (note this may contain all the code details and symbols of your project.)(This provides stacks of tasks.)