-3

I am trying to run the C libraries from SIGAR API. In the include directory it has few .h files, which i am trying run using below commands. I get "cannot execute binary file", how do i fix it?

[oracle@oracleapps include]$ pwd
/home/oracle/sigar/hyperic-sigar-1.6.4/sigar-bin/include
[oracle@oracleapps include]$ cc -o test sigar_fileinfo.h
[oracle@oracleapps include]$ ./test
-bash: ./test: cannot execute binary file
[oracle@oracleapps include]$
Coool Awesome
  • 145
  • 1
  • 5
  • 16
  • 7
    i am not familiar with sigar, but generally .h files are meant to be included in your code , not compiled and executed by themselves. – Gir Aug 09 '12 at 23:31
  • 2
    And libraries also don't run by themselves, they're meant to be linked into applications that you write. The header files are used to provide the declarations so that the functions will be recognized and called properly. – Barmar Aug 09 '12 at 23:34
  • 3
    That file [sigar_fileinfo.h](https://github.com/hyperic/sigar/blob/master/include/sigar_fileinfo.h) contains information for C programs that intend to use the SIGAR library. Are you sure you know what to do with `.h` files? – Blastfurnace Aug 09 '12 at 23:53
  • @Blastfurnace can you give me simple example how to run anything of the file in sigar api? – Coool Awesome Aug 10 '12 at 00:32
  • I don't know what you are trying to do. Do you know how to write `C` programs? Do you know any of the other languages SIGAR supports (Java, Perl, Ruby, Python, Erlang, PHP and C#)? Did you read the [documentation](http://sigar.hyperic.com/)? – Blastfurnace Aug 10 '12 at 00:54
  • Sorry, I'm not familiar with SIGAR and you don't know `C` so this is beyond the scope of what I can do with my spare time here on SO. Good luck. – Blastfurnace Aug 10 '12 at 01:39

1 Answers1

0

I realize that i cannot compile .h files, hence i wrote another .c program and called the c libraries. This have resolved my issue

Coool Awesome
  • 145
  • 1
  • 5
  • 16