Reputation: 6727
Any idea about this error?
gcc -oxtmpmain.exe xtmpmain.o fiber_driver.o xtmp_options.o getopt.o D:\usr\xtensa\XtDevToolsDE\in stall\tools\RB-2008.4-win32\XtensaTools\lib\iss\xtmp.lib xtmpmain.o(.text+0x213):xtmpmain.c: undefined reference to `_uart_setup' xtmpmain.o(.text+0x2da):xtmpmain.c: undefined reference to `_uart_cleanup' collect2: ld returned 1 exit status make: *** [xtmpmain.exe] Error 1
Upvotes: 1
Views: 205
Reputation: 43356
It means that xtmpmain.c called functions named uart_setup()
and uart_cleanup()
, but they weren't found by the linker. You probably need to include a library, or to implement those functions for Windows in terms of the Win32 API.
Some "is it plugged in questions" are:
__cdecl
and __stdcall
are very different animals. They usually produce mismatched exported symbol names for safety, and this error can be a symptom of that.If this is a porting project, then it is likely that the original implementation of a UART-related function is written in a platform-dependent way. In that case, they often would be guarded by a #ifdef
of some form that depends on the compile-time platform.
To resolve that, you would need to implement them for this platform, in a style consistent with their usage in the rest of the application, and similarly guarded.
Upvotes: 1
Reputation: 400039
This is a plain linking error. You're calling two functions, uart_setup()
and uart_cleanup()
, that the linker is not finding.
There might be several causes, including (but certainly not limited to):
Without more detail, it's hard to tell for sure.
Upvotes: 4