mlorenzati / pico-rgb2hdmi

A microprocessed RGB to HDMI Converter with USB capture
MIT License
70 stars 11 forks source link

Undefined reference during build #31

Closed charlysan closed 1 year ago

charlysan commented 1 year ago

When trying to link integrationTest.elf I get an undefined reference to video_overlay_scanline_prepare error. Full log dump below:

/home/dev/build # cmake .. -DCMAKE_BUILD_TYPE=Debug && make
PICO_SDK_PATH is /usr/share/pico_sdk
PICO platform is rp2040.
Build type is Debug
Using regular optimized debug build (set PICO_DEOPTIMIZED_DEBUG=1 to de-optimize)
PICO target board is pico.
Using board configuration from /usr/share/pico_sdk/src/boards/include/boards/pico.h
TinyUSB available at /usr/share/pico_sdk/lib/tinyusb/src/portable/raspberrypi/rp2040; enabling build support for USB.
Compiling TinyUSB with CFG_TUSB_DEBUG=1
BTstack available at /usr/share/pico_sdk/lib/btstack
cyw43-driver available at /usr/share/pico_sdk/lib/cyw43-driver
Pico W Bluetooth build support available.
lwIP available at /usr/share/pico_sdk/lib/lwip
mbedtls available at /usr/share/pico_sdk/lib/mbedtls
-- Configuring done
-- Generating done
-- Build files have been written to: /home/dev/build
Scanning dependencies of target bs2_default
[  0%] Built target bs2_default
[  0%] Performing build step for 'PioasmBuild'
[100%] Built target pioasm
[  0%] No install step for 'PioasmBuild'
[  1%] Completed 'PioasmBuild'
[  1%] Built target PioasmBuild
[  1%] Built target rgbScan_wm8213Afe_pio_h
[  2%] Built target bs2_default_padded_checksummed_asm
Scanning dependencies of target rgbScanTest
Consolidate compiler generated dependencies of target rgbScanTest
[ 11%] Built target rgbScanTest
[ 11%] Built target libdvi_tmds_encode_1bpp_pio_h
[ 11%] Built target libdvi_dvi_serialiser_pio_h
Scanning dependencies of target hdmiTest
Consolidate compiler generated dependencies of target hdmiTest
[ 20%] Built target hdmiTest
Scanning dependencies of target afeTest
Consolidate compiler generated dependencies of target afeTest
[ 29%] Built target afeTest
Scanning dependencies of target keyboardTest
Consolidate compiler generated dependencies of target keyboardTest
[ 37%] Built target keyboardTest
Scanning dependencies of target storageTest
Consolidate compiler generated dependencies of target storageTest
[ 45%] Built target storageTest
[ 45%] Performing build step for 'ELF2UF2Build'
[100%] Built target elf2uf2
[ 45%] No install step for 'ELF2UF2Build'
[ 45%] Completed 'ELF2UF2Build'
[ 45%] Built target ELF2UF2Build
Scanning dependencies of target securityTest
Consolidate compiler generated dependencies of target securityTest
[ 53%] Built target securityTest
Scanning dependencies of target graphicsTest
Consolidate compiler generated dependencies of target graphicsTest
[ 62%] Built target graphicsTest
Scanning dependencies of target spriteTest
Consolidate compiler generated dependencies of target spriteTest
[ 72%] Built target spriteTest
Scanning dependencies of target guiTest
Consolidate compiler generated dependencies of target guiTest
[ 81%] Built target guiTest
Scanning dependencies of target integrationTest
Consolidate compiler generated dependencies of target integrationTest
[ 81%] Linking CXX executable integrationTest.elf
/usr/lib/gcc/arm-none-eabi/12.2.0/../../../../arm-none-eabi/bin/ld: CMakeFiles/integrationTest.dir/integrationTest.c.obj: in function `scanLineTriggered_8':
/home/dev/test/integrationTest/integrationTest.c:117: undefined reference to `video_overlay_scanline_prepare'
/usr/lib/gcc/arm-none-eabi/12.2.0/../../../../arm-none-eabi/bin/ld: CMakeFiles/integrationTest.dir/integrationTest.c.obj: in function `scanLineTriggered_16':
/home/dev/test/integrationTest/integrationTest.c:128: undefined reference to `video_overlay_scanline_prepare'
collect2: error: ld returned 1 exit status
make[2]: *** [test/integrationTest/CMakeFiles/integrationTest.dir/build.make:1638: test/integrationTest/integrationTest.elf] Error 1
make[1]: *** [CMakeFiles/Makefile2:2676: test/integrationTest/CMakeFiles/integrationTest.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

I've checked the imports and CMakeLists.txt file, but everything looks OK.

Any clues on what I might be missing here?

Thanks!

mlorenzati commented 1 year ago

Hi, long week, I did a clean CMAKE and make of the solution without issues. from the root project I just

mkdir build && cd build && cmake .. && make -j4

This compiled all without issues, just remember to set PICO_SDK_PATH

Attached logs.txt

Additionally setting the vscode environment it automatically set ups and builds everything

mlorenzati commented 1 year ago

video_overlay_scanline_prepare is an inline method part of the overlay.h used only in the integration test. CMakelist of integration test add overlay as a submodule, so it should work

charlysan commented 1 year ago

Thanks for double checking that. It looks like I had some issue in my build directory. After I removed the folder and re builded everything from scratch again, I got no errors.

I'm closing this issue.