Undefined reference to UDS functions
Posted: Wed 21. Apr 2021, 15:00
Heya,
I will be brief - my environment is Windows 10, CodeBlocks and mingw-w64. I created a C static library with 1 .h file and 1 .c file.
UDS_t.h has:
UDS_t.c has:
I include this static library in new C++ console application, along with "Win32/PCAN-UDS.lib" and "x64/PCAN-UDS.lib". Console application's main function only calls
On compile, I get an error undefined reference to 'UDS_Initialize_2013'.
AFAIK function definitions are in .lib file that I included - so why does it not see it?
I am losing 1 full day on this, so I decided to ask for help.
I will be brief - my environment is Windows 10, CodeBlocks and mingw-w64. I created a C static library with 1 .h file and 1 .c file.
UDS_t.h has:
Code: Select all
#include "UDS/PCAN-UDS_2013.h"
#ifdef __cplusplus
extern "C" {
#endif
void test();
#ifdef __cplusplus
}
#endif
Code: Select all
#include <stdio.h>
#include <stdlib.h>
#include "UDS/UDS_t.h"
void test()
{
uds_status retval = UDS_Initialize_2013(PCANTP_HANDLE_USBBUS1, PCANTP_BAUDRATE_500K, 0, 0, 0);
}
Code: Select all
test();
AFAIK function definitions are in .lib file that I included - so why does it not see it?
I am losing 1 full day on this, so I decided to ask for help.
