how to change link order?

Sysprogs forums Forums VisualGDB how to change link order?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #25205
    runout
    Participant

    is there a way to change the Linkorder of the objects?
    I guess that issue comes from that.
    (use version 5.4R6 build 3190 – should doesn’t matter)

    compiling runs.
    the Linking Result is: undefined reference to…

    1>main.cpp
    1>Linking ../VisualGDB/Debug/EmBMWF4_XS01...
    1>VisualGDB/Debug/init_spi.o: In function `initSpi()':
    1>C:\tim\WorkspaceVS2017\EmBMWF4_XS01\lib\init_spi.cpp(55): error : undefined reference to `HAL_SPI_Init'
    1>VisualGDB/Debug/mtssp_driver_spi.o: In function `MtsspDriverSpi::write(unsigned char, unsigned char const*, int)':
    1>C:\tim\WorkspaceVS2017\EmBMWF4_XS01\lib\mtinterface\mtssp_driver_spi.cpp(59): error : undefined reference to `HAL_SPI_Transmit'
    1>C:\tim\WorkspaceVS2017\EmBMWF4_XS01\lib\mtinterface\mtssp_driver_spi.cpp(60): error : undefined reference to `HAL_SPI_Transmit'
    1>collect2.exe : error : ld returned 1 exit status
    1>Die Erstellung des Projekts "EmBMWF4_XS01.vcxproj" ist abgeschlossen -- FEHLER.
    ========== Erstellen: 0 erfolgreich, 1 fehlerhaft, 0 aktuell, 0 übersprungen ==========
    • This topic was modified 4 years, 9 months ago by support. Reason: formatting
    #25212
    support
    Keymaster

    The link order to the object should not cause any issues because VisualGDB automatically uses the linker groups that instruct the linker to find symbols in every object inside the group.

    Most likely, you have accidentally removed the implementation of HAL_SPI_Init() from your project. Please try searching all source files of the project for the “HAL_SPI_Init” text and ensure that the file implementing the function (i.e. providing a definition for it) is compiled and that the function implementation is not #ifdef-ed out.

    You can read more about the differences between function declarations and definitions in the following tutorial: https://visualgdb.com/tutorials/tips/externc/

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.