Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Paho » Link DLL to C project for an embedded system
Link DLL to C project for an embedded system [message #1707293] Thu, 03 September 2015 14:11 Go to next message
Christopher Koch is currently offline Christopher KochFriend
Messages: 4
Registered: September 2015
Junior Member
I am working on a project where my goal is to create a binary file (not an executable) from C code to flash into a microcontroller in order for the system to act as a MQTT client. I am using PAHO as the backbone for the MQTT Client and have downloaded and compiled the .dll and .lib files for the MQTT client using Microsoft Visual Studio 15.0. I have taken the MQTTClient.h file and included it in my eclipse project. Now I am trying to figure out how to link the .lib and/or .dll to the project so that I can compile the C code and generate the binary file to flash to my embedded system. 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. Below is my current output:

10:05:13 **** Build of configuration Default for project DSM_demo****
mingw32-make debug
C:/Workbench/make\mingw32-make.exe -C C:/Workbench/SDK/make -j debug
make\mingw32-make.exe[1]: Entering directory 'C:/Workbench/SDK/make'
make\mingw32-make.exe[1]: Nothing to be done for 'debug'.
make\mingw32-make.exe[1]: Leaving directory 'C:/Workbench/SDK/make'
[ LD ] exe/SDS.out
build/MQTTSyncPub.o: In function `MQTTSyncPub':
C:\Workbench\workspace\DSM_demo\make/../MQTTSyncPub.c:76: undefined reference to `MQTTClient_create'
Makefile:94: recipe for target 'exe/SDS.out' failed
C:\Workbench\workspace\DSM_demo\make/../MQTTSyncPub.c:81: undefined reference to `MQTTClient_connect'
C:\Workbench\workspace\DSM_demo\make/../MQTTSyncPub.c:90: undefined reference to `MQTTClient_publishMessage'
C:\Workbench\workspace\DSM_demo\make/../MQTTSyncPub.c:94: undefined reference to `MQTTClient_waitForCompletion'
C:\Workbench\workspace\DSM_demo\make/../MQTTSyncPub.c:96: undefined reference to `MQTTClient_disconnect'
C:\Workbench\workspace\DSM_demo\make/../MQTTSyncPub.c:97: undefined reference to `MQTTClient_destroy'
collect2.exe: error: ld returned 1 exit status
mingw32-make: *** [exe/SDS.out] Error 1

Any help would be greatly appreciated. I am sorry if I haven't given enough information, please let me know anything else I need to include to help solve this issue.

Thank you in advance,
Chris
Re: Link DLL to C project for an embedded system [message #1710590 is a reply to message #1707293] Wed, 07 October 2015 18:24 Go to previous message
Rick Garber is currently offline Rick GarberFriend
Messages: 1
Registered: October 2015
Junior Member
Try to link these files in the libraries folder. Use the copy & paste method.
If you wan to convert your C code to Hex file and want to burn it into the microcontroller then sure you have the need of these files and you have to link them in the library.

http://www.7pcb.ca

[Updated on: Wed, 14 October 2015 17:14]

Report message to a moderator

Previous Topic:Post message automatically after connecting
Next Topic:How to check if a client has a continued persistent session with the broker?
Goto Forum:
  


Current Time: Fri Mar 29 14:55:29 GMT 2024

Powered by FUDForum. Page generated in 0.01999 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top