You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Pravin Kundal <pr...@persistent.co.in> on 2007/05/18 14:08:07 UTC

Licensing and Porting Issue for the CMS (ActiveMQ-CPP) on Visual Studio 6 from Visual Studio 8

Licensing and Porting Issue for the CMS (ActiveMQ-CPP) on Visual Studio 6
from Visual Studio 8
	
I have downloaded activemq-cpp-2.0.1-src (i.e. CMS 2.0.1) from
http://activemq.apache.org/cms/download.html
It is provided with vs2005-build (Visual Studio 8). 
Now, as our project is in vs2003, I am trying to build (port) it in Visual
Studio 6, but I am getting following errors, which means I will need to make
some modifications like adding some typedefs or some fix to get around some
‘type’ issues that causes compiler errors under Visual Studio 6.

Snippet of few Errors in Visual Studio 6

--------------------Configuration: Consumer - Win32
Debug--------------------
Compiling...
main.cpp
c:\assigned_task\prototype\prototype\main\activemq\exceptions\activemqexception.h(107)
: error C2555: 'activemq::exceptions::ActiveMQException::clone' : overriding
virtual function differs from 'cms::CMSException::clone' only by return type
or calli
ng convention
        c:\assigned_task\prototype\prototype\main\cms\cmsexception.h(33) :
see declaration of 'CMSException'
c:\assigned_task\prototype\prototype\main\cms\deliverymode.h(37) : error
C2252: 'PERSISTENT' : pure specifier can only be specified for functions
c:\assigned_task\prototype\prototype\main\cms\deliverymode.h(38) : error
C2258: illegal pure syntax, must be '= 0'
c:\assigned_task\prototype\prototype\main\cms\deliverymode.h(38) : error
C2252: 'NON_PERSISTENT' : pure specifier can only be specified for functions
c:\assigned_task\prototype\prototype\main\cms\message.h(154) : error C2632:
'long' followed by 'long' is illegal
.
.
.
c:\assigned_task\prototype\prototype\main\cms\bytesmessage.h(54) : error
C2039: 'size_t' : is not a member of 'std'
c:\assigned_task\prototype\prototype\main\cms\bytesmessage.h(112) : error
C2039: 'size_t' : is not a member of 'std'
c:\assigned_task\prototype\prototype\main\cms\bytesmessage.h(149) : error
C2039: 'size_t' : is not a member of 'std'


Now as CMS (ActiveMQ-CPP) is the Apache 2.0 licensed, so do I need to
release it back to the community, the porting changes that I make to the
current CMS library which is Visual Studio 2005 build, OR I wont be able to
make the changes OR what other licensing issues may arise in our case.
PLEASE CLERIFY. 

-- 
View this message in context: http://www.nabble.com/Licensing-and-Porting-Issue-for-the-CMS-%28ActiveMQ-CPP%29-on-Visual-Studio-6-from-Visual-Studio-8-tf3777279s2354.html#a10680894
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Licensing and Porting Issue for the CMS (ActiveMQ-CPP) on Visual Studio 6 from Visual Studio 8

Posted by Timothy Bish <ta...@twcny.rr.com>.
Hi

