Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have downloaded the file bwbar-1.2.tar.gz from kernel.org, but when I type make i comes up with an error and it fails to compile..
And the problem is: I really have no clue whatsoever on whats wrong.. Can anyone please help?
I am running:
Rehat 9
gcc 3.2.2
Here is the output:
[root@trinisrv bwbar-1.2]# make
gcc -Wall -O2 -s -o bwbar bwbar.c -lpng
bwbar.c:32:17: png.h: No such file or directory
bwbar.c: In function `write_bar_graph':
bwbar.c:44: syntax error before "palette"
bwbar.c: At top level:
bwbar.c:56: parse error before "png_ptr"
bwbar.c:56: warning: type defaults to `int' in declaration of `png_ptr'
bwbar.c:56: warning: initialization makes integer from pointer without a cast
bwbar.c:56: warning: data definition has no type or storage class
bwbar.c:57: parse error before "info_ptr"
bwbar.c:57: warning: type defaults to `int' in declaration of `info_ptr'
bwbar.c:57: warning: initialization makes integer from pointer without a cast
bwbar.c:57: warning: data definition has no type or storage class
bwbar.c:58: parse error before '*' token
bwbar.c:58: warning: type defaults to `int' in declaration of `border_row'
bwbar.c:58: warning: data definition has no type or storage class
bwbar.c:59: parse error before '*' token
bwbar.c:59: warning: type defaults to `int' in declaration of `bar_row'
bwbar.c:59: warning: data definition has no type or storage class
bwbar.c:60: parse error before '*' token
bwbar.c:60: warning: type defaults to `int' in declaration of `bp'
bwbar.c:60: warning: data definition has no type or storage class
bwbar.c:63: warning: type defaults to `int' in declaration of `bwidth'
bwbar.c:63: `width' undeclared here (not in a function)
bwbar.c:63: `border' undeclared here (not in a function)
bwbar.c:63: warning: data definition has no type or storage class
bwbar.c:64: warning: type defaults to `int' in declaration of `bheight'
bwbar.c:64: `height' undeclared here (not in a function)
bwbar.c:64: `border' undeclared here (not in a function)
bwbar.c:64: warning: data definition has no type or storage class
bwbar.c:66: warning: type defaults to `int' in declaration of `border_row'
bwbar.c:66: conflicting types for `border_row'
bwbar.c:58: previous declaration of `border_row'
bwbar.c:66: `png_byte' undeclared here (not in a function)
bwbar.c:66: warning: data definition has no type or storage class
bwbar.c:67: warning: type defaults to `int' in declaration of `bar_row'
bwbar.c:67: conflicting types for `bar_row'
bwbar.c:59: previous declaration of `bar_row'
bwbar.c:67: `png_byte' undeclared here (not in a function)
bwbar.c:67: warning: data definition has no type or storage class
bwbar.c:69: parse error before "if"
bwbar.c:72: warning: type defaults to `int' in declaration of `png_ptr'
bwbar.c:72: redefinition of `png_ptr'
bwbar.c:56: `png_ptr' previously defined here
bwbar.c:72: warning: implicit declaration of function `png_create_write_struct'
bwbar.c:72: `PNG_LIBPNG_VER_STRING' undeclared here (not in a function)
bwbar.c:73: initializer element is not constant
bwbar.c:73: warning: data definition has no type or storage class
bwbar.c:75: parse error before "if"
bwbar.c:78: warning: type defaults to `int' in declaration of `info_ptr'
bwbar.c:78: redefinition of `info_ptr'
bwbar.c:57: `info_ptr' previously defined here
bwbar.c:78: warning: implicit declaration of function `png_create_info_struct'
bwbar.c:78: initializer element is not constant
bwbar.c:78: warning: data definition has no type or storage class
bwbar.c:79: parse error before "if"
bwbar.c:87: warning: type defaults to `int' in declaration of `png_init_io'
bwbar.c:87: warning: parameter names (without types) in function declaration
bwbar.c:87: warning: data definition has no type or storage class
bwbar.c:89: warning: type defaults to `int' in declaration of `png_set_compression_level'
bwbar.c:89: warning: parameter names (without types) in function declaration
bwbar.c:89: warning: data definition has no type or storage class
bwbar.c:92: parse error before numeric constant
bwbar.c:94: warning: type defaults to `int' in declaration of `png_set_IHDR'
bwbar.c:94: warning: data definition has no type or storage class
bwbar.c:96: parse error before numeric constant
bwbar.c:96: warning: type defaults to `int' in declaration of `png_set_PLTE'
bwbar.c:96: warning: data definition has no type or storage class
bwbar.c:98: warning: type defaults to `int' in declaration of `png_write_info'
bwbar.c:98: warning: parameter names (without types) in function declaration
bwbar.c:98: warning: data definition has no type or storage class
bwbar.c:100: warning: type defaults to `int' in declaration of `png_set_packing'
bwbar.c:100: warning: parameter names (without types) in function declaration
bwbar.c:100: warning: data definition has no type or storage class
bwbar.c:105: parse error before "__extension__"
bwbar.c:105: parse error before "__uint8_t"
bwbar.c:105: warning: type defaults to `int' in declaration of `__s'
bwbar.c:105: warning: data definition has no type or storage class
bwbar.c:105: parse error before '}' token
bwbar.c:105: warning: initialization makes pointer from integer without a cast
bwbar.c:105: initializer element is not constant
bwbar.c:105: parse error before "switch"
bwbar.c:105: warning: type defaults to `int' in declaration of `__u'
bwbar.c:105: conflicting types for `__u'
bwbar.c:105: previous declaration of `__u'
bwbar.c:105: warning: data definition has no type or storage class
bwbar.c:105: parse error before "case"
bwbar.c:105: warning: type defaults to `int' in declaration of `__u'
bwbar.c:105: warning: initialization makes integer from pointer without a cast
bwbar.c:105: initializer element is not constant
bwbar.c:105: warning: data definition has no type or storage class
bwbar.c:105: parse error before "case"
bwbar.c:105: warning: type defaults to `int' in declaration of `__u'
bwbar.c:105: redefinition of `__u'
bwbar.c:105: `__u' previously defined here
bwbar.c:105: warning: initialization makes integer from pointer without a cast
bwbar.c:105: initializer element is not constant
bwbar.c:105: warning: data definition has no type or storage class
bwbar.c:105: parse error before "case"
bwbar.c:105: warning: type defaults to `int' in declaration of `__u'
bwbar.c:105: redefinition of `__u'
bwbar.c:105: `__u' previously defined here
bwbar.c:105: warning: initialization makes integer from pointer without a cast
bwbar.c:105: initializer element is not constant
bwbar.c:105: warning: data definition has no type or storage class
bwbar.c:105: parse error before '->' token
bwbar.c:105: warning: type defaults to `int' in declaration of `__u'
bwbar.c:105: redefinition of `__u'
bwbar.c:105: `__u' previously defined here
bwbar.c:105: warning: initialization makes integer from pointer without a cast
bwbar.c:105: initializer element is not constant
bwbar.c:105: warning: data definition has no type or storage class
bwbar.c:105: parse error before "case"
bwbar.c:105: warning: type defaults to `int' in declaration of `__u'
bwbar.c:105: redefinition of `__u'
bwbar.c:105: `__u' previously defined here
bwbar.c:105: warning: initialization makes integer from pointer without a cast
bwbar.c:105: initializer element is not constant
bwbar.c:105: warning: data definition has no type or storage class
bwbar.c:105: parse error before "case"
bwbar.c:105: warning: type defaults to `int' in declaration of `__u'
bwbar.c:105: redefinition of `__u'
bwbar.c:105: `__u' previously defined here
bwbar.c:105: warning: initialization makes integer from pointer without a cast
bwbar.c:105: initializer element is not constant
bwbar.c:105: warning: data definition has no type or storage class
bwbar.c:105: parse error before "case"
bwbar.c:105: warning: type defaults to `int' in declaration of `__u'
bwbar.c:105: redefinition of `__u'
bwbar.c:105: `__u' previously defined here
bwbar.c:105: warning: initialization makes integer from pointer without a cast
bwbar.c:105: initializer element is not constant
bwbar.c:105: warning: data definition has no type or storage class
bwbar.c:105: parse error before "case"
bwbar.c:105: warning: type defaults to `int' in declaration of `__u'
bwbar.c:105: redefinition of `__u'
bwbar.c:105: `__u' previously defined here
bwbar.c:105: warning: initialization makes integer from pointer without a cast
bwbar.c:105: initializer element is not constant
bwbar.c:105: warning: data definition has no type or storage class
bwbar.c:105: parse error before "case"
bwbar.c:105: warning: type defaults to `int' in declaration of `__u'
bwbar.c:105: redefinition of `__u'
bwbar.c:105: `__u' previously defined here
bwbar.c:105: warning: initialization makes integer from pointer without a cast
bwbar.c:105: initializer element is not constant
bwbar.c:105: warning: data definition has no type or storage class
bwbar.c:105: parse error before "case"
bwbar.c:105: warning: type defaults to `int' in declaration of `__u'
bwbar.c:105: redefinition of `__u'
bwbar.c:105: `__u' previously defined here
bwbar.c:105: warning: initialization makes integer from pointer without a cast
bwbar.c:105: initializer element is not constant
bwbar.c:105: warning: data definition has no type or storage class
bwbar.c:105: parse error before "case"
bwbar.c:105: warning: type defaults to `int' in declaration of `__u'
bwbar.c:105: redefinition of `__u'
bwbar.c:105: `__u' previously defined here
bwbar.c:105: warning: initialization makes integer from pointer without a cast
bwbar.c:105: initializer element is not constant
bwbar.c:105: warning: data definition has no type or storage class
bwbar.c:105: parse error before "case"
bwbar.c:105: warning: type defaults to `int' in declaration of `__u'
bwbar.c:105: redefinition of `__u'
bwbar.c:105: `__u' previously defined here
bwbar.c:105: warning: initialization makes integer from pointer without a cast
bwbar.c:105: initializer element is not constant
bwbar.c:105: warning: data definition has no type or storage class
bwbar.c:105: parse error before "case"
bwbar.c:105: warning: type defaults to `int' in declaration of `__s'
bwbar.c:105: warning: data definition has no type or storage class
bwbar.c:105: parse error before '}' token
bwbar.c:105: parse error before '\x0'
bwbar.c:105: warning: type defaults to `int' in declaration of `__builtin_memset'
bwbar.c:105: warning: data definition has no type or storage class
bwbar.c:105: warning: type defaults to `int' in declaration of `__s'
bwbar.c:105: warning: data definition has no type or storage class
bwbar.c:105: parse error before '}' token
bwbar.c:108: warning: type defaults to `int' in declaration of `bp'
bwbar.c:108: conflicting types for `bp'
bwbar.c:60: previous declaration of `bp'
bwbar.c:108: warning: data definition has no type or storage class
bwbar.c:109: parse error before "for"
bwbar.c:112: warning: type defaults to `int' in declaration of `spacer'
bwbar.c:112: warning: data definition has no type or storage class
bwbar.c:113: parse error before "for"
bwbar.c:115: warning: type defaults to `int' in declaration of `fspacer'
bwbar.c:115: `spacers' undeclared here (not in a function)
bwbar.c:115: warning: data definition has no type or storage class
bwbar.c:116: parse error before "if"
bwbar.c:123: parse error before '++' token
bwbar.c:124: warning: type defaults to `int' in declaration of `spacer'
bwbar.c:124: redefinition of `spacer'
bwbar.c:112: `spacer' previously defined here
bwbar.c:124: initializer element is not constant
bwbar.c:124: warning: data definition has no type or storage class
bwbar.c:125: parse error before '}' token
bwbar.c:139: warning: type defaults to `int' in declaration of `png_write_end'
bwbar.c:139: warning: parameter names (without types) in function declaration
bwbar.c:139: warning: data definition has no type or storage class
bwbar.c:140: warning: type defaults to `int' in declaration of `status'
bwbar.c:140: redefinition of `status'
bwbar.c:61: `status' previously defined here
bwbar.c:140: warning: data definition has no type or storage class
bwbar.c:142: parse error before ':' token
make: *** [bwbar] Error 1
`libpng-config --ldflags` instead of -lpng12
When I'm too lazy to write a configure and I just make a makefile I use this. It executes the program and uses it's output. Note the ` encasing it.
Many many if not most libraries of this sort have this kind of program.
ls /usr/bin |grep config
To get a list of them, or just use the tab autocomplete to find them.
Seems that you don't need the cflags but for future refenrece you'd need
libpng-config --cflags and libpng-config --ldflags
The former is used when generating object files, .o files, that's the kind of error you had in the first place. The latter is for linking the kind of error you have now.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.