Hey, Sorry - the linking may be necessary, but those are compiler errors, aren't they :)
Searching on google for some of the errors brought up an interesting discussion on stackoverflow.com: http://stackoverflow.com/questions/1372480/c-redefinition-header-files There may be some useful hints in those answers. Thanks, Shon On Wed, Jul 17, 2013 at 8:02 AM, Riskybiz <[email protected]> wrote: > Shon,**** > > are you able to expand on that please?**** > > ** ** > > “Hey,**** > > ** ** > > I'm guessing you need to link your dll against the 'ws2_32.lib' library. > **** > > ** ** > > Thanks,**** > > Shon”**** > > ** ** > > I found the WS_32.lib file here:**** > > ** ** > > C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Lib\WS_32.lib**** > > ** ** > > And tried to link it under Project Properties like so:**** > > ** ** > > Linker->General->Additional Library Dependencies-> C:\Program Files > (x86)\Boost\boost_1_53_0\stage\lib;**** > > C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Lib\WS_32.lib;**** > > C:\zeromq-3.2.3\lib\Win32**** > > ** ** > > Also tried:**** > > ** ** > > Linker->Input->AdditionalDependencies-> C:\Program Files (x86)\Microsoft > SDKs\Windows\v7.1A\Lib\WS2_32.lib**** > > C:\zeromq-3.2.3\lib\Win32\libzmq.lib**** > > ** ** > > Still getting a mass of errors on trying to build.**** > > ** ** > > Thanks,**** > > ** ** > > RiskyBiz**** > > ** ** > > > _________________________________________________________________________________________________________________________________________________ > **** > > ** ** > > Date: Tue, 16 Jul 2013 15:30:30 -0600**** > > From: Shon Love <[email protected]>**** > > Subject: Re: [zeromq-dev] Errors creating a DLL including ZeroMQ**** > > libraries**** > > To: ZeroMQ development list <[email protected]>**** > > Message-ID:**** > > < > capdi4c4clhe9v2hwueheziiv82meafgsa9g2mpkkkekpatv...@mail.gmail.com>**** > > Content-Type: text/plain; charset="windows-1252"**** > > ** ** > > Hey,**** > > ** ** > > I'm guessing you need to link your dll against the 'ws2_32.lib' library. > **** > > ** ** > > Thanks,**** > > Shon**** > > ** ** > > ** ** > > On Tue, Jul 16, 2013 at 3:18 PM, Riskybiz <[email protected]> wrote:** > ** > > ** ** > > > I?m creating a C++ DLL using Visual Studio 2012 and would like to use ** > ** > > > ZeroMQ libraries in it. I?ve basically taken the ZeroMQ example > ?hwserver?**** > > > Hello World Server and adapted it into a header file for use within my * > *** > > > DLL (Code below). Problem is that I get hundreds of warnings and **** > > > errors when trying to build the DLL; the errors are repetitious **** > > > referring to many different elements of the same header files:******** > > >** ** > > > ** ****** > > >** ** > > > Winsock2.h ???redeclaration cannot add dllexport/dllimport???******** > > >** ** > > > winsock2.h Macro redefinitions.******** > > >** ** > > > ws2def.h type redefinitions******** > > >** ** > > > ** ****** > > >** ** > > > etc etc etc??..******** > > >** ** > > > ** ****** > > >** ** > > > and sample errors below:******** > > >** ** > > > ** ****** > > >** ** > > > Warning 26 warning C4005: 'SOMAXCONN' : macro*** > * > > > redefinition C:\Program Files (x86)\Windows**** > > > Kits\8.0\Include\um\winsock2.h 506 1 > TestDataAccess****** > > > ****** > > >** ** > > > ** ****** > > >** ** > > > 125 IntelliSense: redeclaration cannot add dllexport/dllimport to > **** > > > "WSAUnhookBlockingHook" (declared at line 879 of "C:\Program Files**** > > > (x86)\Windows Kits\8.0\Include\um\winsock.h") c:\Program Files*** > * > > > (x86)\Windows Kits\8.0\Include\um\WinSock2.h 2381**** > > > 1 TestDataAccess******** > > >** ** > > > ** ****** > > >** ** > > > 79 IntelliSense: expected an identifier c:\Program > Files**** > > > (x86)\Windows Kits\8.0\Include\shared\ws2def.h 414**** > > > 5 TestDataAccess******** > > >** ** > > > ** ****** > > >** ** > > > Error 63 error C2375: 'WSAStartup' : redefinition;**** > > > different linkage C:\Program Files (x86)\Windows**** > > > Kits\8.0\Include\um\winsock2.h 2296 1 > TestDataAccess******* > > > ***** > > >** ** > > > ** ****** > > >** ** > > > ** ****** > > >** ** > > > I?ve already experimented with the ZeroMQ examples ?hwserver? Hello **** > > > World Server & `hwclient` Hello World Client. I can get the exe **** > > > application files for these examples to build and run OK on my PC **** > > > (Same machine as I?m using for the DLL).******** > > >** ** > > > ** ****** > > >** ** > > > ** ****** > > >** ** > > > It?s clear that something is significantly wrong here; does anyone **** > > > know what it could be? Or what steps are needed to build a DLL in **** > > > Visual Studio**** > > > 2012 using the ZeroMQ libraries. (Note: I?ve used Boost libraries in *** > * > > > the same manner, for a DLL, without all this trouble!)******** > > >** ** > > > ** ****** > > >** ** > > > ** ****** > > >** ** > > > Hope you can help,******** > > >** ** > > > ** ****** > > >** ** > > > With thanks,******** > > >** ** > > > ** ****** > > >** ** > > > Riskybiz.******** > > >** ** > > > ** ****** > > >** ** > > > Code I?m trying to build in a DLL:******** > > >** ** > > > ** ****** > > >** ** > > > ** ****** > > >** ** > > > #ifndef ZMQ_COMMUNICATIONS_H//if not defined already******** > > >** ** > > > #define ZMQ_COMMUNICATIONS_H//then define it******** > > >** ** > > > ******** > > >** ** > > > #include <zmq.hpp>******** > > >** ** > > > ******** > > >** ** > > > void ListenOnReplySocket()******** > > >** ** > > > {******** > > >** ** > > > // Prepare our context and socket******** > > >** ** > > > zmq::context_t context (1);******** > > >** ** > > > zmq::socket_t socket (context, ZMQ_REP);******** > > >** ** > > > socket.bind ("tcp://*:5555");******** > > >** ** > > > ******** > > >** ** > > > while (true)******** > > >** ** > > > {******** > > >** ** > > > zmq::message_t request;******** > > >** ** > > > ******** > > >** ** > > > // Wait for next request from client******** > > >** ** > > > socket.recv (&request);******** > > >** ** > > > ******** > > >** ** > > > char buffer[50];******** > > >** ** > > > int j;******** > > >** ** > > > j = sprintf_s(buffer, 50, "TestDataAccess: ZMQComms: Hello");******** > > >** ** > > > OutputDebugStringA(buffer);******** > > >** ** > > > ******** > > >** ** > > > ******** > > >** ** > > > // Do some 'work'******** > > >** ** > > > Sleep (1);******** > > >** ** > > > ******** > > >** ** > > > // Send reply back to client******** > > >** ** > > > zmq::message_t reply (5);******** > > >** ** > > > memcpy ((void *) reply.data (), "World", 5);******** > > >** ** > > > socket.send (reply);******** > > >** ** > > > }******** > > >** ** > > > }******** > > >** ** > > > #endif******** > > >** ** > > > ** ****** > > >** ** > > > ** ****** > > >** ** > > > _______________________________________________**** > > > zeromq-dev mailing list**** > > > [email protected]**** > > > http://lists.zeromq.org/mailman/listinfo/zeromq-dev**** > > >** ** > > >** ** > > ** ** > > ** ** > > --**** > > Shon C. Love**** > > Programmer**** > > -------------- next part --------------**** > > An HTML attachment was scrubbed...**** > > URL: > http://lists.zeromq.org/pipermail/zeromq-dev/attachments/20130716/6c817207/attachment-0001.htm > **** > > ** ** > > ------------------------------**** > > ** ** > > ** ** > > ** ** > > ** ** > > ** ** > > _______________________________________________ > zeromq-dev mailing list > [email protected] > http://lists.zeromq.org/mailman/listinfo/zeromq-dev > > -- Shon C. Love Programmer
_______________________________________________ zeromq-dev mailing list [email protected] http://lists.zeromq.org/mailman/listinfo/zeromq-dev