Albert Strasheim wrote:
> Looking at the errors again, they are:
> 1. "differs only by return type" is due to the covariant return in 
> ActiveMQException. But building the AMQCPP part as DLL probably means 
> you don't see this anymore.
>
> 2. Something is going awry with the static constants in DeliveryMode. I 
> can't figure out why VS6 doesn't like those. As a quick workaround you 
> could just #if 0 them and use the literal values or a #define.
>
> 3. long followed by long is illegal is probably because VS6 doesn't 
> support the long long type. Not quite sure what do here. You should be 
> able to put an #if 0/#endif around that method so that the compiler 
> ignores it. But you won't be able to get long (as in Java long) 
> properties from the message.
>
> 4. 'size_t' : is not a member of 'std' might be due to CMS not including 
> some standard header that should strictly be there. Try adding
> #include <cstddef> to BytesMessage.h. Alternatively, it might be that 
> VS6's C++ implementation doesn't have size_t in std. You might be able 
> to fix this with something like:
>
> namespace std { typedef ::size_t size_t; }
>
> at the top of BytesMessage.h or by simply changing std::size_t to 
> size_t.
>
> With all these bits fixed, you might still run into problems (I could 
> be wrong... and I hope I am). The problem is this (I think). E.g.:
>
> Session* session = connection->createSession(...);
>
> createSession calls code in the VS2005-compiled DLL which is 
> dynamically linked to some version 8 of the Microsoft runtime. This 
> allocates the Session object on a heap specific to that runtime 
> library. Now when you do:
>
> delete session;
>
> in code compiled by VS6, that tries to remove the object from some heap 
> that belongs to some version 6 of the runtime. The object isn't on that 
> heap, so strange things will happen.
>
> For this to work right, I think the various CMS classes would have to 
> get methods like destroySession, etc. so that you can be sure that you 
> always new and free on the same heap when running on Windows.
>
> Anyway, I could be wrong. Anyone else? You can at least try to just 
> delete the stuff. If it blows up, my theory might explain why.
>
> Cheers,
>
> Albert
>
>   
If I recall correctly from my VC6 days in order to get STL working
reliably we had to actually use a third party STL package, STLPort I
think.  VC6's standards compliance is atrocious and there are a lot of
things missing from STL, and a lot that just don't work real well.  I
think that getting this to work in VC6 is going to be a very time
consuming task, almost as hard as getting it working in gcc v2.9.5 or
some other ancient compiler. 

tim




Re: Licensing and Porting Issue for the CMS (ActiveMQ-CPP) on Visual Studio 6 from Visual Studio 8

Posted by Nathan Mittler <na...@gmail.com>.
Sounds like we need to do this

+1 on adding destroy methods for cms resources (connection, session, etc).

On 5/25/07, Albert Strasheim <13...@sun.ac.za> wrote:
>
> Hello all
>
> On Fri, 25 May 2007, Albert Strasheim wrote:
>
> > Hello
> >
> > On Fri, 25 May 2007, Nathan Mittler wrote:
> >
> > > FYI, we're not planning on making any changes to activemq-cpp to
> address the
> > > shortcomings of other compilers.
> > >
> > > Regarding the destroy methods for deallocating amq-cpp resources, do
> you
> > > think this would be required for clients that are built with newer
> msvc
> > > compilers?  Would it also be a problem for gcc or just msvc?
> >
> > Firstly, I think this is a Microsoft compiler only problem.
>
> Correction. From the comments in the reference I posted, it seems you
> can also run into this problem when compiling some parts of your program
> with MSVS and other parts with something like Borland C++ Builder, since
> they apparently also have their own runtime library.
>
> Cheers,
>
> Albert
>

Re: Licensing and Porting Issue for the CMS (ActiveMQ-CPP) on Visual Studio 6 from Visual Studio 8

Posted by Albert Strasheim <13...@sun.ac.za>.
Hello all

On Fri, 25 May 2007, Albert Strasheim wrote:

> Hello
> 
> On Fri, 25 May 2007, Nathan Mittler wrote:
> 
> > FYI, we're not planning on making any changes to activemq-cpp to address the
> > shortcomings of other compilers.
> >
> > Regarding the destroy methods for deallocating amq-cpp resources, do you
> > think this would be required for clients that are built with newer msvc
> > compilers?  Would it also be a problem for gcc or just msvc?
> 
> Firstly, I think this is a Microsoft compiler only problem.

Correction. From the comments in the reference I posted, it seems you 
can also run into this problem when compiling some parts of your program 
with MSVS and other parts with something like Borland C++ Builder, since 
they apparently also have their own runtime library.

Cheers,

Albert

Re: Licensing and Porting Issue for the CMS (ActiveMQ-CPP) on Visual Studio 6 from Visual Studio 8

Posted by Albert Strasheim <13...@sun.ac.za>.
Hello

On Fri, 25 May 2007, Nathan Mittler wrote:

> FYI, we're not planning on making any changes to activemq-cpp to address the
> shortcomings of other compilers.
>
> Regarding the destroy methods for deallocating amq-cpp resources, do you
> think this would be required for clients that are built with newer msvc
> compilers?  Would it also be a problem for gcc or just msvc?

Firstly, I think this is a Microsoft compiler only problem.

Where most people run into this issue is when they try to use some code 
built in Debug mode together with some code built in Release mode. Your 
objects get allocated on a special debug heap when you create them in 
debug code, which allows the Microsoft runtime to debug all kinds of 
interesting error conditions.

However, you also run into this problem when you have different parts 
of your program compiled with different versions of Visual Studio. 
Although all your code might be built in release mode, depending on the 
runtime it is linked against (static link to MSVC 7.1 runtime, static 
link to MSVC 8.0, or dynamic link to 7.1 or 8.0), your objects end up 
on a different heap and deleting them in code that expects them on 
another heap blows up.

I've found a reference that discusses this issue in more detail:

http://blogs.msdn.com/oldnewthing/archive/2006/09/15/755966.aspx

Cheers,

Albert

Re: Licensing and Porting Issue for the CMS (ActiveMQ-CPP) on Visual Studio 6 from Visual Studio 8

Posted by Nathan Mittler <na...@gmail.com>.
FYI, we're not planning on making any changes to activemq-cpp to address the
shortcomings of other compilers.

Regarding the destroy methods for deallocating amq-cpp resources, do you
think this would be required for clients that are built with newer msvc
compilers?  Would it also be a problem for gcc or just msvc?

Thanks,
Nate


With all these bits fixed, you might still run into problems (I could
> be wrong... and I hope I am). The problem is this (I think). E.g.:
>
> Session* session = connection->createSession(...);
>
> createSession calls code in the VS2005-compiled DLL which is
> dynamically linked to some version 8 of the Microsoft runtime. This
> allocates the Session object on a heap specific to that runtime
> library. Now when you do:
>
> delete session;
>
> in code compiled by VS6, that tries to remove the object from some heap
> that belongs to some version 6 of the runtime. The object isn't on that
> heap, so strange things will happen.
>
> For this to work right, I think the various CMS classes would have to
> get methods like destroySession, etc. so that you can be sure that you
> always new and free on the same heap when running on Windows.
>
> Anyway, I could be wrong. Anyone else? You can at least try to just
> delete the stuff. If it blows up, my theory might explain why.
>
> Cheers,
>
> Albert
>

Re: Licensing and Porting Issue for the CMS (ActiveMQ-CPP) on Visual Studio 6 from Visual Studio 8

Posted by Albert Strasheim <13...@sun.ac.za>.
Hello all

On Fri, 25 May 2007, Some user wrote:

> Hi Albert!
> 
> >>but maybe we should rather spend some 
> >>time getting AMQCPP to build as a DLL with VC++ 2005 Express (which is 
> >>free to use, even for commercial applications) which you can then link 
> >>into your VS6-compiled applications.
> 
> build dll on 2005 goes fine, however, my application on VS6 anyways fails
> compilation when I include the cms headers, the compilation errors are again
> the same mentioned in the original post by pravin.
> 
> Has anyone before tried compiling/running a sample code on VS6?

Looking at the errors again, they are:

1. "differs only by return type" is due to the covariant return in 
ActiveMQException. But building the AMQCPP part as DLL probably means 
you don't see this anymore.

2. Something is going awry with the static constants in DeliveryMode. I 
can't figure out why VS6 doesn't like those. As a quick workaround you 
could just #if 0 them and use the literal values or a #define.

3. long followed by long is illegal is probably because VS6 doesn't 
support the long long type. Not quite sure what do here. You should be 
able to put an #if 0/#endif around that method so that the compiler 
ignores it. But you won't be able to get long (as in Java long) 
properties from the message.

