Welcome Guest.   Make a donation to an author on the site November 24, 2014, 04:40:37 PM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
The N.A.N.Y. Challenge 2014! Download dozens of custom programs!
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: help with C......  (Read 2071 times)
dtrud0h
Charter Member
***
Posts: 55


View Profile WWW Give some DonationCredits to this forum member
« on: September 25, 2005, 09:29:13 PM »

I have just installed a linux on my desktop box (pclinuxOS)[ which is really well put together ] and I've been trying to compile an ip updater for dyndns.
the
[copy or print]
./configure
part goes ok and shows no errors, but when i run
I get the following
[copy or print]
gcc  -g -O2  -o ez-ipupdate  ez-ipupdate.o conf_file.o md5.o cache_file.o pid_file.o
conf_file.o(.text+0x270): In function `parse_conf_file':
/root/Desktop/exip/ez-ipupdate-3.0.11b7/conf_file.c:88: undefined reference to `errno'
collect2: ld returned 1 exit status
make: *** [ez-ipupdate] Error 1
error encountered
using "kedit" line 88 looks like this
[copy or print]
{
      fprintf(stderr, "could not open config file \"%s\":%s\n", fname, error_string);
      return(-1);
    }
I've said it before that I'm no coder so I have also included the conf_file.c as an attachment.(remove the .txt for the raw conf_file.c)
If any of you REALcoders can figure this out and maybe a brief description of what I am actually looking for it would be great.
BTW:  I didn't know where else to turn and this was the only place I could think of, feel free to use the dc messages to reply, or e-mail at dtrud0h@yahoo.com if the forum isn't the right place to do it. thanks again forum.

* conf_file.c.txt (4.44 KB - downloaded 139 times.)
Logged

<- I have nothing witty to put here ->
mouser
First Author
Administrator
*****
Posts: 33,693



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #1 on: September 25, 2005, 09:41:07 PM »

it's a little hard to help with this over forum, but from looking at the file, it looks like your configure is not quite detecting what it should.

at the top of your config_file.c youll see this:

Quote
#if HAVE_STRERROR
extern int errno;
#  define error_string strerror(errno)
#elif HAVE_SYS_ERRLIST
extern const char *const sys_errlist[];
extern int errno;
#  define error_string (sys_errlist[errno])
#else
#  define error_string "error message not found"
#endif

so basically its looking for some special flags that tell it whether your compiler/OS knows about errno or not.
configure is supposed to set these - but it looks like its telling your compiler that it DOES know about errno, and then your compiler doesnt really know about it (or alternatively the wrong header files are not being included).

SO, there are a couple ways you might fix it more properly, but you could try a quick fix just to see what happens if you try changing
#if HAVE_STRERROR
to
#if HAVE_STRERROR_DISABLETEST

and
#elif HAVE_SYS_ERRLIST
to
#elif HAVE_SYS_ERRLIST_DISABLETEST

that will just tell it to not try to use errno in that file; if you get further errors in further files youll have to find a more proper solution.
ideally the best solution would be to find the header files defining errno if your system supports it or figure out how to get configure to properly detect your system config better.
Logged
Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.04s | Server load: 0.09 ]