Urgent Help required for QT - CINT

Hello,

I am new to ROOT & CINT.
I have downloaded ROOT v6.04.02 tar file and followed the below steps in Ubuntu 14.04
cd root
.configure
make
make install

ROOT is installed successfully after installing many dependency library.
My requirement is to use cint with QT. So i followed the steps given in ftp://root.cern.ch/root/doc/26ROOTandQT.pdf
After the above step i have done the make qtcint. This was not working. Am getting the following issue.
make: *** No rule to make target ‘qtcint’. Stop

Please guide me how can i solve this issue. And please let me know what are the steps i need to do for a simple QT application which uses the CINT. Am using QT 5.5 which has already installed in my system before ROOT installation. I have also installed CINT package separately from root.cern.ch.

Please let me know how i can use CINT in QT Application.

Please Respond as soon as possible.

Thanks and regards,
Jag

Hi,

Please build ROOT yourself, enabling Qt: ./configure --enable-qt

By the way: ROOT 6 has no CINT anymore, that explains why it didn’t work.

Cheers, Axel.

Hi Axel,

Thanks for the reply

I have build ROOT using ./configure --enable-qt also.

But still am getting the same issue.

Initially i have installed ROOTv5.34.32 (ROOT 5). There i got some issue while giving the command
make qtcint. When i searched in net i got that ROOT5 will not support and ROOT 6 will support.
sft.its.cern.ch/jira/browse/ROOT-6863

So i have installed ROOT 6.
Please let me know how i can use CINT in QT application.

I have even installed CINT 5.18.00 from
root.cern.ch/drupal/content/cint

Thanks & Regards,
Jag

Hi,

What /is/ the issue?

Axel.

Hi

when i do make qtcint am getting
make: *** No rule to make target ‘qtcint’. Stop

How to include CINT in my QT Application.

Thanks & Regards,
Jag

Hi,

don’t do make qtcint. It works just fine without (in ROOT 6).

Axel.

Hi

I have taken a sample from net for QT Based root application

the simple code is as follows

#include <TRint.h>
#include <qpushbutton.h>
int main( int argc, char **argv ) {
// Create an interactive ROOT application
TRint *theApp = new TRint(“Rint”, &argc, argv);
// Create Qt object within ROOT application
QPushButton hello( “Hello world!”, 0 );
hello.resize( 100, 30 );
hello.show();
// and enter the ROOT event loop…
theApp->Run();
}

After this from my root path i have give the following command

root@gugapriya-ubuntu:/home/ROOT/root-6.04.02# echo $QTDIR
/home/test/Qt
root@gugapriya-ubuntu:/home/ROOT/root-6.04.02# g++ root-config --cflags --glibs -I$QTDIR/include -L$QTDIR/lib -lqt-mt /home/Priya_workingLocal/Priya_cint_Qt/Helloworld.cxx -o Helloworld
/home/Priya_workingLocal/Priya_cint_Qt/Helloworld.cxx:2:26: fatal error: qpushbutton.h: No such file or directory
#include <qpushbutton.h>
^
compilation terminated.
root@gugapriya-ubuntu:/home/ROOT/root-6.04.02#

Again i tried after giving root
and in
root [0] g++ root-config --cflags --glibs -I$QTDIR/include -L$QTDIR/lib -lqt-mt /home/Priya_workingLocal/Priya_cint_Qt/Helloworld.cxx -o Helloworld
ROOT_prompt_22:1:4: error: expected ‘;’ after expression
g++ root-config --cflags --glibs -I$QTDIR/include -L$QTDIR/lib -lqt-mt /home/Priya_workingLocal/Priya_cint_Qt/Helloworld.cxx -o Helloworld
^
;

How i can execute on simple program from root.

Is it possible to open a QT IDE and create QT application which will provide files that need to be compile using CINT and give the compiled output

Thanks and Regards,
Jag

Hi,

Sorry - this is outside the support I can give. Your question really is “how can I build a Qt application that links to other libraries”? I think you’ll find plenty of help in the 'net, e.g. on Qt’s forum. This has nothing to do with ROOT, except for the fact that you create a TRint.

Cheers, Axel.

Note that you are talking about "Qt-ROOT".
This is an external source code which is (was?) maintained by Valeri Fine.
You can have a look here: sourceforge.net/p/qtroot/wiki/Home/
I believe it used to be ROOT 5 + QT 4 specific and I’m not sure if it works with ROOT 6.

See also:

Hi,

Thanks, Now at least am able to add libCint.so to QT Application and pass script.cxx or .cpp file to cint. But still i do have the qtcint.so issue for qt examples.

I want to build CINT package using Qt in Linux ubuntu 14.04.

I tried to add a new Qt Lib application and added all CINT package (cpp and .h file and included the path)
When i tried to build am getting error with Platform dependent macros. Like G__WIN32, G__P ect.
Please let me know where am going wrong. Is it possible to build CINT package in Linux Ubuntu 14.04 using QT

Thanks & Regards,
Jag

Hi

Can i create my own lib.so of CINT package using QT Linux Ubuntu 14.04.

Please replay

Thanks & Regards
Jag

Hi,

We cannot help you like that. You don’t state what exactly you are doing (as in: source code, invocation, error messages).

Did you try ROOT 6? You should be able to simply #include your Qt header and use it - without any dictionaries.

Cheers, Axel.

HI

I am trying to export a C++ function / class and call the exported function from a script file. I have passed this script file to CINT. am getting the following issue.

I am trying in Ubuntu 14.04. With out cint my application able to execute the exported function.

[color=#BF0080]Error: Function module_init() is not defined in current scope FILE:/home/workingDir/script.cxx LINE:4
!!!Dictionary position rewound… !!!Error recovered!!!

Error: Function module_init() is not defined in current scope FILE:/home/Priya_workingDir/script.cxx LINE:4
!!! return from main() function[/color]

Following are my samples:
// My sample.h file contains
#if defined _WIN32 || defined CYGWIN || defined MINGW32
#ifdef BUILDING_DLL
#ifdef GNUC
#define DLL_PUBLIC attribute ((dllexport))
#else
#define DLL_PUBLIC __declspec(dllexport) // Note: actually gcc seems to also supports this syntax.
#endif
#else
#ifdef GNUC
#define DLL_PUBLIC attribute ((dllimport))
#else
#define DLL_PUBLIC __declspec(dllimport) // Note: actually gcc seems to also supports this syntax.
#endif
#endif
#define DLL_LOCAL
#else
#if GNUC >= 4
#define DLL_PUBLIC attribute ((visibility (“default”)))
#define DLL_LOCAL attribute ((visibility (“hidden”)))
#else
#define DLL_PUBLIC
#define DLL_LOCAL
#endif
#endif

extern “C” DLL_PUBLIC int module_init(); // exporting one function

//my sample.cpp
#define DLL_PUBLIC
#include “sample.h”
#include

DLL_PUBLIC int module_init()
{
cout << " Hi from my sample file \n ";
return 0;
}

// my script.cxx file contains
#include "sample.h"
int main(void)
{
if(module_init() != 0) {
return -1;
}
return 0;
}

/// My Console application contains

#include “G__ci.h”
#include “sample.h”

int main()
{
G__scratch_all();
m_nResult = G__init_cint (“cint”);
G__loadfile ("/home/workingDir/script.cxx") ;// load script.cxx,
G__exec_text (“main ()”);
G__scratch_all ();
return 1;
}

Please let me how i can export a function / class from a c++ class and call the exported function / class from a script which i will be passing to G__init_cint( cint script.cxx) in linux.

Regards,
Jag

Hi,

Do you really require ROOT 5 / CINT for that?

This is a lot easier with cling: you create a cling::Interpreter object (possibly passing a few “-I/some/include/dir”) and interp.declare("#include “sample.h”") and then you just call whatever you want using interp.evaluate(“whatever()”).

No dictionaries, no qtcint, no need to hide things; you can just #include the actual header.

There is a reason we moved to cling :slight_smile:

Cheers, Axel.

Thank you Axel,

I will try with cling.

But currently in Windows we are using CINT as our interpreter. And we are trying the same to work in Linux.

In windows am using __declspec (dllexport) to export a class/ function and execute the exported functions thru CINT by passing the script files.we can able to achive this in windows.

Same way i tried for Linux using attribute((visibility( default ))) and attribute((dllexport)). When i pass the script file to CINT it gives function or class object is not defined in current scope.

Please let me know is it possible in Linux with CINT. If possible , please let me know where am doing wrong.

Thanks and Regards,
Jag

Hi,

CINT does not understand attribute. We have no plans to add it.

I do understand the problem we are causing by the missing windows support in cling :frowning: We are working on it.

Cheers, Axel.

HI

I am able to export a function from a class and invoke from another script which am passing to CINT.
But am not able to use integer variable. It gives some error like
[color=#BF4000]Limitation : dec,oct,hex and am getting warnings like not fount G__CINT_ENDL , G__CINT_HEX, G__CINT_DEC ect… refered in __iostream.[/color]

Am able to use other data types. Like long double char ect…

For Example
in my script file
#include backend.h
#include backend.cpp
main()
{
fun(10,10); // am calling my backend function from my script
fun1(10,10);
}
my Backend.cpp code
void backend::fun(int a,int b)
{
cout << Given value << a << b << endl;
int c = a * b;
cout << output << c << endl;
}

void backend::fun1(long a,long b)
{
cout << Given value << a << b << endl;
long c = a * b;
cout << output << c << endl;
}
passing the above script.cpp to G_INIT_CINT(cint script.cpp);

Am getting output like
Given value
output
Given value 10 10
output 100

Issue is integer values are not printing.
Please let me know what i need to do to resolve the integer issue.

Regards,
Jag

Hi,

Can you compile your code, please, to check that it’s valid? E.g. “Given value” doesn’t seem to have quotes.

Cheers, Axel.

Hi,

I am also facing the same issues as jag reported like below error.

Error: Function module_init() is not defined in current scope FILE:/home/workingDir/script.cxx LINE:4
!!!Dictionary position rewound… !!!Error recovered!!!

Jag, can please tell me how it got resolved in your case.

Please help me if anyone else also face the same issue.

Thank you,
Sreeni

Hi,

same for you - please compile your code (".L script.cxx+" if you use ROOT), it might be due to a bug in your code.

Cheers, Axel.