Problem in creating dict + third party libs

while,i have a thirdlib.h and thirdlib.lib,the contents of the thirdlib.h is as follows:

namespace DataWell
{
    extern "C"
   {
            int UFDataInit();
            int UFCreateWell(const char *,const char*);
            int UFDataExit();
   }
}

i use “makecint -mk makefile -H thirdlib.h -C++ thirdlib.lib -dl thirdparty.dll” & “make” to generate the thirdparty.dll and thirdparty.lib
then i use cint to intepret a cpp file: test.cpp.the content of test.cpp is as follows:

using namespace DataWell;
int test()
{
       UFDataInit();
       UFCreateWell("c:\\","demo");
       UFDataExit();
}
cint> .L thirdparty.dll
!!!Debugger Command mode switched as follows!!!
    > .[command]
    > [statement]
cint> .L test.cpp
Error: namespace DataWell is not defined test.cpp(1)
!!!Dictionary position rewound... !!!Error recovered!!!
cint> .L thirdparty.dll
cint> .L test.cpp
cint> test();
cint>

i use cint run the test.cpp successfully.but when i use root,it reports error:

root [0] .L thirdparty.dll
root [1] .L test.cpp
root [2] test()
Error: C++ exception caught D:\Lead\Bin\test.cpp(6)
(int)0
*** Interpreter error recovered ***
root [3]

i try to use root to debug the test.cpp,and it is the fault of the UFCreateWell function.
y there is a C++ exception?

is that means the root can not load the makecint generated dll?
i just don’t know what the problem is ?
where does the exception from?
y is it success in using cint, while error in using root?

BTW, i add the thirdparty.dll to the $RootSys\bin,thirdparty.lib to the $RootSys\lib
and write a thirdparty.rootmap myself:

Library.DataWell:                            thirdparty.dll

is this solution available?

[quote]i use cint run the test.cpp successfully.but when i use root,it reports error:[/quote]In standalone CINT, the command by default do not start by a period.cint> .L thirdparty.dll !!!Debugger Command mode switched as follows!!! > .[command] > [statement]you can do:cint> L thirdparty.dll cint> L test.cpp cint> { test(); }

Cheers,
Philippe.

[quote]and write a thirdparty.rootmap myself:[/quote]This will mean that if you use the symbol DataWell on the ROOT prompt, ROOT will automatically load the library.

Cheers,
Philippe.

[quote]Error: C++ exception caught D:\Lead\Bin\test.cpp(6)

i try to use root to debug the test.cpp,and it is the fault of the UFCreateWell function.
y there is a C++ exception?[/quote]Your debugging and the error message do agree. There is a crash within one of the function in ‘thirdlib.h’, i.e. it is plausible you are misusing the routines.

[quote]why is it success in using cint, while error in using root?[/quote]It is not clear. It is plausible that it fails randomly and thus succeeds only by chance in the cint case.

Cheers,
Philippe.