4. 'size_t' : is not a member of 'std' might be due to CMS not including 
some standard header that should strictly be there. Try adding
#include <cstddef> to BytesMessage.h. Alternatively, it might be that 
VS6's C++ implementation doesn't have size_t in std. You might be able 
to fix this with something like:

namespace std { typedef ::size_t size_t; }

at the top of BytesMessage.h or by simply changing std::size_t to 
size_t.

With all these bits fixed, you might still run into problems (I could 
be wrong... and I hope I am). The problem is this (I think). E.g.:

Session* session = connection->createSession(...);

createSession calls code in the VS2005-compiled DLL which is 
dynamically linked to some version 8 of the Microsoft runtime. This 
allocates the Session object on a heap specific to that runtime 
library. Now when you do:

delete session;

in code compiled by VS6, that tries to remove the object from some heap 
that belongs to some version 6 of the runtime. The object isn't on that 
heap, so strange things will happen.

For this to work right, I think the various CMS classes would have to 
get methods like destroySession, etc. so that you can be sure that you 
always new and free on the same heap when running on Windows.

Anyway, I could be wrong. Anyone else? You can at least try to just 
delete the stuff. If it blows up, my theory might explain why.

Cheers,

Albert

Re: Licensing and Porting Issue for the CMS (ActiveMQ-CPP) on Visual Studio 6 from Visual Studio 8

Posted by Some user <se...@mailinator.com>.
Hi Albert!

>>but maybe we should rather spend some 
>>time getting AMQCPP to build as a DLL with VC++ 2005 Express (which is 
>>free to use, even for commercial applications) which you can then link 
>>into your VS6-compiled applications.

build dll on 2005 goes fine, however, my application on VS6 anyways fails
compilation when I include the cms headers, the compilation errors are again
the same mentioned in the original post by pravin.

Has anyone before tried compiling/running a sample code on VS6?

-- 
View this message in context: http://www.nabble.com/Licensing-and-Porting-Issue-for-the-CMS-%28ActiveMQ-CPP%29-on-Visual-Studio-6-from-Visual-Studio-8-tf3777279s2354.html#a10801045
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Licensing and Porting Issue for the CMS (ActiveMQ-CPP) on Visual Studio 6 from Visual Studio 8

Posted by Pravin Kundal <pr...@persistent.co.in>.
Thanks Albert!!

Yes, I guess I will need to do the same i.e. building a DLL. But I don't
have much experience in creating DLLs.

Could you please help me out in building the same? I will keep on updating
you with my queries.


Albert Strasheim-2 wrote:
> 
> Hello
> 
> This isn't so much about the licensing, but you might want to 
> reconsider backporting AMQCPP to VS6. That compiler really isn't your 
> friend.
> 
> I'm not 100% certain if this will work (I'm mainly concerned about
> multiple runtime memory allocation issues) and whether this is feasible 
> will depend on your application, but maybe we should rather spend some 
> time getting AMQCPP to build as a DLL with VC++ 2005 Express (which is 
> free to use, even for commercial applications) which you can then link 
> into your VS6-compiled applications.
> 
> I have a bit of experience turning a static library into a DLL, and 
> some of the Linux folks have also mentioned that they want a shared 
> library, so maybe it's time to take the plunge.
> 
> Regards,
> 
> Albert
> 
> On Fri, 18 May 2007, Pravin Kundal wrote:
> 
>> Licensing and Porting Issue for the CMS (ActiveMQ-CPP) on Visual Studio 6
>> from Visual Studio 8
>> 	
>> I have downloaded activemq-cpp-2.0.1-src (i.e. CMS 2.0.1) from
>> http://activemq.apache.org/cms/download.html
>> It is provided with vs2005-build (Visual Studio 8). 
>> Now, as our project is in vs2003, I am trying to build (port) it in
>> Visual
>> Studio 6, but I am getting following errors, which means I will need to
>> make
>> some modifications like adding some typedefs or some fix to get around
>> some
>> ???type??? issues that causes compiler errors under Visual Studio 6.
> 
> 

