RE: Stand-alone applications.

From: Fine, Valeri <fine_at_bnl.gov>
Date: Mon, 27 Jul 2009 18:28:17 -0400

Hello Lucio,

> I see this is an unusual question, but I have not find in the web
> the way to obtain a stand-alone application from the compiling
process.
>
> Assuming to have Scientific Linux and the following code:
>
> #include <iostream>
>
> int main ()
> {
> cout << "Hello world" << endl;
> return 0;
> }
>
> Is there any way to have it compiled with ACLiC (or in another way
> such that I can use root libraries) and to get an executable
> helloworld.out file which I can run just with
> ./helloworld.out ?
>
> I would need to run a program using root libraries on a PC where root
> cannot be installed, this is the why of my enquiry.

 I've sent you a solution.

Just for record I would like to call your attention to the fact that there is no big ;-) difference between your "helloword" and the full-fledged ROOT "main".

Here you are the full-fledged ROOT main (I've removed the comments to make it shorter)  

more $ROOTSYS/main/src/rmain.cxx



#include "TRint.h"
int main(int argc, char **argv)
{

   // Create an interactive ROOT application    TRint *theApp = new TRint("Rint", &argc, argv);    theApp->Run();
   delete theApp;
   return 0;
}


This is to say it is not clear what your "root cannot be installed" really mean as soon as you can install your application.

The simplest way to achieve your goal is to RENAME the "root.exe" into "helloword.out" ;-)

> Thanks a lot!

You are welcome.

                        Valeri 
Received on Tue Jul 28 2009 - 00:29:07 CEST

This archive was generated by hypermail 2.2.0 : Tue Jul 28 2009 - 17:50:02 CEST