Release build of ActiveMQ-CPP from trunk with Visual Studio 2005 fails due to
Windows headers include order issue
-----------------------------------------------------------------------------------------------------------------
Key: AMQ-1021
URL: https://issues.apache.org/activemq/browse/AMQ-1021
Project: ActiveMQ
Issue Type: Bug
Components: CMS (C++ client)
Affects Versions: 4.0.1
Environment: Windows
Reporter: Albert Strasheim
Doing a release build of ActiveMQ-CPP from trunk with Visual Studio 2005
results in the following error when compiling DataInputStreamTest.cpp:
{quote}
1>------ Build started: Project: vc2005-activemq-unittests, Configuration:
Release Win32 ------
1>Compiling...
1>DataInputStreamTest.cpp
1>f:\activemq-cpp\src\main\activemq/io/ByteArrayInputStream.h(142) : warning
C4244: 'return' : conversion from '__w64 int' to 'int', possible loss of data
1>C:\Program Files\Microsoft Platform SDK\Include\Winsock2.h(112) : error
C2011: 'fd_set' : 'struct' type redefinition
1> C:\Program Files\Microsoft Platform SDK\Include\winsock.h(54) : see
declaration of 'fd_set'
1>C:\Program Files\Microsoft Platform SDK\Include\Winsock2.h(147) : warning
C4005: 'FD_SET' : macro redefinition
1> C:\Program Files\Microsoft Platform SDK\Include\winsock.h(88) : see
previous definition of 'FD_SET'
1>C:\Program Files\Microsoft Platform SDK\Include\Winsock2.h(156) : error
C2011: 'timeval' : 'struct' type redefinition
1> C:\Program Files\Microsoft Platform SDK\Include\winsock.h(97) : see
declaration of 'timeval'
...
{quote}
This error happens when some combination of winsock.h, winsock2.h and windows.h
is included in the wrong order. The following change fixes the problem and
might provide some clue as to what is going on.
{quote}
Index: DataInputStreamTest.h
===================================================================
--- DataInputStreamTest.h (revision 470321)
+++ DataInputStreamTest.h (working copy)
@@ -21,10 +21,10 @@
#include <cppunit/TestFixture.h>
#include <cppunit/extensions/HelperMacros.h>
+#include <activemq/util/Endian.h>
#include <activemq/exceptions/ActiveMQException.h>
#include <activemq/io/BufferedInputStream.h>
#include <activemq/io/ByteArrayInputStream.h>
-#include <activemq/util/Endian.h>
#include <activemq/io/DataInputStream.h>
#ifdef min
{quote}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://issues.apache.org/activemq/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira