Hello, I would like to run a vme control program in ROOT environment and the first shot did't work out. Could someone please tell me what I am doing wrong? (example, should I modify the header file? Should I have vme controling part in separate shared object? or Should I give up in using CINT for this purpose and make a standalone exe?) The error message is: ----------- root [0] .x reset.C Error: Unexpected EOF G__exec_statement() FILE:/usr/include/sys/feature_tests.h LINE:34 Advice: You may need to use +P or -p option *** Interpreter error recovered *** NULL root [1] and the FILE:/usr/include/sys/feature_tests.h is:" /* Copyright (c) 1993, by Sun Microsystems, Inc. */ /* All Rights Reserved */ /* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF SMI */ /* The copyright notice above does not evidence any */ /* actual or intended publication of such source code. */ #ifndef _SYS_FEATURE_TESTS_H #define _SYS_FEATURE_TESTS_H #pragma ident "@(#)feature_tests.h 1.7 94/12/06 SMI" #ifdef __cplusplus extern "C" { #endif /* * Values of _POSIX_C_SOURCE * * undefined not a POSIX compilation * 1 POSIX.1-1990 compilation * 2 POSIX.2-1992 compilation * 199309L POSIX.1b-1993 compilation */ #if defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE) #define _POSIX_C_SOURCE 1 #endif #ifdef __cplusplus } #endif #endif /* _SYS_FEATURE_TESTS_H */ and the program itself was: --------------------- #include <stdio.h> #include <fcntl.h> #include <sys/types.h> #include <unistd.h> #include <malloc.h> #include <sys/mman.h> #include <errno.h> #include <sys/param.h> int fd_vme32; int leng; caddr_t map_p; unsigned long *lP; unsigned long adr; unsigned long VMEmap(VMEadr,len) caddr_t VMEadr; unsigned long len; { unsigned long addr; /* Open vme24 device */ fd_vme32 = open("/dev/vme24d32", O_RDWR); if (fd_vme32 == -1) { printf("ERROR: open vme32 failed\n"); return -1; } /* mmap() must be rounded to page */ addr = (u_long)VMEadr & PAGEMASK; /* Use mmap to obtain a virtual pointer to VME space */ if ((map_p = mmap(0, len, (PROT_READ|PROT_WRITE), MAP_SHARED, fd_vme32, addr)) == (caddr_t)-1) { printf("ERROR: mmap failed\n"); return -1; } return (u_long)map_p; } unsigned long VMEunmap() { if (munmap(map_p, leng) == -1) { printf("ERROR: munmap failed\n"); } close(fd_vme32); } reset() { gROOT.Reset(""); printf("hello \n"); } ------------------------- Eunil Won HEP lab, Department of Physics, Seoul National University Seoul, South Korea Tel: +82-2-876-2801
This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:34:39 MET