compiler can't find pstatus_t even procfs.h inlcuded


 
Thread Tools Search this Thread
Top Forums Programming compiler can't find pstatus_t even procfs.h inlcuded
# 1  
Old 06-19-2008
Question compiler can't find pstatus_t even procfs.h inlcuded

Hi,
I am trying to get a the process cpu usage from the /proc file recently, on the Solaris 5.10. But met some rookie issue which i need some help. for below program, compiler complains that pstatus_t is undefined, although both type are defined in the procfs.h.

#include <sys/procfs.h>

int main()
{
struct pstatus *pstatus_p;
pstatus_t *pstatus_p2;
}

Errors as below:
$ cc pstatus.c
"pstatus.c", line 6: undefined symbol: pstatus_t
"pstatus.c", line 6: undefined symbol: pstatus_p
cc: acomp failed for pstatus.c

$ gcc pstatus.c
In file included from /nfs/other/prod_solaris/wh/dtd/sparc-SunOS5/gcc/3.4.3/bin/../lib/gcc/sparc-sun-solaris2.8/3.4.3/include/sys/signal.h:44,
from /usr/include/sys/old_procfs.h:28,
from /usr/include/sys/procfs.h:29,
from pstatus.c:1:
/usr/include/sys/siginfo.h:259: error: parse error before "ctid_t"
/usr/include/sys/siginfo.h:292: error: parse error before '}' token
/usr/include/sys/siginfo.h:294: error: parse error before '}' token
/usr/include/sys/siginfo.h:390: error: parse error before "ctid_t"
/usr/include/sys/siginfo.h:398: error: conflicting types for '__fault'
/usr/include/sys/siginfo.h:267: error: previous declaration of '__fault' was here
/usr/include/sys/siginfo.h:404: error: conflicting types for '__file'
/usr/include/sys/siginfo.h:273: error: previous declaration of '__file' was here
/usr/include/sys/siginfo.h:420: error: conflicting types for '__prof'
/usr/include/sys/siginfo.h:287: error: previous declaration of '__prof' was here
/usr/include/sys/siginfo.h:424: error: conflicting types for '__rctl'
/usr/include/sys/siginfo.h:291: error: previous declaration of '__rctl' was here
/usr/include/sys/siginfo.h:426: error: parse error before '}' token
/usr/include/sys/siginfo.h:428: error: parse error before '}' token
/usr/include/sys/siginfo.h:432: error: parse error before "k_siginfo_t"
/usr/include/sys/siginfo.h:437: error: parse error before '}' token
In file included from /usr/include/sys/old_procfs.h:28,
from /usr/include/sys/procfs.h:29,
from pstatus.c:1:

I can sure that the cc and gcc works fine with other programs. Would you please take a look at this issue and provide your suggestion. Thanks in adv.
# 2  
Old 06-19-2008
got some more information: even i commented out the include line, the compiler won't complain with the first line, i.e. "struct pstatus *pstatus_p;".
I suppose it is mean that the files does not be included at all. But the file is right under the /usr/include/sys directory.

Anyone knows why? or how should i investigate it more?
# 3  
Old 06-19-2008
seems that
cd /usr/local/lib/gcc-lib/sparc-sun-solaris2.10/3.3.2/install-tools
../mkheaders

can fix the gcc issue.

[freetds] Make error on Solaris 10
# 4  
Old 06-19-2008
Looks like the following may be your problem with the procfs header:
Code:
#if !defined(_KERNEL) && _STRUCTURED_PROC == 0
#include <sys/old_procfs.h>
#else   /* !defined(_KERNEL) && _STRUCTURED_PROC == 0 */
.....
#endif

# 5  
Old 06-23-2008
Thanks Murphy.
Do you mean that the old_procfs.h file raises the issue? Could you please present it a little more detail?

Sorry for responsing a little bit late
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Linux

Problem with procfs.h file

hello Forum members. please find the below iisue and help me to solve the issue. The below variable is declared in the procfs.h and applications has succuessful running on solaris but,as part of my work i am porting the entire application on linux. the only issue remained is below one. ... (1 Reply)
Discussion started by: kshyap
1 Replies

2. Linux

Procfs.h is in Solaris as same in Linux

Hello forum memebers, I have blocking with the issue about procfs.h while proting code from solaris to linux. so pleas let me know any difference between solaris and linux. Thanks kshyap (1 Reply)
Discussion started by: kshyap
1 Replies

3. UNIX for Dummies Questions & Answers

cc compiler and gcc compiler

hi, can we install gcc compiler in unix based OS(sun solar,IBM AIX,HP,etc) and also can we install sun cc compiler in AIX environment and vice versa. and more ..is linux support cc compiler regards Ajay (3 Replies)
Discussion started by: ajaysahoo
3 Replies

4. Programming

how to find if C compiler in Solaris

Hi experts, How do I find if a C compiler is installed on Solaris ? > cc -o ksh: cc: not found > CC ksh: CC: not found > gcc ksh: gcc: not found I am using Solaris 5.8 Thanks, Sameer. (1 Reply)
Discussion started by: ensameer
1 Replies

5. AIX

how to find out the compiler version and OS from binary file

Command to get the Compiler version(xlc/gcc) from the binary on AIX platform. I m searching for the Command, to get the Compiler(xlc/gcc) used to build the binary on AIX. I got two commands used on Linux Platform: - readelf -a <lib> | grep comment - hexdump -C -s 0x49e7b -n 1812 <lib> ... (1 Reply)
Discussion started by: Prajakta
1 Replies

6. Programming

How Can a Machine Reads a Compiler Since A Compiler is Written in Text! Not Binaries?

To make a programming language you need a compiler, so what was the first programming language and how was is created if you need the compiler first? The compiler itself is considered as a high language comparing to the machine! since the compiler is not created in 1's and 0's... Eventhough i... (12 Replies)
Discussion started by: f.ben.isaac
12 Replies

7. Solaris

how to find which c/c++ compiler is used in solaris10

Dear Frnz Could you tell how to determine the c/c++ compiler version installed in the solaris 10/solaris 8. IT could be very helpful if you can tell me the pkg name also. Thanks (2 Replies)
Discussion started by: sriram.s
2 Replies

8. UNIX for Dummies Questions & Answers

xl C/C++ compiler to GCC compiler

Hi, we are converting from IBM-AIX(xl c/c++ compiler) to Linux(GCC complier). As a part of this i need to change the CFLAGS. The xl c/c++ complier CFLAGS is CFLAGS := $(CDEBUG) $(PROJECT_INCLUDE_DIRS) $(COBJECT_MODE) -qcpluscmt -qmakedep -qcheck=all \ -qalign=bit_packed $(LINT_FLAGS)... (0 Replies)
Discussion started by: pbattu1
0 Replies

9. Shell Programming and Scripting

How to find our working compiler

Hi, I am using Turbo Linux and needs to install Samba on it. But it said that could not find gcc. My question is how to find out which compiler is working on my system. I tried echo $CC but it gave me nothing. How can I set environmental compiler to c. Thanks in advance. (8 Replies)
Discussion started by: s_aamir
8 Replies
Login or Register to Ask a Question