Problems creating dictionary for own class (-p or +P opt.)

Hello Rooters,

I want to add a new class to my project, but I have problems creating a dictionary for it. The problem are the include Files (see code at the bottom), “AcqirisD1Import.h” and “vpptype.h” contain macros that cause problems with rootcint. It always gave me “Limitation: can not handle macro VISAFN _VI_FUNC Use +P or -p option FILE:visatype.h LINE:149” etc. errors.
Trying those options I used the -p option the following way
"rootcint -f Aquiriscint.cpp -c -p Aquiris.h AquirisLinkDef.h"
but I got the following errors:

with
"rootcint -f Aquiriscint.cpp -c +P Aquiris.h AquirisLinkDef.h"
I get the following errors

the three dots stand for lots and lots more errors.
What do I do wrong? Is there a way that I can still get the signal/slot mechanism for this class?

I am using ROOT 4.00/03 compiled for win32gdk on a win2k mashine.

Thank you

Lutz

#ifndef __AQUIRIS_H_
#define __AQUIRIS_H_

#include <TQObject.h>

#include "AcqirisD1Import.h"  // ### Acqiris Digitizer Device Driver ###
#include "vpptype.h"

class Aquiris : public TQObject  
{
private:
	ViSession ID[1];
	AqReadParameters * readPar;
	AqDataDescriptor * dataDesc;
	AqSegmentDescriptor * segDescArray;
	char * dataByteArray;
	MyDataDescriptor * MyDataDesc;

public:
	Aquiris();
	virtual ~Aquiris();
	ClassDef(Aquiris,0)	// Aquiris Stuff
};
#endif
is the correct syntax to use in your case.
However you still see
[quote]Error: Too many '}' FILE:.\acqirisd1interface.h LINE:973 
Error: Unexpected EOF G__exec_statement() FILE:\si4.5_cint.cxx LINE:4 [/quote]
I suppose that you actually try to compile your file before parsing it with rootcint.  If you did, then I would need to see the files (at least) AcqirisD1Import.h and acqirisd1interface.h to be more helpfull.
Using the (very verbose) syntax:
[code]rootcint -f Aquiriscint.cpp -c -p -t Aquiris.h AquirisLinkDef.h" [/code]
might help you detect the location of the problem.

Cheers,
Philippe.

is the correct syntax to use in your case.
However you still see

[quote]Error: Too many ‘}’ FILE:.\acqirisd1interface.h LINE:973
Error: Unexpected EOF G__exec_statement() FILE:\si4.5_cint.cxx LINE:4 [/quote]
I suppose that you actually try to compile your file before parsing it with rootcint. If you did, then I would need to see the files (at least) AcqirisD1Import.h and acqirisd1interface.h to be more helpfull.
Using the (very verbose) syntax:

might help you detect the location of the problem.

Cheers,
Philippe.

Hi,

As far as I know just calling the rootcint program doesn’t compile the file first, or am I wrong here?
I have tried what you suggested.

You can see the output in the attached output.txt. As far as I understand it, it is calling cl.exe (which is part of VC++6) with several options. One of which is ie. “-Ic:\root\cint/lib”. What I guess causes Problems for cl.exe is the mixing of ''s and '/'s. Other than that I am to unexperienced to see where else the error can come from.

I have also attached AquirisD1Import.h and AcqirisD1Interface.h.

Thank you

Lutz

Hi,

That’s not what I meant. I meant to ask whether you could (or have) make a simple .C file that includes all the header file that you pass to rootcint and try to compile this new file. This would help you determine if you have found out what is need to properly parse and compile those header (you may or may not have to add more swtiched and/or symbol definitions to the command line).

It is not a problem.

I do not see any obvious problem however I do not have enough of the files to be able to reproduce your problem. Could you send me a complete set.

Hi,

Thank you for the tip. I have checked wether I really need the AcqirisD1Interface.h to be included in the Aquiris.h file. I found a workaround: In order to have the dictionary build it is enough to include AcqirisDataTypes.h. Now, with the -p switch, the root dictionary is build without problems.

[quote]I do not see any obvious problem however I do not have enough of the files to be able to reproduce your problem. Could you send me a complete set.
[/quote]

Attached is a .zip file that includes all files necessary to compile the class. I have tried to cook it down to the essential and commented out the working include files, to let you know where the problem was.

Hello,

Concerned about the rootcint limitation,
Coming version of Cint provides an experimental feature to
handle macro like
#define VISAFN _VI_FUNC

This will not immidiately give you a perfect solution, but
ones step forward.

Thank you
Masa Goto

Hi,

The core of the problem is that CINT (even on windows) does not understand

int __declspec(dllimport) AcqrsD1_acquire(void);
Namely it does not understand the __declspecs which is actually a keyword in MSC++

You could have works around this limitation with:

rootcint -f Aquiriscint.cpp -c -p -D__declspec="" Aquiris.h AquirisLinkDef.h

Cheers,
Philippe.