Thread: Dev C++: undefined reference to...

  1. #1
    Registered User
    Join Date
    Nov 2013
    Posts
    16

    Dev C++: undefined reference to...

    Hi guys,
    Im using Dev C++ tool. Im getting an error undefined reference to 'MQTTClient_create'.

    part of a code of source file(.c)
    Code:
    MQTTClient_create(&client, ADDRESS, CLIENTID,
            MQTTCLIENT_PERSISTENCE_NONE, NULL);
        conn_opts.keepAliveInterval = 20;
        conn_opts.cleansession = 1;
    part of a code of header file(.h)
    Code:
    DLLExport int MQTTClient_create(MQTTClient* handle, const char* serverURI, const char* clientId,
            int persistence_type, void* persistence_context);
    How to resolve this?
    Thanks

  2. #2
    Registered User
    Join Date
    Jun 2009
    Posts
    120
    MQTTClient_create is probably defined in some library which you need to link in the compiler options.

  3. #3
    Registered User
    Join Date
    Nov 2013
    Posts
    16
    Hi DRK,
    I've linked the library files. Still im getting this error..
    http://s22.postimg.org/qil0f122p/lib.png

  4. #4
    Registered User
    Join Date
    May 2009
    Posts
    4,035
    Educated guess, how is "DLLExport" defined?

    If it is a macro, did you define the right macro to get it defined correctly?

    Related question.
    1. Is the library providing the missing linking function static or shared (DLL)?
    2. Did you link the libraries in the correct order?

    Tim S.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help! Undefined Reference
    By halo3 in forum C++ Programming
    Replies: 10
    Last Post: 08-25-2009, 12:43 PM
  2. Undefined reference
    By TheEngineer in forum C Programming
    Replies: 17
    Last Post: 08-12-2009, 10:34 AM
  3. Undefined reference?
    By Tirith in forum C Programming
    Replies: 8
    Last Post: 08-11-2009, 02:39 PM
  4. undefined reference
    By B_Love in forum C++ Programming
    Replies: 6
    Last Post: 09-26-2005, 08:13 AM
  5. Undefined Reference
    By mmondok in forum C Programming
    Replies: 0
    Last Post: 02-18-2003, 12:15 PM

Tags for this Thread