[zeromq-dev] Qt C++ Windows

Kevin Sapper kevinsapper88 at gmail.com
Tue Dec 20 09:54:18 CET 2016


Hi Eric,

Neat! Add good place to share is either the libzmq README.md or INSTALL 
file.

//Kevin

On Di, Dez 20, 2016 at 5:40 , Eric Gendron <conceptid at gmail.com> wrote:
> WOW!  it works!
> 
> I succeeded to compile with your instructions, also I succeeded to 
> run a test client in Qt.
> 
> Thank you very much, you are very helpful.
> 
> These instructions should replace the ones on the zeromq website...
> 
> But for the pathe, I needed to add the /bin too...
> 
> I wrote down the procedure I've used for all the process to execute a 
> test client on Qt Windows... Maybe I could share it somewhere?
> 
> 
> 
> On Sun, Dec 18, 2016 at 6:23 PM, Oleksii Zamiatin 
> <ozamiatin at mirantis.com> wrote:
>> Hi Eric
>> 
>> As a last chance I’d suggest to try CMake ;)
>> I’ve just got success with it on win10 x64 (32-bit build)
>> 
>> Install it from cmake official site (I’ve used 3.7.1 for x64 Msi 
>> installer)
>> 
>> I have MinGW in "C:\Qt\Tools\mingw491_32"
>> Put in on Windows’ PATH
>> after that check in cmd 'where g++ ‘ or something (—version)
>> 
>> clone libzmq:
>> 
>> git clone https://github.com/zeromq/libzmq.git
>> 
>> I’ve put it in:
>> f:\zmq\libzmq
>> 
>> after that i’ve created "f:\zmq\build" for out of source build.
>> 
>> f:\zmq\build> cmake ../libzmq -G "MinGW Makefiles" 
>> -DCMAKE_BUILD_TYPE=Debug
>> 
>> after this step prepared make files are in f:\zmq\build
>> 
>> just type
>> 
>> f:\zmq\build> mingw32-make.exe all
>> 
>> profit!
>> 
>> f:\zmq\build\lib - libraries to link to in Qt project
>> 
>> Please let me know if that helps
>> 
>> Thanks,
>> Oleksii
>> 
>>> 18 дек. 2016 г., в 23:43, Eric Gendron <conceptid at gmail.com> 
>>> написал(а):
>>> 
>>> No productive answer yet...
>>> 
>>> I just wonder if there is really someone who succeed to compile on 
>>> windows???  Following instructions on the website?
>>> 
>>> Is it possible for someone more experienced than me with windows to 
>>> try the instructions on website and give the correct procedure?
>>> 
>>> I search the solution for a month and spent a lot of time on this...
>>> 
>>> I need to be able to use 0mq in Qt C++ (no need to integrate in the 
>>> Qt philosophy).  Qt C++ use mingw on windows.
>>> 
>>> I succeed with ubuntu linux and freebsd with clang++
>>> 
>>> Thanks.
>>> 
>>> 
>>> On Dec 14, 2016 11:47 AM, "Eric Gendron" <conceptid at gmail.com> 
>>> wrote:
>>>> I retry all the process on a new machine... Windows10PRO 64bits 
>>>> (but I try all in 32bits).
>>>> 
>>>> I installed Qt Creator Open Source  in C:\Qt
>>>> 
>>>> and...
>>>> 
>>>> Following this:
>>>> 
>>>> http://zeromq.org/docs:windows-installations#toc2
>>>> 
>>>> What I've done:
>>>> 
>>>> Download 0mq sources here: http://zeromq.org/intro:get-the-software
>>>> Windows source 4.2 version
>>>> 
>>>> unzip in: c:\src\zeromq  (so I have subfolder builds, config, doc, 
>>>> include, m4, perf, src, test, tools...)
>>>> 
>>>> 
>>>> Download devkit on  http://rubyinstaller.org/downloads
>>>> version For use with Ruby 2.0 and above (32bits version only):
>>>> 
>>>> This one:    DevKit-mingw64-32-4.7.2-20130224-1151-sfx.exe
>>>> 
>>>> Execute the file and put the result in  c:\devkit
>>>> 
>>>> In a console, I've gone to:   C:\devkit
>>>> and I executed   devkitvars.bat
>>>> 
>>>> To  compile 0mq, always in console:
>>>> 
>>>> cd C:\src\zeromq
>>>> sh configure —prefix=C:/zeromq
>>>> make
>>>> 
>>>> ERROR MESSAGE HERE AND I'M STUCK.
>>>> c:\src\zeromq>make
>>>> Making all in doc
>>>> make[1]: Entering directory `/c/src/zeromq/doc'
>>>> make[1]: Nothing to be done for `all'.
>>>> make[1]: Leaving directory `/c/src/zeromq/doc'
>>>> make[1]: Entering directory `/c/src/zeromq'
>>>>   CXX      src/src_libzmq_la-address.lo
>>>> In file included from 
>>>> c:\devkit\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/include/iphlpapi.h:16:0,
>>>>                  from src/windows.hpp:58,
>>>>                  from src/precompiled.hpp:37,
>>>>                  from src/address.cpp:30:
>>>> c:\devkit\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/include/netioapi.h:44:3: 
>>>> error: 'SOCKADDR_INET' does not name a type
>>>> c:\devkit\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/include/netioapi.h:56:3: 
>>>> error: 'SOCKADDR_INET' does not name a type
>>>> c:\devkit\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/include/netioapi.h:64:3: 
>>>> error: 'SOCKADDR_INET' does not name a type
>>>> c:\devkit\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/include/netioapi.h:79:3: 
>>>> error: 'SOCKADDR_INET' does not name a type
>>>> c:\devkit\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/include/netioapi.h:152:3: 
>>>> error: 'SOCKADDR_INET' does not name a type
>>>> c:\devkit\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/include/netioapi.h:250:3: 
>>>> error: 'SOCKADDR_INET' does not name a type
>>>> c:\devkit\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/include/netioapi.h:251:3: 
>>>> error: 'SOCKADDR_INET' does not name a type
>>>> c:\devkit\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/include/netioapi.h:254:3: 
>>>> error: 'SOCKADDR_INET' does not name a type
>>>> c:\devkit\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/include/netioapi.h:273:3: 
>>>> error: 'SOCKADDR_INET' does not name a type
>>>> c:\devkit\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/include/netioapi.h:382:9: 
>>>> error: 'PSOCKADDR_IN6' does not name a type
>>>> c:\devkit\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/include/netioapi.h:384:9: 
>>>> error: 'PSOCKADDR_IN6' does not name a type
>>>> c:\devkit\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/include/netioapi.h:387:3: 
>>>> error: 'PSOCKADDR_IN6_PAIR' has not been declared
>>>> c:\devkit\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/include/netioapi.h:454:9: 
>>>> error: 'SOCKADDR_INET' does not name a type
>>>> c:\devkit\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/include/netioapi.h:455:9: 
>>>> error: 'SOCKADDR_INET' does not name a type
>>>> c:\devkit\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/include/netioapi.h:458:3: 
>>>> error: 'SOCKADDR_INET' has not been declared
>>>> In file included from 
>>>> c:\devkit\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/include/iphlpapi.h:16:0,
>>>>                  from src/windows.hpp:58,
>>>>                  from src/precompiled.hpp:37,
>>>>                  from src/address.cpp:30:
>>>> c:\devkit\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/include/netioapi.h:585:9: 
>>>> error: 'SOCKADDR_INET' does not name a type
>>>> In file included from src/windows.hpp:58:0,
>>>>                  from src/precompiled.hpp:37,
>>>>                  from src/address.cpp:30:
>>>> c:\devkit\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/include/iphlpapi.h:147:5: 
>>>> error: 'SOCKADDR_IN6' does not name a type
>>>> make[1]: *** [src/src_libzmq_la-address.lo] Error 1
>>>> make[1]: Leaving directory `/c/src/zeromq'
>>>> make: *** [all-recursive] Error 1
>>>> 
>>>> 
>>>> On Wed, Dec 14, 2016 at 7:12 AM, Eric Gendron 
>>>> <conceptid at gmail.com> wrote:
>>>>> I already tried to compile... with exactly this doc.... but it 
>>>>> gives me errors at make.
>>>>> 
>>>>> On Dec 14, 2016 3:32 AM, "Stuart Dootson" 
>>>>> <stuart.dootson at gmail.com> wrote:
>>>>>> On 13 December 2016 at 15:41, Eric Gendron <conceptid at gmail.com> 
>>>>>> wrote:
>>>>>>> Thanks for trying.
>>>>>>> 
>>>>>>> I have the same error: "cannot find -llibzmq_d" and if I remove 
>>>>>>> the _d part, same thing... cannot find -llibzmq
>>>>>>> 
>>>>>>> error: ld returned 1 exist status    collect2.exe
>>>>>>> 
>>>>>>> 
>>>>>>> My .pro:
>>>>>>> 
>>>>>>> QT += core
>>>>>>> QT -= gui
>>>>>>> 
>>>>>>> CONFIG += c++11
>>>>>>> 
>>>>>>> TARGET = hello
>>>>>>> CONFIG += console
>>>>>>> CONFIG -= app_bundle
>>>>>>> 
>>>>>>> TEMPLATE = app
>>>>>>> 
>>>>>>> INCLUDEPATH += C:/zmq/include
>>>>>>> INCLUDEPATH += C:/zmq/src
>>>>>>> INCLUDEPATH += C:/zmq/bin
>>>>>>> 
>>>>>>> CONFIG(debug, debug|release) {
>>>>>>> 
>>>>>>>     LIBS += -LC:/zmq/lib -llibzmq_d
>>>>>>> }
>>>>>>> 
>>>>>>> CONFIG(release, debug|release) {
>>>>>>> 
>>>>>>>     LIBS += -LC:/zmq/lib -llibzmq
>>>>>>> }
>>>>>>> 
>>>>>>> SOURCES += main.cpp \
>>>>>>>     guid.cpp
>>>>>>> 
>>>>>>> HEADERS += \
>>>>>>>     guid.h \
>>>>>>> 
>>>>>>> 
>>>>>>> The folder with zmq install:
>>>>>>> 
>>>>>>> C:\zmq
>>>>>>> with bin, doc, include, lib, src... subfolders.
>>>>>>> 
>>>>>>> I copied all the dll in c:\zmq\lib and I have:
>>>>>>> I also copied all the dll in the debug folder where the app 
>>>>>>> execute...
>>>>>>> 
>>>>>>> libzmq-v90-mt-4_0_4.lib (and .dll and .pdb)
>>>>>>> libzmq-v90-mt-gd-4_0_4.lib
>>>>>>> libzmq-v100-mt-gd_4_0_4.lib
>>>>>>> etc... for v110 and v120
>>>>>> 
>>>>>> So, the names of the lib files that you do have don't match the 
>>>>>> name you've used in the .pro file? That's a problem...
>>>>>> 
>>>>>> But a bigger problem is that you have DLLs and LIBs built for 
>>>>>> Visual Studio (that's what the v90/100/110, -mt- and -gd- 
>>>>>> imply). They aren't going to work well with your application 
>>>>>> written using mingw's g++ for various reasons (different name 
>>>>>> mangling, different C runtimes, to name two), so you're going to 
>>>>>> need a 0mq built with mingw (see 
>>>>>> http://zeromq.org/docs:windows-installations#toc2).
>>>>>> 
>>>>>> Stuart
>>>>>> 
>>>>>> 
>>>>>> _______________________________________________
>>>>>> zeromq-dev mailing list
>>>>>> zeromq-dev at lists.zeromq.org
>>>>>> https://lists.zeromq.org/mailman/listinfo/zeromq-dev
>>>> 
>>> 
>>> _______________________________________________
>>> zeromq-dev mailing list
>>> zeromq-dev at lists.zeromq.org
>>> https://lists.zeromq.org/mailman/listinfo/zeromq-dev
>> 
>> 
>> _______________________________________________
>> zeromq-dev mailing list
>> zeromq-dev at lists.zeromq.org
>> https://lists.zeromq.org/mailman/listinfo/zeromq-dev
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20161220/b56f80a6/attachment.htm>


More information about the zeromq-dev mailing list