Return vaue from library problem with embedded cint

View: New views
4 Messages — Rating Filter:   Alert me  

Return vaue from library problem with embedded cint

by Joost Kraaijeveld :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I have made a little program that crashes. It consists of an application
that calls functions in a user library. It looks as if values returned
from the library get lost somewhere. Is it actually possible to return
values from a user library?


The code and Eclipse CDT project are available here:

http://trac.askesis.nl/downloads/CintTest.tar.bz2

Unzip and run the setup script file in the root after adapting the
"export CINTSYSDIR=/home/jkr/Programming/C++/cint" into something
suitable for your machine.

TIA

--
Groeten,

Joost Kraaijeveld
Askesis B.V.
Molukkenstraat 14
6524NB Nijmegen
tel: 024-3888063 / 06-51855277
fax: 024-3608416
web: www.askesis.nl



Re: Return vaue from library problem with embedded cint

by Axel Naumann :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Joost!

Thanks for your example - it forced me to fix two bugs in CINT just to
build it :-)

Now that I have it I can even tell you why that happens: you're missing
a dictionary for the vector<pair<...> >. I got it to work by simply
adding in Library.h:

#include <vector>
#include <map>
#include <string>

using namespace std;
#pragma link C++ class vector< pair< unsigned long, string > >;

Cheers, Axel.

Joost Kraaijeveld wrote on 10/29/2009 12:09 PM:

> Hi,
>
> I have made a little program that crashes. It consists of an application
> that calls functions in a user library. It looks as if values returned
> from the library get lost somewhere. Is it actually possible to return
> values from a user library?
>
>
> The code and Eclipse CDT project are available here:
>
> http://trac.askesis.nl/downloads/CintTest.tar.bz2
>
> Unzip and run the setup script file in the root after adapting the
> "export CINTSYSDIR=/home/jkr/Programming/C++/cint" into something
> suitable for your machine.
>
> TIA
>


Re: Return vaue from library problem with embedded cint

by Joost Kraaijeveld :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, 2009-10-30 at 10:47 +0100, Axel Naumann wrote:

> Hi Joost!
>
> Thanks for your example - it forced me to fix two bugs in CINT just to
> build it :-)
>
> Now that I have it I can even tell you why that happens: you're missing
> a dictionary for the vector<pair<...> >. I got it to work by simply
> adding in Library.h:
>
> #include <vector>
> #include <map>
> #include <string>
>
> using namespace std;
> #pragma link C++ class vector< pair< unsigned long, string > >;

Cool, thanks. Do I understand it correctly that this means that I should
always link an instantiated STL class if I use one?

--
Groeten,

Joost Kraaijeveld
Askesis B.V.
Molukkenstraat 14
6524NB Nijmegen
tel: 024-3888063 / 06-51855277
fax: 024-3608416
web: www.askesis.nl



Re: Return vaue from library problem with embedded cint

by Axel Naumann :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Joost!

Joost Kraaijeveld wrote on 10/30/2009 05:15 PM:

> On Fri, 2009-10-30 at 10:47 +0100, Axel Naumann wrote:
>> Hi Joost!
>>
>> Thanks for your example - it forced me to fix two bugs in CINT just to
>> build it :-)
>>
>> Now that I have it I can even tell you why that happens: you're missing
>> a dictionary for the vector<pair<...> >. I got it to work by simply
>> adding in Library.h:
>>
>> #include <vector>
>> #include <map>
>> #include <string>
>>
>> using namespace std;
>> #pragma link C++ class vector< pair< unsigned long, string > >;
>
> Cool, thanks. Do I understand it correctly that this means that I should
> always link an instantiated STL class if I use one?

CINT is pretty limited in its abilities to instantiate a
library-compatible STL class. So: yes :-(

Cheesr, Axel.