RE: steps to execute the C++ sample

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

RE: steps to execute the C++ sample

tabish121
> I was trying to runt he cpp client code given on
> http://www.activemq.org/site/activemq-cpp-client.html
>
> I am getting errors for each include in the code. It cant locate the
> classes.
> I am using VS .Net 2003 VC++ compiler  ...
>

I had to add several paths in VC2005 to get it to compile.  It couldn't
even find windows.h, which gave me a chuckle.  I added these to my
project to build the library.  (Adjust to your own env)

C:\Eclipse\ActiveMQ\activemq-cpp\src\main
C:\Program Files\Microsoft Platform SDK\Include"

These are to run the test cases.  If you are not running the test cases
then you don't need cppunit.

C:\Program Files\Microsoft Platform SDK\Include
--- Optional
C:\Apps\cppunit-1.11.6\include
--- End Optional
C:\Eclipse\ActiveMQ\activemq-cpp\src\main
C:\Eclipse\ActiveMQ\activemq-cpp\src\test

> I got the source code downloaded from
> http://svn.apache.org/repos/asf/incubator/activemq/trunk/activemq-cpp/
>
> I cant understand how to include these files to my project path so
that
> the
> compile and build works for me.
>
> I am a newbie to both C++ and ActiveMQ

Hey, we all have to start somewhere.  Good Luck!

-----------------------------------------
Timothy A. Bish
Sensis Corporation
5717 Enterprise Parkway
East Syracuse, NY 13057
Phone: (315) 634-3027
[hidden email]
-----------------------------------------



>
>
> I was trying to runt he cpp client code given on
> http://www.activemq.org/site/activemq-cpp-client.html
>
> I am getting errors for each include in the code. It cant locate the
> classes.
> I am using VS .Net 2003 VC++ compiler  ...
>
> I got the source code downloaded from
> http://svn.apache.org/repos/asf/incubator/activemq/trunk/activemq-cpp/
>
> I cant understand how to include these files to my project path so
that

> the
> compile and build works for me.
>
> I am a newbie to both C++ and ActiveMQ
>
> Please guide me.
>
> Thanks
>
>
> --
> View this message in context:
http://www.nabble.com/steps-to-execute-the-
> C%2B%2B-sample-tf2072027.html#a5704355
> Sent from the ActiveMQ - User forum at Nabble.com.

Reply | Threaded
Open this post in threaded view
|

RE: steps to execute the C++ sample

Lalit Nagpal
Tim,

Thanks for the reply ... isnt there a way i can specify the base directory in my project settings in VC. From there it should pick up files on its own like
activemq\concurrent\Thread.h
activemq\concurrent\Mutex.h

and so on ...

Do you know where to specify these settings.

Thanks in advance and the gud luck...

Lalit
Reply | Threaded
Open this post in threaded view
|

RE: steps to execute the C++ sample

tabish121
In reply to this post by tabish121


-----------------------------------------
Timothy A. Bish
Sensis Corporation
5717 Enterprise Parkway
East Syracuse, NY 13057
Phone: (315) 634-3027
[hidden email]
-----------------------------------------



> -----Original Message-----
> From: Lalit Nagpal [mailto:[hidden email]]
> Sent: Tuesday, August 08, 2006 7:34 AM
> To: [hidden email]
> Subject: RE: steps to execute the C++ sample
>
>
> Tim,
>
> Thanks for the reply ... isnt there a way i can specify the base
directory
> in my project settings in VC. From there it should pick up files on
its
> own
> like
> activemq\concurrent\Thread.h
> activemq\concurrent\Mutex.h

That's what this one is for, all the activemq-cpp code for the library
lives under here (of course you path may be slightly different) the
important part is "activemq-cpp\src\main"
C:\Eclipse\ActiveMQ\activemq-cpp\src\main

>
> and so on ...
>
> Do you know where to specify these settings.

Its under project settings.  If you right click on the project and
select properties, there is a tree view and one of the entries is C/C++
and then I think under that is a general section and in there is a field
called additional include directories.  At least that is how I remember
it.  Should be something fairly close to that.

>
> Thanks in advance and the gud luck...
>
> Lalit
> --
> View this message in context: http://www.nabble.com/RE%3A-steps-to-
> execute-the-C%2B%2B-sample-tf2072070.html#a5704598
> Sent from the ActiveMQ - User forum at Nabble.com.

Reply | Threaded
Open this post in threaded view
|

RE: steps to execute the C++ sample

Lalit Nagpal
Tim .... that was great help.
although still i ran into all these errors ... dont know why.

error C2039: 'AutoAcknowledge' : is not a member of 'cms::Session' e:\CPP\activemq-cpp\src\main\cms\Session.h(36) : see declaration of 'cms::Session'
error C2039: 'NONPERSISTANT' : is not a member of 'cms::Message'
 e:\CPP\activemq-cpp\src\main\cms\Message.h(33) : see declaration of 'cms::Message'
error C2065: 'AutoAcknowledge' : undeclared identifier
error C2065: 'NONPERSISTANT' : undeclared identifier
error C2259: 'HelloWorldConsumer' : cannot instantiate abstract class
due to following members: 'void cms::MessageListener::onMessage(const cms::Message *)' : pure virtual function was not defined
e:\CPP\activemq-cpp\src\main\cms\MessageListener.h(46) : see declaration of 'cms::MessageListener::onMessage'
error C2664: 'cms::Session::createProducer' : cannot convert parameter 1 from 'cms::Destination' to 'const cms::Destination *' No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
error C2664: 'void cms::MessageProducer::send(cms::Message *) throw(cms::CMSException)' : cannot convert parameter 1 from 'cms::TextMessage' to 'cms::Message *'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called


Am i using a wrong version or something.






Reply | Threaded
Open this post in threaded view
|

RE: steps to execute the C++ sample

tabish121
In reply to this post by tabish121
>
> Tim .... that was great help.
> although still i ran into all these errors ... dont know why.
>
> error C2039: 'AutoAcknowledge' : is not a member of 'cms::Session'
> e:\CPP\activemq-cpp\src\main\cms\Session.h(36) : see declaration of
> 'cms::Session'
> error C2039: 'NONPERSISTANT' : is not a member of 'cms::Message'
>  e:\CPP\activemq-cpp\src\main\cms\Message.h(33) : see declaration of
> 'cms::Message'
> error C2065: 'AutoAcknowledge' : undeclared identifier
> error C2065: 'NONPERSISTANT' : undeclared identifier
> error C2259: 'HelloWorldConsumer' : cannot instantiate abstract class
> due to following members: 'void cms::MessageListener::onMessage(const
> cms::Message *)' : pure virtual function was not defined
> e:\CPP\activemq-cpp\src\main\cms\MessageListener.h(46) : see
declaration
> of
> 'cms::MessageListener::onMessage'
> error C2664: 'cms::Session::createProducer' : cannot convert parameter
1

> from 'cms::Destination' to 'const cms::Destination *' No
> user-defined-conversion operator available that can perform this
> conversion,
> or the operator cannot be called
> error C2664: 'void cms::MessageProducer::send(cms::Message *)
> throw(cms::CMSException)' : cannot convert parameter 1 from
> 'cms::TextMessage' to 'cms::Message *'
> No user-defined-conversion operator available that can perform this
> conversion, or the operator cannot be called
>
>
> Am i using a wrong version or something.

If you've got the latest SVN installed you should be all set.

>
>

It sort of seems like you are either missing some files, or there is
still some setting that is not quit right.

One of the things you can look at us the pom.xml in the win32-msvc
folder.  This file shows the compiler settings that you need.  There are
some #defines that have to go into your projects preprocessor settings
which you will see in this file.  Also there are VS2005 project files in
src/main and src/test that you can look at, the newer studio files are
saved in a pretty readable xml format now.

The first thing I would do is try and create a Dev Studio project that
just build the activemq-cpp lib into a static lib, once you get that
part figured out, you can create an app that links in that library.

If you install maven you can build the lib using the maven pom.xml that
is included.  There are instructions in the Readme file.  

I can't give you an exact answer since I don't have Studio 2003 to try
it in.  I use the free Visual Studio 2005 Express package, which is a
little different.

-----------------------------------------
Timothy A. Bish
Sensis Corporation
-----------------------------------------