What is the proper method for linking static libraries to our application’s code during the build phase? I originally looked at the app’s Makefile (by example, in the fsw/for_build directory of the app), where I would supply the linker flags in LOCAL_COPTS (where they would be placed first), or after SOURCES (to force the flags to appear last). Both of these options, however, have caused CFS to halt with an error: symbol lookup error: ./cf/apps/myApp.so: undefined symbol: someSymbol

When examining the output of make, I see that these flags only appear during the app’s compilation step, rather than the linking step where they need to be. Thus, it seems I need to modify something other than the app’s Makefile in order to link the static library. In what file would I put these flags? Would it be in $MISSION/build/cfe.mak?

Any insights would be extremely useful.

For reference, I need to pass both the static library libcsp.a and -lpthread as if it were the following (compile and link in one step, confirmed works as separate executable):

gcc $(INCLUDES) $(SOURCES) libcsp.a -lpthread

  • You must to post comments
Showing 0 results
Your Answer

Please first to submit.