Discussion:
[zeromq-dev] Qt C++ Windows
Eric Gendron
2016-12-12 12:14:35 UTC
Permalink
Hi

I succeed to use 0mq in linux and freebsd with clang++

Now I would like to compile the code in Qt C++ windows and I didn't succeed
to link with the 0mq library or even compile it.

I would like to know how to do it.

Qt can't find -lzmq in LIBS command in .pro file.

I tried to install 0mq 4.2 binaries windows 32 bits and copy zmq.hpp I
found in git in the same folder than .h

Also I have a message that zmq_msg_gets doesn't exist.

Really not easy to make it work.

Thanks.
Oleksii Zamiatin
2016-12-12 12:21:14 UTC
Permalink
Hi,
Which compiler do you use on Windows and how do you install zmq (build from sources)?
For MSVC the name of the library will be zmq.lib so -lzmq extracted to libzmq.a will point to non existent library.
-lzmq should work for MinGW, but I’d double check on pathes configuration.
Post by Eric Gendron
Hi
I succeed to use 0mq in linux and freebsd with clang++
Now I would like to compile the code in Qt C++ windows and I didn't succeed to link with the 0mq library or even compile it.
I would like to know how to do it.
Qt can't find -lzmq in LIBS command in .pro file.
I tried to install 0mq 4.2 binaries windows 32 bits and copy zmq.hpp I found in git in the same folder than .h
Also I have a message that zmq_msg_gets doesn't exist.
Really not easy to make it work.
Thanks.
_______________________________________________
zeromq-dev mailing list
https://lists.zeromq.org/mailman/listinfo/zeromq-dev
Eric Gendron
2016-12-12 12:30:51 UTC
Permalink
I used the windows install for 0mq.
I try to compile an hello world code...
I use Qt c++ with Qt creator and mingw compiler of course.

I even tried recompile 0mq with the python script or something like that on
the site... and make give me errors.

I do all in 32 bits to be sure.

My laptop is windows 7 pro 64 bits.

I can compile my code with clang++ in ubuntu linux or freebsd with binary
0mq.

I can compile in Qt creator in ubuntu with g++ too and binary for 0mq.


On Dec 12, 2016 7:21 AM, "Oleksii Zamiatin" <***@mirantis.com> wrote:

Hi,
Which compiler do you use on Windows and how do you install zmq (build from
sources)?
For MSVC the name of the library will be zmq.lib so -lzmq extracted to
libzmq.a will point to non existent library.
-lzmq should work for MinGW, but I’d double check on pathes configuration.
Post by Eric Gendron
Hi
I succeed to use 0mq in linux and freebsd with clang++
Now I would like to compile the code in Qt C++ windows and I didn't
succeed to link with the 0mq library or even compile it.
Post by Eric Gendron
I would like to know how to do it.
Qt can't find -lzmq in LIBS command in .pro file.
I tried to install 0mq 4.2 binaries windows 32 bits and copy zmq.hpp I
found in git in the same folder than .h
Post by Eric Gendron
Also I have a message that zmq_msg_gets doesn't exist.
Really not easy to make it work.
Thanks.
_______________________________________________
zeromq-dev mailing list
https://lists.zeromq.org/mailman/listinfo/zeromq-dev
Stuart Dootson
2016-12-12 15:16:06 UTC
Permalink
Post by Eric Gendron
I used the windows install for 0mq.
I try to compile an hello world code...
I use Qt c++ with Qt creator and mingw compiler of course.
I even tried recompile 0mq with the python script or something like that
on the site... and make give me errors.
I do all in 32 bits to be sure.
My laptop is windows 7 pro 64 bits.
I can compile my code with clang++ in ubuntu linux or freebsd with binary
0mq.
I can compile in Qt creator in ubuntu with g++ too and binary for 0mq.
Hi,
Which compiler do you use on Windows and how do you install zmq (build from sources)?
For MSVC the name of the library will be zmq.lib so -lzmq extracted to
libzmq.a will point to non existent library.
-lzmq should work for MinGW, but I’d double check on pathes configuration.
Post by Eric Gendron
Hi
I succeed to use 0mq in linux and freebsd with clang++
Now I would like to compile the code in Qt C++ windows and I didn't
succeed to link with the 0mq library or even compile it.
Post by Eric Gendron
I would like to know how to do it.
Qt can't find -lzmq in LIBS command in .pro file.
I tried to install 0mq 4.2 binaries windows 32 bits and copy zmq.hpp I
found in git in the same folder than .h
Post by Eric Gendron
Also I have a message that zmq_msg_gets doesn't exist.
Really not easy to make it work.
Thanks.
Eric - you're going to have to add some extra definitions in the pro file
for building on win32 - basically, you'll need to tell qmake where to find
the 0mq include and library paths. I'd use something like:

win32 {

INCLUDEPATH += *<path to your 0mq's include directory>*

LIBS += -lzmq -L*<path to your 0mq's lib directory>*

}


These qmake variables are documented at
http://doc.qt.io/qt-4.8/qmake-variable-reference.html#includepath and
http://doc.qt.io/qt-4.8/qmake-variable-reference.html#libs respectively.

Hope that helps

Stuart Dootson
Eric Gendron
2016-12-12 16:08:27 UTC
Permalink
Thanks for answer. I have already that in my .pro

INCLUDEPATH += C:/zmq/include

INCLUDEPATH += C:/zmq/src

INCLUDEPATH += C:/zmq/bin


win32: LIBS += -LC:/zmq/lib -lzmq
Post by Stuart Dootson
Post by Eric Gendron
I used the windows install for 0mq.
I try to compile an hello world code...
I use Qt c++ with Qt creator and mingw compiler of course.
I even tried recompile 0mq with the python script or something like that
on the site... and make give me errors.
I do all in 32 bits to be sure.
My laptop is windows 7 pro 64 bits.
I can compile my code with clang++ in ubuntu linux or freebsd with binary
0mq.
I can compile in Qt creator in ubuntu with g++ too and binary for 0mq.
Hi,
Which compiler do you use on Windows and how do you install zmq (build from sources)?
For MSVC the name of the library will be zmq.lib so -lzmq extracted to
libzmq.a will point to non existent library.
-lzmq should work for MinGW, but I’d double check on pathes configuration.
Post by Eric Gendron
Hi
I succeed to use 0mq in linux and freebsd with clang++
Now I would like to compile the code in Qt C++ windows and I didn't
succeed to link with the 0mq library or even compile it.
Post by Eric Gendron
I would like to know how to do it.
Qt can't find -lzmq in LIBS command in .pro file.
I tried to install 0mq 4.2 binaries windows 32 bits and copy zmq.hpp I
found in git in the same folder than .h
Post by Eric Gendron
Also I have a message that zmq_msg_gets doesn't exist.
Really not easy to make it work.
Thanks.
Eric - you're going to have to add some extra definitions in the pro file
for building on win32 - basically, you'll need to tell qmake where to find
win32 {
INCLUDEPATH += *<path to your 0mq's include directory>*
LIBS += -lzmq -L*<path to your 0mq's lib directory>*
}
These qmake variables are documented at http://doc.qt.io/qt-4.8/
qmake-variable-reference.html#includepath and http://doc.qt.io/qt-4.8/
qmake-variable-reference.html#libs respectively.
Hope that helps
Stuart Dootson
_______________________________________________
zeromq-dev mailing list
https://lists.zeromq.org/mailman/listinfo/zeromq-dev
Stuart Dootson
2016-12-13 10:22:32 UTC
Permalink
Post by Eric Gendron
Thanks for answer. I have already that in my .pro
INCLUDEPATH += C:/zmq/include
INCLUDEPATH += C:/zmq/src
INCLUDEPATH += C:/zmq/bin
win32: LIBS += -LC:/zmq/lib -lzmq
Post by Stuart Dootson
Post by Eric Gendron
I used the windows install for 0mq.
I try to compile an hello world code...
I use Qt c++ with Qt creator and mingw compiler of course.
I even tried recompile 0mq with the python script or something like that
on the site... and make give me errors.
I do all in 32 bits to be sure.
My laptop is windows 7 pro 64 bits.
I can compile my code with clang++ in ubuntu linux or freebsd with
binary 0mq.
I can compile in Qt creator in ubuntu with g++ too and binary for 0mq.
Hi,
Which compiler do you use on Windows and how do you install zmq (build from sources)?
For MSVC the name of the library will be zmq.lib so -lzmq extracted to
libzmq.a will point to non existent library.
-lzmq should work for MinGW, but I’d double check on pathes configuration.
Post by Eric Gendron
Hi
I succeed to use 0mq in linux and freebsd with clang++
Now I would like to compile the code in Qt C++ windows and I didn't
succeed to link with the 0mq library or even compile it.
Post by Eric Gendron
I would like to know how to do it.
Qt can't find -lzmq in LIBS command in .pro file.
I tried to install 0mq 4.2 binaries windows 32 bits and copy zmq.hpp I
found in git in the same folder than .h
Post by Eric Gendron
Also I have a message that zmq_msg_gets doesn't exist.
Really not easy to make it work.
Thanks.
Eric - you're going to have to add some extra definitions in the pro file
for building on win32 - basically, you'll need to tell qmake where to find
win32 {
INCLUDEPATH += *<path to your 0mq's include directory>*
LIBS += -lzmq -L*<path to your 0mq's lib directory>*
}
These qmake variables are documented at http://doc.qt.io/qt-4.8/qma
ke-variable-reference.html#includepath and http://doc.qt.io/qt-4.8/qm
ake-variable-reference.html#libs respectively.
Hope that helps
Stuart Dootson
I've just had a look at this again - it seems that on Windows, you need to
include the 'lib' prefix on the -l option. This means that (having a debug
variant for 0mq, as I do), I use:

