CINT gives “Segmentation violation” with this code:
#include <string>
class B
{
public:
string str;
};
void RunMe()
{
B * arrB = new B[10];
if( arrB )
delete[] arrB;
}
It happens in debug build of both CINT5 and CINT7 (latest from svn feb 6, 09), built for msvc8.
It always and only happens when using any stl class in class B.
In release build of CINT it crashes on 2nd run (After 1st run file unloaded with command U), and with cint lib.
Any help appreciated please.
sunos.obj : warning LNK4221: no public symbols found; archive member will be inaccessible
oldlink.obj : warning LNK4221: no public symbols found; archive member will be inaccessible
newsos.obj : warning LNK4221: no public symbols found; archive member will be inaccessible
bc_eh.obj : warning LNK4221: no public symbols found; archive member will be inaccessible
[/code]
and lots, ~49 warnings like these:
Warning: #pragma link, function log(valarray<int>) not found prec_stl/valarray(261)
Warning: #pragma link, function log10(valarray<int>) not found prec_stl/valarray(262)
Warning: #pragma link, function pow(valarray<int>,valarray<int>) not found prec_stl/valarray(263)
Second run means:
X C:\CINT\failtest\RunMe.cxx
U C:\CINT\failtest\RunMe.cxx
X C:\CINT\failtest\RunMe.cxx
Error: Illegal assignment to G__STRING c:\cint\cint7\stl_string(12)
!!!Error recovered!!!
and i have more complicated code that crashes at first run, but generally it similar to this
Anyway, the point of the working around is to load all the ‘infrastructure’ library before loading the (user) scripts that will be reloaded. A script reload (or unload) imply the unloading of all script, includes and library that have been loaded since.
I will give a try.
So, generally right after loading my dll with embedded CINT i should do something like:
Is there a way to add those to dictionary while building that dll?
BTW, though you wrote in other topic in “cint bugs and features” that this bug is fixed, i still have to use that workaround even with latest CINT7 built with msvc9
[quote]BTW, though you wrote in other topic in “cint bugs and features” that this bug is fixed, i still have to use that workaround even with latest CINT7 built with msvc9[/quote]My apologies I had mis-read your post (and did not ‘see’ the part where you mentioned that this happens in Cint7 after reloads.