I have a development kit whose firmware was developed using standard C source code. From what I can tell the mbed-client-c code doesn’t provide the full mbed client but only part of the solution. So, I will need to used the standard mbed-client for my solution. This however builds a C++ library. I have tried various ways to link the C++ library with the C source code but I always get the same error indicating the functions calls to the library are not referenced. I am currently just trying to link a basic C++ library I created to test the process. I am using Eclipse IDE on a Windows 8 64 bit machine.
I am extremely new to understanding make files and how they operate so I know I am missing a step somewhere. Has anyone had any luck linking the C++ mbed-client with C source code? Could you give me any linking tips?
=> i took my guess form this text " get the same error indicating the functions calls to the library are not referenced"
if you add new module in yotta_module then you should make “source” folder. if not yotta couldn’t any object and linking all them (even if your source is in the yotta_module)
for ex :
your_module_dir
your_module_dir : header file will be here
source : copy your source file to this “source” folder
— your_src_folder_1
— your_src_folder_2
— your_src_folder_n
Thank you both for your replies. I am currently using Eclipse IDE to build the code. My plan is to build the mbed client libraries with yotta, then move these over to the Eclipse platform and link the libraries built with yotta to my C project. I feel like the SDK for the platform I am working with is already complete in Eclipse and that porting over this source and all of it’s library dependencies to yotta would be a large task for me.
As for creating the wrapper, my sample C++ library does exactly this and I have tried to link the code using both gcc and g++ but have had no luck. As I stated before I am very new to make files though and could potentially be doing something wrong there.
For reference here is the application.mk make file that does the linking,
where in settings.mk:
Build chain settings
ifneq (“$(wildcard $(TOOL_CHAIN_PATH))”,“”)
CC = $(TOOL_CHAIN_PATH)/arm-none-eabi-gcc
CPLUS = $(TOOL_CHAIN_PATH)/arm-none-eabi-g++
AR = $(TOOL_CHAIN_PATH)/arm-none-eabi-ar
OBJCOPY = $(TOOL_CHAIN_PATH)/arm-none-eabi-objcopy
else
CC = arm-none-eabi-gcc
CPLUS = arm-none-eabi-g++
AR = arm-none-eabi-ar
OBJCOPY = arm-none-eabi-objcopy
export BUILD_LINUX = 1
endif
RMDIRS := rm -rf
#The static libraries of the platform and third party sources are grouped here. Inorder to scan the libraries #for undefined reference again and again, the libraries are listed between the --start-group and --end-group.
DEBUG_LIBS_GROUP = -Wl,–start-group $(LIBS_DEBUG) $(THIRD_PARTY_LIBS) -Wl,–end-group
RELEASE_LIBS_GROUP = -Wl,–start-group $(LIBS_RELEASE) $(THIRD_PARTY_LIBS) -Wl,–end-group
#if the header file is changed, compiler considers the change in a header file and compiles. Here no need to clean the application #to take changes of header file during compilation
-include $(APP_DEPENDENCY_FILES)