-- 
View this message in context: http://www.nabble.com/Licensing-and-Porting-Issue-for-the-CMS-%28ActiveMQ-CPP%29-on-Visual-Studio-6-from-Visual-Studio-8-tf3777279s2354.html#a10764171
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


RE: Licensing and Porting Issue for the CMS (ActiveMQ-CPP) on Visual Studio 6 from Visual Studio 8

Posted by "Mittler, Nathan" <na...@sensis.com>.
Agreed! 

I've created this issue
https://issues.apache.org/activemq/browse/AMQCPP-115 to address this. 

> -----Original Message-----
> From: Albert Strasheim [mailto:fullung@gmail.com] 
> Sent: Friday, May 18, 2007 8:19 AM
> To: users@activemq.apache.org
> Subject: Re: Licensing and Porting Issue for the CMS 
> (ActiveMQ-CPP) on Visual Studio 6 from Visual Studio 8
> 
> Hello
> 
> This isn't so much about the licensing, but you might want to 
> reconsider backporting AMQCPP to VS6. That compiler really 
> isn't your friend.
> 
> I'm not 100% certain if this will work (I'm mainly concerned 
> about multiple runtime memory allocation issues) and whether 
> this is feasible will depend on your application, but maybe 
> we should rather spend some time getting AMQCPP to build as a 
> DLL with VC++ 2005 Express (which is free to use, even for 
> commercial applications) which you can then link into your 
> VS6-compiled applications.
> 
> I have a bit of experience turning a static library into a 
> DLL, and some of the Linux folks have also mentioned that 
> they want a shared library, so maybe it's time to take the plunge.
> 
> Regards,
> 
> Albert
> 
> On Fri, 18 May 2007, Pravin Kundal wrote:
> 
> > Licensing and Porting Issue for the CMS (ActiveMQ-CPP) on Visual 
> > Studio 6 from Visual Studio 8
> > 	
> > I have downloaded activemq-cpp-2.0.1-src (i.e. CMS 2.0.1) from 
> > http://activemq.apache.org/cms/download.html
> > It is provided with vs2005-build (Visual Studio 8). 
> > Now, as our project is in vs2003, I am trying to build (port) it in 
> > Visual Studio 6, but I am getting following errors, which 
> means I will 
> > need to make some modifications like adding some typedefs 
> or some fix 
> > to get around some ???type??? issues that causes compiler 
> errors under Visual Studio 6.
> 

Re: Licensing and Porting Issue for the CMS (ActiveMQ-CPP) on Visual Studio 6 from Visual Studio 8

Posted by Albert Strasheim <fu...@gmail.com>.
Hello

This isn't so much about the licensing, but you might want to 
reconsider backporting AMQCPP to VS6. That compiler really isn't your 
friend.

I'm not 100% certain if this will work (I'm mainly concerned about
multiple runtime memory allocation issues) and whether this is feasible 
will depend on your application, but maybe we should rather spend some 
time getting AMQCPP to build as a DLL with VC++ 2005 Express (which is 
free to use, even for commercial applications) which you can then link 
into your VS6-compiled applications.

I have a bit of experience turning a static library into a DLL, and 
some of the Linux folks have also mentioned that they want a shared 
library, so maybe it's time to take the plunge.

Regards,

Albert

On Fri, 18 May 2007, Pravin Kundal wrote:

> Licensing and Porting Issue for the CMS (ActiveMQ-CPP) on Visual Studio 6
> from Visual Studio 8
> 	
> I have downloaded activemq-cpp-2.0.1-src (i.e. CMS 2.0.1) from
> http://activemq.apache.org/cms/download.html
> It is provided with vs2005-build (Visual Studio 8). 
> Now, as our project is in vs2003, I am trying to build (port) it in Visual
> Studio 6, but I am getting following errors, which means I will need to make
> some modifications like adding some typedefs or some fix to get around some
> ???type??? issues that causes compiler errors under Visual Studio 6.

