Unable to build mosquito library on windows

857 views
Skip to first unread message

Pankaj Kushwaha

unread,
Sep 18, 2015, 2:17:22 AM9/18/15
to MQTT
Hi,

I want to use mosquitto in one of my windows app.
To achieve this, I followed below steps-
1) Downloaded the source code from http://mosquitto.org/download/
2) Instaled Win32 OpenSSL v1.0.2d.exe from http://slproweb.com/products/Win32OpenSSL.html
3) From ftp://sourceware.org/pub/pthreads-win32 downloaded pthreads-w32-2-9-1-release.zip
4) Copied D:\pthreads-w32-2-9-1-release\Pre-built.2\dll\x64\pthreadVC2.dll to D:\mosquitto_required_libs
5) Copied C:\OpenSSL-Win32\bin\libeay32.dll and C:\OpenSSL-Win32\bin\ssleay32.dllto D:\mosquitto_required_libs
6) Added path D:\mosquitto_required_libs\ in system variables
7) Used cmake for D:\mosquitto-1.4.3 to generate .sln (its showed a warning "c-ares library not found" which I am neglected, as mosquitto.sln was generated successfully
8) Now I opened this file in Visual Studio 2015 RC running on windows 1- technical preview build.
9) When I tried building the solution, it showed below errors-
    i) Error C1189 #error:  Macro definition of snprintf conflicts with Standard Library function declaration libmosquitto C:\Program Files (x86)\Windows Kits\10\Include\10.0.10056.0\ucrt\stdio.h 1927
    ii) Error C1083 Cannot open include file: 'pthread.h': No such file or directory libmosquitto D:\mosquitto-1.4.3\lib\mosquitto_internal.h 34
10) Then I copied all headre files from D:\pthreads-w32-2-9-1-release\Pre-built.2\include\ to D:\mosquitto-1.4.3\lib\ and after building solution it showed below errors-
    i) Error C1189 #error:  Macro definition of snprintf conflicts with Standard Library function declaration libmosquitto C:\Program Files (x86)\Windows Kits\10\Include\10.0.10056.0\ucrt\stdio.h
    ii) Error C2011 'timespec': 'struct' type redefinition libmosquitto D:\mosquitto-1.4.3\lib\pthread.h

I also tried using /NODEFAULTLIB in linker, but still I was't able to build it.

Can someone please help me over this ?

Thanks
Pankaj Kushwaha

Nicholas O'Leary

unread,
Sep 18, 2015, 2:19:28 AM9/18/15
to MQTT

You may want to use the mosquito mailing list for that sort of detailed question. This list is about the protocol, not individual implementations.

Nick


--
To learn more about MQTT please visit http://mqtt.org
---
You received this message because you are subscribed to the Google Groups "MQTT" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mqtt+uns...@googlegroups.com.
To post to this group, send email to mq...@googlegroups.com.
Visit this group at http://groups.google.com/group/mqtt.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages