I am using the mosquitto library in my Qt-Widget-Application under Linux with success. I wanted to do the same for Windows 7 MSVC2015 x64 but I am getting linker errors which I don't understand.
Using this snippet in my .pro-file where C:\mosquitto is the path to the downloaded and precompiled lib (.dll). The folder devel contains the headers and the .lib-files.
INCLUDEPATH += C:/mosquitto/devel
DEPENDPATH += C:/mosquitto/devel
LIBS += -LC:/mosquitto/devel -LC:/mosquitto -lmosquitto -lmosquittopp
I am getting linker errors to 14 unresolved symbols as if there were no libs at all. I can remove the line "LIBS" and will not get more unresolved symbols. If I misspell some paths or names in the LIBS-Variable I get the error that mosquitto.lib isn't found - so the paths are generally correct.
One hint could be the warning from the linker: library machine type 'X86' conflicts with target machine type 'x64'
. So I compiled the library sources by hand in x64. After that the same appears with only one unresolved symbol. Why?
I don't get the clue. Under Linux it was relatively easy. Am I in trouble with 32/64bit? Or is there some other dependency that I missed?
Update:
The unresolved symbol with the -hopefully correctly compiled- x64-version is public: virtual void __cdecl mosqpp::mosquittopp::on_message(struct mosqpp::mosquitto_message const *)
. At the moment I only open and publish to a MQTT-Connection: I am not using on_message(...) explicitly.