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.
Normally I install software from my distro (ubuntu 10.04) repositories. However, I have need for an app which is not in the distros. I downloaded the latest version from http://newspost.unixcab.org/
I extracted the source code. The instructions say to run make and make install. make produces the following error
Quote:
ken@taylor12:~/Desktop/newspost-2.1.1$ make
make main CFLAGS="-O2 -Wall" LIBS=""
make[1]: Entering directory `/home/ken/Desktop/newspost-2.1.1'
cd base ; make CC="gcc" CFLAGS="-O2 -Wall"
make[2]: Entering directory `/home/ken/Desktop/newspost-2.1.1/base'
gcc -O2 -Wall -o test test.c
In file included from newspost.h:40,
from test.c:20:
utils.h:29: error: conflicting types for ‘getline’
/usr/include/stdio.h:651: note: previous declaration of ‘getline’ was here
make[2]: *** [test] Error 1
make[2]: Leaving directory `/home/ken/Desktop/newspost-2.1.1/base'
make[1]: *** [main] Error 2
make[1]: Leaving directory `/home/ken/Desktop/newspost-2.1.1'
make: *** [opt] Error 2
As I read the the offending files...
stdio.h
Code:
/* Like `getdelim', but reads up to a newline.
This function is not part of POSIX and therefore no official
cancellation point. But due to similarity with an POSIX interface
or due to the implementation it is a cancellation point and
therefore not marked with __THROW. */
extern _IO_ssize_t getline (char **__restrict __lineptr,
size_t *__restrict __n,
FILE *__restrict __stream) __wur;
utils.h
Code:
Buff * getline(Buff *buff, FILE *file);
So I guess my question is... is the problem with the application source or something in my environment? What should my next steps be?
I got the same error when I tried to compile it. I "fixed" it by changing the name of the funtion defined in utils.h to avoid the conflict, and changed any later references in the code to use the new name.
Specifically, I changed the "getline" in utils.h to "myGetline" and so on.
Here's a list of the references you would need to change:
line 29: base/utils.h
line 46: base/utils.c
line 345: base/newspost.c
line 335: ui/options.c
line 432: ui/options.c
The reason I said "fixed" was because, with the above changes, the code compiles cleanly. I did not test whether it functions correctly.
EDIT:
If you make the changes and still get an error (of some sort) during compile, then I can probably post a patch file to make the process automated... I may have missed a reference (hopefully not) or might not have been clear (much more likely).
Last edited by Dark_Helmet; 04-06-2012 at 11:09 AM.
I think the problem is with the software. They declared a function getline which has the same name as the standard in stdio.h. You can try to change the name to something else and compile again. For example, from inside the main installation directory:
This will change every occurrence of getline with getline_. Notice the word boundaries in the sed expression to match only the whole word and excluding some other function names containing the string getline (if any). Then issue make again.
Thanks folks. I didn't really expect someone to do the work and fix this for me. As the problem is with the software source and not my environment I will raise the issue with the developers. I am not sure what they use for bug tracking but I will make the effort to find out. With your permission I will pass along the information and fixes you have provided so that the problem can be properly and completely addressed.
Thanks again,
Ken
p.s. It seems that the last update was May 2003 so I suspect the app may no longer be supported. I have an email address for the developer and I will send a link to this thread.
As the problem is with the software source and not my environment I will raise the issue with the developers.
Thank you! This is the right track to follow. I would have suggested the same, even if - as you already noticed - the software is no longer maintained.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.