C lost functionality?


I know that all the people are fond of classes, but I miss one C functionality, that is, the possibility of putting functions for the “main” in a separate file. Now I’m using a couple of classes created by other, and my code looks ugly with all the functions over the “main”.
When I try to create a SAA the ROOT claims in this way:

Generating Dictionary …
Error: link requested for unknown class Myfunctions FILE:G__auto16612LinkDef.h LINE:7
Warning: Error occured during reading source files
Warning: Error occured during dictionary source generation
!!!Removing MyfunctionsDict.cpp MyfunctionsDict.h !!!
Error: rootcint: error loading headers…
make: *** [MyFunctionsDict.cpp] Error 1

If I add a REAL class to the rest of “class files”, I have no problem at all. But I dont need another class.
Maybe it’s a question of the makefile? Anyway, It’s only a curiosity, my program works fine but it could be more beautiful !

I’m using ROOT Version 4.03/02

Could somebody help me?


create a file called Myfunctions_Linkdef.h, containing

[code]#ifdef CINT
#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;

#pragma link C++ function MyFunc;
NB: What is an SAA?!

Hi Axel,

A SAA for me is a Stand-Alone-Application. I think that you can call a program a SAA when it is not a macro. Under ROOT, when you are using an object called " TApplication" and a “main”. But it’s a question of words, only.
I had solved the problem by myself in another way: as I proposed, I had modified the original GNUmakefile including before the code file (that is, the file with the “main”) the name of the file that contains the prototype AND the definitions of my functions. For example:

nameoftheSAA: [libraries] functions.cpp code.cpp

where “code.cpp” contains the “main”.

Thanks for your quick response!
:smiley: [/b]