lpcware

Libraries order inconsistant when changing configuration from Release to Debug

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by Xevel on Sat Mar 07 18:17:43 MST 2015
Hi,

I'm using LPCXpresso v7.6.0 [Build 321] [2015-01-26] on Windows 7 64bits Home Edition, up to date.
I started a workspace with the content of lpcopen_v2_00a_lpcxpresso_nxp_lpcxpresso_11c24.zip, then removed everything but the Chip and Board projects, then modified the board project, created some more libraries and applications.
I now have 3 libs (lpc_chip_11cxx_lib is as-is, and the other two rely on it, one being an adaptation of the Board project, and the other one completely new), and 4 applications, 3 that depend on all libraries and one that only depends on lpc_chip_11cxx_lib.

For all the applications, I ordered the libraries in Properties > C/C++ Build > Settings > Tool Settings > MCU Linker > Libraries as follows:
lib1
lib2
lpc_chip_11cxx_lib

Everywhere else where there are references to the library paths (library path, include path, ...), the order is the same.


Now I have the most disconcerting problem:
For only one of the application, (alphabetically, it's the second project in the workspace, but the first to rely on the 3 libs, the first project being the one that only relies on lpc_chip_11cxx_lib), when I change the configuration form Release to Debug, the chip library jumps at the top of the list in these lists (the exact name of the item that moves is in parenthesis at the end):

Properties > C/C++ Build > Settings > Tool Settings > MCU Compiler > Includes > Include Paths (-I) ("${workspace_loc:/lpc_chip_11cxx_lib}")
Properties > C/C++ Build > Settings > Tool Settings > MCU Assembler > General > Include Paths (-I) ("${workspace_loc:/lpc_chip_11cxx_lib}")
Properties > C/C++ Build > Settings > Tool Settings > MCU Linker > Libraries >Libraries (-l) (lpc_chip_11cxx_lib)
Properties > C/C++ Build > Settings > Tool Settings > MCU Linker > Libraries >Library search path (-L) ("${workspace_loc:/lpc_chip_11cxx_lib/Debug}")
Properties > C/C++ General > Paths and symbols > Includes > Additional Assembly Source Files > Include directories (/lpc_chip_11cxx_lib)
Properties > C/C++ General > Paths and symbols > Includes > Assembly > Include directories (/lpc_chip_11cxx_lib)
Properties > C/C++ General > Paths and symbols > Includes > GNU C > Include directories (/lpc_chip_11cxx_lib)
Properties > C/C++ General > Paths and symbols > Libraries (lpc_chip_11cxx_lib)
Properties > C/C++ General > Paths and symbols > Library Paths (/lpc_chip_11cxx_lib/Debug)


Note that "${workspace_loc:/lpc_chip_11cxx_lib/inc}" will NOT move in any of the "include directories" lists, but "${workspace_loc:/lpc_chip_11cxx_lib}" will happily jump at the top of its list.

Repeatability is 100% on this exact workspace content, I haven't tried on any other content because it's my first real LPCXpresso project.


Additional notes:

- Clearing all misc files does not change anything. I cleaned ALL files except .cproject, .project and source files (meaning I removed .metadata, all .settings, all Debug and Release folders), re-imported the projects, and it still happens.
- No impact if the order of the libs is changed in any way before changing the configuration from Debug to release then back to Debug.
- The other libs that rely on lpc_chip_11cxx_lib are affected too.
- The other applications are not affected.
- Only lpc_chip_11cxx_lib behaves that way. THe other libraries stay where I put them in the lists. Could it have something to do with the fact that everyone depends on lpc_chip_11cxx_lib (other libs and applications alike)?
- Release configuration keeps the order I set, whatever happens. Only Debug is affected by the change.
- As long as the configuration is not switched from Release to Debug, no problem.



This could easily be overlooked in many cases, but here it breaks the linking process of the affected application if lpc_chip_11cxx_lib is not the last in the list Properties > C/C++ Build > Settings > Tool Settings > MCU Linker > Libraries >Libraries (-l).

It might be something like the problem this person had : http://198.101.240.182/content/forum/libraries-search-path-chaos#comment-1142288

While it's not a deal-beaker, it IS annoying.

Outcomes