|
|
Re: Adding a DLL to a C project for an embedded system [message #1707472 is a reply to message #1707464] |
Sat, 05 September 2015 01:15 |
David Vavra Messages: 1426 Registered: October 2012 |
Senior Member |
|
|
This doesn't sound like an issue associated with CDT or the IDE itself. I guess you were directed here because your question has something to do with C.
It's not completely clear what you are attempting to achieve. I'm assuming you want to generate a binary image for a microcontroller vs. a .exe formatted file. Normally the code for a microcontroller or an embedded processor would be self-contained and stand-alone. A DLL is a shared library and to use it requires runtime intervention. They are similar to .so files in linux which would require loading it into the microcontroller as well as your image.
I've done a lot of embedded work myself although I've not used your specific tools so can't tell you specifically how to proceed. You often would need a special linker or other tool to convert your object code into the image. I assume you already have that and know how to use it.
You probably want to use a statically linked library vs. depending on a DLL , though, so that all code is contained within the image file, This will avoid any need for an external relocatable library. My guess is that whatever is generating exe/SDS.out wants all calls to be resolved within the image. A statically linked library should achieve this.
HTH
EDIT:
Reread your question, you said: "Now I am trying to figure out how to link the .lib and/or .dll to the project ... I have tried a few different ways to do this but am not sure where in the make file to include the library or .dll."
The more pertinent question is how does whatever is producing the binary know where the lib files are?
Where did the makefile come from?
Does eclipse generate it or was it produced externally?
If it's Eclipse that generates the makefile then you should look at the tool settings in C/C++ Project Properties ==> Build ==> Settings ==> Tool Settings tab which allows you to configure individual commands that appear in the makefile recipes.
http://help.eclipse.org/mars/index.jsp?topic=%2Forg.eclipse.cdt.doc.user%2Freference%2Fcdt_u_prop_build_settings_tool.htm
If the makefile was produced externally, you need to examine the recipe that generates the binary image to determine how the files are linked.
[Updated on: Sat, 05 September 2015 14:15] Report message to a moderator
|
|
|
Re: Adding a DLL to a C project for an embedded system [message #1708212 is a reply to message #1707472] |
Mon, 14 September 2015 16:21 |
Christopher Koch Messages: 4 Registered: September 2015 |
Junior Member |
|
|
Thank you both for your replies.
Tauno, by not an executable, I did mean as David assumed that I am not generating an .exe file from eclipse but rather a .bin file that will be downloaded into the embedded microcontroller (uC) to run the code. An no I don't have windows running on the uC, but am using FreeRTOS.
David, I will try and figure out the makefile issue. I normally use a makefile that was produced externally. I will see if I can figure out how to link the .lib file through this. I have also had an issue with the other option of letting eclipse automatically generate the makefile, it always fails saying something like:
makefile:154: recipe for target 'clean' failed
or
mingw32-make: *** No rule to make target 'debug'. Stop.
Thanks again,
Chris
[Updated on: Mon, 14 September 2015 16:26] Report message to a moderator
|
|
|
Re: Adding a DLL to a C project for an embedded system [message #1708218 is a reply to message #1708212] |
Mon, 14 September 2015 17:01 |
David Vavra Messages: 1426 Registered: October 2012 |
Senior Member |
|
|
makefile:154: recipe for target 'clean' failed
That's just saying something went wrong during "make clean". For clean operations this often arises when trying to delete non-extant files. If this is the case then "rm -f" would fix this. But I don't let Eclipse generate the make files so can't be sure how to fix it.
Same with the missing target "debug". If Eclipse is generating the make file, it seems odd it would try to use a target it failed to create. However, this also occurs when using automake when it isn't configured properly. But then, if automake is in use, it is the generator of the make file.
Perhaps someone else can help here.
[Updated on: Mon, 14 September 2015 17:02] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03072 seconds