CONFIG(debug, debug|release) {

LIBS += -L<path-on-my-computer>/zeromq/lib -llibzmq_d

}

CONFIG(release, debug|release) {

LIBS += -L<path-on-my-computer>/zeromq/lib -llibzmq

}


Stuart Dootson
Eric Gendron
2016-12-13 15:41:01 UTC
Permalink
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
Post by Stuart Dootson
Post by Eric Gendron
Thanks for answer. I have already that in my .pro
INCLUDEPATH += C:/zmq/include
INCLUDEPATH += C:/zmq/src
INCLUDEPATH += C:/zmq/bin
win32: LIBS += -LC:/zmq/lib -lzmq
On Mon, Dec 12, 2016 at 10:16 AM, Stuart Dootson <
Post by Stuart Dootson
Post by Eric Gendron
I used the windows install for 0mq.
I try to compile an hello world code...
I use Qt c++ with Qt creator and mingw compiler of course.
I even tried recompile 0mq with the python script or something like
that on the site... and make give me errors.
I do all in 32 bits to be sure.
My laptop is windows 7 pro 64 bits.
I can compile my code with clang++ in ubuntu linux or freebsd with
binary 0mq.
I can compile in Qt creator in ubuntu with g++ too and binary for 0mq.
Hi,
Which compiler do you use on Windows and how do you install zmq (build from sources)?
For MSVC the name of the library will be zmq.lib so -lzmq extracted to
libzmq.a will point to non existent library.
-lzmq should work for MinGW, but I’d double check on pathes configuration.
Post by Eric Gendron
Hi
I succeed to use 0mq in linux and freebsd with clang++
Now I would like to compile the code in Qt C++ windows and I didn't
succeed to link with the 0mq library or even compile it.
Post by Eric Gendron
I would like to know how to do it.
Qt can't find -lzmq in LIBS command in .pro file.
I tried to install 0mq 4.2 binaries windows 32 bits and copy zmq.hpp
I found in git in the same folder than .h
Post by Eric Gendron
Also I have a message that zmq_msg_gets doesn't exist.
Really not easy to make it work.
Thanks.
Eric - you're going to have to add some extra definitions in the pro
file for building on win32 - basically, you'll need to tell qmake where to
win32 {
INCLUDEPATH += *<path to your 0mq's include directory>*
LIBS += -lzmq -L*<path to your 0mq's lib directory>*
}
These qmake variables are documented at http://doc.qt.io/qt-4.8/qma
ke-variable-reference.html#includepath and http://doc.qt.io/qt-4.8/qm
ake-variable-reference.html#libs respectively.
Hope that helps
Stuart Dootson
I've just had a look at this again - it seems that on Windows, you need to
include the 'lib' prefix on the -l option. This means that (having a debug
CONFIG(debug, debug|release) {
LIBS += -L<path-on-my-computer>/zeromq/lib -llibzmq_d
}
CONFIG(release, debug|release) {
LIBS += -L<path-on-my-computer>/zeromq/lib -llibzmq
}
Stuart Dootson
_______________________________________________
zeromq-dev mailing list
https://lists.zeromq.org/mailman/listinfo/zeromq-dev
Stuart Dootson
2016-12-14 08:28:31 UTC
Permalink
Post by Eric Gendron
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
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 \
C:\zmq
with bin, doc, include, lib, src... subfolders.
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
Eric Gendron
2016-12-14 12:12:55 UTC
Permalink
I already tried to compile... with exactly this doc.... but it gives me
errors at make.
Post by Stuart Dootson
Post by Eric Gendron
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
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 \
C:\zmq
with bin, doc, include, lib, src... subfolders.
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
https://lists.zeromq.org/mailman/listinfo/zeromq-dev
Eric Gendron
2016-12-14 16:47:33 UTC
Permalink
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
Post by Eric Gendron
I already tried to compile... with exactly this doc.... but it gives me
errors at make.
Post by Stuart Dootson
Post by Eric Gendron
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
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 \
C:\zmq
with bin, doc, include, lib, src... subfolders.
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
https://lists.zeromq.org/mailman/listinfo/zeromq-dev
Eric Gendron
2016-12-15 12:22:23 UTC
Permalink
To make a test... I also downloaded 3.2.5 version and trying to compile...
I have error on nanosleep this time.

Are there really people that succeed to use it in Qt windows and mingw
compiler? I don't need it to be integrated to Qt philosophy... just being
able to use zeromq in C++ on windows with Qt app. My Qt app connect to
unix server. Working in Qt Linux... only windows the problem.

Are is there binary dll that is working?

I would like the latest version.

Here is the other error with 3.2.5


C:\src\zeromq-3.2.5>make
Making all in src
make[1]: Entering directory `/c/src/zeromq-3.2.5/src'
make all-am
make[2]: Entering directory `/c/src/zeromq-3.2.5/src'
CXX libzmq_la-address.lo
CXX libzmq_la-clock.lo
CXX libzmq_la-ctx.lo
CXX libzmq_la-decoder.lo
CXX libzmq_la-devpoll.lo
CXX libzmq_la-dist.lo
CXX libzmq_la-encoder.lo
CXX libzmq_la-epoll.lo
CXX libzmq_la-err.lo
CXX libzmq_la-fq.lo
CXX libzmq_la-io_object.lo
CXX libzmq_la-io_thread.lo
CXX libzmq_la-ip.lo
CXX libzmq_la-ipc_address.lo
CXX libzmq_la-ipc_connecter.lo
CXX libzmq_la-ipc_listener.lo
CXX libzmq_la-kqueue.lo
CXX libzmq_la-lb.lo
CXX libzmq_la-mailbox.lo
CXX libzmq_la-msg.lo
CXX libzmq_la-mtrie.lo
CXX libzmq_la-object.lo
CXX libzmq_la-options.lo
CXX libzmq_la-own.lo
CXX libzmq_la-pair.lo
CXX libzmq_la-pgm_receiver.lo
CXX libzmq_la-pgm_sender.lo
CXX libzmq_la-pgm_socket.lo
CXX libzmq_la-pipe.lo
CXX libzmq_la-poll.lo
CXX libzmq_la-poller_base.lo
CXX libzmq_la-pull.lo
CXX libzmq_la-push.lo
CXX libzmq_la-proxy.lo
CXX libzmq_la-reaper.lo
CXX libzmq_la-pub.lo
CXX libzmq_la-random.lo
CXX libzmq_la-rep.lo
CXX libzmq_la-req.lo
CXX libzmq_la-select.lo
CXX libzmq_la-session_base.lo
CXX libzmq_la-signaler.lo
CXX libzmq_la-socket_base.lo
CXX libzmq_la-stream_engine.lo
CXX libzmq_la-sub.lo
CXX libzmq_la-tcp.lo
CXX libzmq_la-tcp_address.lo
CXX libzmq_la-tcp_connecter.lo
CXX libzmq_la-tcp_listener.lo
CXX libzmq_la-thread.lo
CXX libzmq_la-trie.lo
CXX libzmq_la-xpub.lo
CXX libzmq_la-router.lo
CXX libzmq_la-dealer.lo
CXX libzmq_la-v1_decoder.lo
CXX libzmq_la-v1_encoder.lo
CXX libzmq_la-xsub.lo
CXX libzmq_la-zmq.lo
CXX libzmq_la-zmq_utils.lo
CXXLD libzmq.la
make[2]: Leaving directory `/c/src/zeromq-3.2.5/src'
make[1]: Leaving directory `/c/src/zeromq-3.2.5/src'
Making all in doc
make[1]: Entering directory `/c/src/zeromq-3.2.5/doc'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/c/src/zeromq-3.2.5/doc'
Making all in perf
make[1]: Entering directory `/c/src/zeromq-3.2.5/perf'
CXX local_lat.o
CXXLD local_lat.exe
CXX remote_lat.o
CXXLD remote_lat.exe
CXX local_thr.o
CXXLD local_thr.exe
CXX remote_thr.o
CXXLD remote_thr.exe
CXX inproc_lat.o
CXXLD inproc_lat.exe
CXX inproc_thr.o
CXXLD inproc_thr.exe
make[1]: Leaving directory `/c/src/zeromq-3.2.5/perf'
Making all in tests
make[1]: Entering directory `/c/src/zeromq-3.2.5/tests'
CXX test_pair_inproc.o
CXXLD test_pair_inproc.exe
CXX test_pair_tcp.o
CXXLD test_pair_tcp.exe
CXX test_reqrep_inproc.o
CXXLD test_reqrep_inproc.exe
CXX test_reqrep_tcp.o
CXXLD test_reqrep_tcp.exe
CXX test_hwm.o
CXXLD test_hwm.exe
CXX test_reqrep_device.o
CXXLD test_reqrep_device.exe
CXX test_sub_forward.o
CXXLD test_sub_forward.exe
CXX test_invalid_rep.o
CXXLD test_invalid_rep.exe
CXX test_msg_flags.o
CXXLD test_msg_flags.exe
CXX test_connect_resolve.o
CXXLD test_connect_resolve.exe
CXX test_connect_delay.o
test_connect_delay.cpp: In function 'int main()':
test_connect_delay.cpp:205:24: error: 'nanosleep' was not declared in this
scope
make[1]: *** [test_connect_delay.o] Error 1
make[1]: Leaving directory `/c/src/zeromq-3.2.5/tests'
make: *** [all-recursive] Error 1

C:\src\zeromq-3.2.5>
Post by Eric Gendron
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...
http://zeromq.org/docs:windows-installations#toc2
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
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
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,
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/../
'SOCKADDR_INET' does not name a type
c:\devkit\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/../
'SOCKADDR_INET' does not name a type
c:\devkit\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/../
'SOCKADDR_INET' does not name a type
c:\devkit\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/../
'SOCKADDR_INET' does not name a type
c:\devkit\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/../
'SOCKADDR_INET' does not name a type
c:\devkit\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/../
'PSOCKADDR_IN6' does not name a type
c:\devkit\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/../
'PSOCKADDR_IN6' does not name a type
c:\devkit\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/../
'PSOCKADDR_IN6_PAIR' has not been declared
c:\devkit\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/../
'SOCKADDR_INET' does not name a type
c:\devkit\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/../
'SOCKADDR_INET' does not name a type
c:\devkit\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/../
'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,
c:\devkit\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/../
'SOCKADDR_INET' does not name a type
In file included from src/windows.hpp:58:0,
from src/precompiled.hpp:37,
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
Post by Eric Gendron
I already tried to compile... with exactly this doc.... but it gives me
errors at make.
Post by Stuart Dootson
Post by Eric Gendron
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
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 \
C:\zmq
with bin, doc, include, lib, src... subfolders.
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
https://lists.zeromq.org/mailman/listinfo/zeromq-dev
Continue reading on narkive:
Loading...