Project has two files with the same name "timers.c". One is from LwIP and another from FreeRTOS. Compilier returns warning and errors.
Warning: L6304W: Duplicate input file .\debug\timers.o ignored. Error: L6218E: Undefined symbol sys_timeouts_mbox_fetch (referred from tcpip.o). Error: L6218E: Undefined symbol sys_timeouts_init (referred from init.o). Error: L6218E: Undefined symbol tcp_timer_needed (referred from tcp.o).
My solution is to rename one of files. But it is a bad practice since third-party libs should be unchanged. Is there way to change output name for only file?
Sorry, I don't think there is a simple work-around for this. What happens if you build one of the above libraries separately, and just link your project with the library file?
This is a situation where Keil still suffers from their herritage. In the 8051 world, few people bought libraries, and most projects was small with a quite limited number of source files.
But many of todays ARM microcontrollers are more similar to the Intel i486 processor - a processor that when introduced was much used in very expensive corporate servers.
Keil really should start to produce a full output directory tree to avoid object file name collisions.
Keil really MUST start to produce a full output directory tree to avoid object file name collisions. Projects grow as grass...
Compiling libraries is not the way. I frequently look to their sources to understand how it works, and take ideas for future code. Sometimes it is useful to compile library with DEBUG flags (for example UDP_DEBUG) to debug my higher level modules.
With a couple of exceptions, I too seldom use libraries with Keil, but when I use with other environments, I can have both release and debug builds of the library - and the debug builds contain debug information so the debugger can find the source code.
On a PC, you practically always link library files.
Next thing is that linking a library file doesn't stop you from looking at the library source code.
Thank you. It seems like you have good experience. I'm going to do as you tell.