Adding DLL to Project
응답
15. 9. 3 오후 3:41
Hello,
I am trying to add a dll to the DSM_Demo project.  Does anyone have any experience with adding a .dll to the XDK Workbench environment or even the elcipse environment?  I did some research and most posts revolve around using Java or linking a .dll to an executable project.  Since I am trying to create a binary file to flash to the XDK this doesn't seem applicable.  I have tried two methods to compile the code with the .dll functions and both fail.

The first is to point to a premade makefile and compile the code.  When I do this i get the following error for each function I call from the .dll:

C:\XDK-Workbench\workspace\DSM_demoSensorMonitor\make/../MQTTSyncPub.c:76: undefined reference to `MQTTClient_create'

This indicates that the compiler can't find the function, which makes since since the premade makefile doesn't link the .dll file.  How can I manually add this link in the makefile?

The second attempt was to generate the makefile automatically.  However this following error occurs when I attempt this:

mingw32-make: *** No rule to make target 'debug'.  Stop.

How do I make a taget if I want to generate this makefile automatically?

Thank you for your help in advance,
Chris
0 (0 투표)
Adding DLL to Project
응답
15. 9. 8 오전 2:15 as a reply to Christopher Koch.
Dear Chris,

first of all, thanks for your question and welcome to the XDK Community.

I haven't tried this myself for the XDK, but used it in conjunction with a similar setup.
Generally what you want to do is to add the DLL to the eclipse build path and let the compiler figure out on how to use the DLL/what functions from the DLL can be made available.

I believe this is more a Eclipse feature than a XDK feature that needs to be supported on the XDK side.

A question on the side: Is the DLL specifically compiled for the XDK's Coretx architecture? Otherwise your DLL won't be compatible.

Let me know if you any other questions,
Florian
0 (0 투표)
Adding DLL to Project
응답
15. 9. 11 오후 4:15 as a reply to Florian Harr.
Florian,

Thanks for your response.  To answer your question, unfortunately no, the DLL is compiled with Visual Studio without any processor in mind, just the OS.  I will have to go about the solution in a different manner.

I am going to try and copy the dll source code and all it's header files into my XDK workbench project, making changes as necessary, in order to bypass the dll issue as a whole.

Thank you again,
Chris
0 (0 투표)
Adding DLL to Project
응답
15. 9. 12 오전 3:05 as a reply to Christopher Koch.
Hi Chris,

if your DLL has been compiled under Visual Studio without specific processor architectures in mind, there's more than a good chance that it wasn't compiled for the XDK's architecture.

Normally adding a DLL should work as you outlined through Eclipse.

Let me know if you have anything else we can help with and it would be interesting to see how you get along with your problem,
Florian
0 (0 투표)