RE: Licensing and Porting Issue for the CMS (ActiveMQ-CPP) on Visual Studio 6 from Visual Studio 8

Posted by "Mittler, Nathan" <na...@sensis.com>.
Unlike GPL/LGPL, the ASF license does not require you to contribute your
changes back to the community (although it is appreciated :)).  You can
read the license for yourself here:

http://www.apache.org/licenses/LICENSE-2.0.html

Be sure to read section 4 on redistribution.

Nate

> -----Original Message-----
> From: Pravin Kundal [mailto:pravin_kundal@persistent.co.in] 
> Sent: Friday, May 18, 2007 8:08 AM
> To: users@activemq.apache.org
> Subject: Licensing and Porting Issue for the CMS 
> (ActiveMQ-CPP) on Visual Studio 6 from Visual Studio 8
> 
> 
> Licensing and Porting Issue for the CMS (ActiveMQ-CPP) on 
> Visual Studio 6 from Visual Studio 8
> 	
> I have downloaded activemq-cpp-2.0.1-src (i.e. CMS 2.0.1) 
> from http://activemq.apache.org/cms/download.html
> It is provided with vs2005-build (Visual Studio 8). 
> Now, as our project is in vs2003, I am trying to build (port) 
> it in Visual Studio 6, but I am getting following errors, 
> which means I will need to make some modifications like 
> adding some typedefs or some fix to get around some 'type' 
> issues that causes compiler errors under Visual Studio 6.
> 
> Snippet of few Errors in Visual Studio 6
> 
> --------------------Configuration: Consumer - Win32
> Debug--------------------
> Compiling...
> main.cpp
> c:\assigned_task\prototype\prototype\main\activemq\exceptions\
> activemqexception.h(107)
> : error C2555: 
> 'activemq::exceptions::ActiveMQException::clone' : overriding 
> virtual function differs from 'cms::CMSException::clone' only 
> by return type or calli ng convention
>         
> c:\assigned_task\prototype\prototype\main\cms\cmsexception.h(33) :
> see declaration of 'CMSException'
> c:\assigned_task\prototype\prototype\main\cms\deliverymode.h(3
> 7) : error
> C2252: 'PERSISTENT' : pure specifier can only be specified 
> for functions
> c:\assigned_task\prototype\prototype\main\cms\deliverymode.h(3
> 8) : error
> C2258: illegal pure syntax, must be '= 0'
> c:\assigned_task\prototype\prototype\main\cms\deliverymode.h(3
> 8) : error
> C2252: 'NON_PERSISTENT' : pure specifier can only be 
> specified for functions
> c:\assigned_task\prototype\prototype\main\cms\message.h(154) 
> : error C2632:
> 'long' followed by 'long' is illegal
> .
> .
> .
> c:\assigned_task\prototype\prototype\main\cms\bytesmessage.h(5
> 4) : error
> C2039: 'size_t' : is not a member of 'std'
> c:\assigned_task\prototype\prototype\main\cms\bytesmessage.h(1
> 12) : error
> C2039: 'size_t' : is not a member of 'std'
> c:\assigned_task\prototype\prototype\main\cms\bytesmessage.h(1
> 49) : error
> C2039: 'size_t' : is not a member of 'std'
> 
> 
> Now as CMS (ActiveMQ-CPP) is the Apache 2.0 licensed, so do I 
> need to release it back to the community, the porting changes 
> that I make to the current CMS library which is Visual Studio 
> 2005 build, OR I wont be able to make the changes OR what 
> other licensing issues may arise in our case.
> PLEASE CLERIFY. 
> 
> --
> View this message in context: 
> http://www.nabble.com/Licensing-and-Porting-Issue-for-the-CMS-
> %28ActiveMQ-CPP%29-on-Visual-Studio-6-from-Visual-Studio-8-tf3
> 777279s2354.html#a10680894
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
> 
>