Main index > Installation problems > FreeBSD 5.3 compile problems [SOLVED]

By cdn (User), on Mon Apr 11 15:48:44 2005: FreeBSD 5.3 compile problems [SOLVED].

I'm getting this error when I try to compile adesklets:

Code:

command.c: In function `command_error':
command.c:440: warning: implicit declaration of function `vsnprintf'
command.c: In function `dupstr_utf8':
command.c:539: warning: implicit declaration of function `strdup'
command.c:539: warning: assignment makes pointer from integer without a cast
command.c:515: warning: unused variable `m'
command.c:516: warning: unused variable `i_buf'
command.c:516: warning: unused variable `o_buf'
command.c:517: warning: unused variable `i_bytes'
command.c:517: warning: unused variable `o_bytes'
command.c:517: warning: unused variable `o_len'
command.c: In function `generic_index_generator':
command.c:632: warning: implicit declaration of function `snprintf'
command.c: In function `command_replayer':
command.c:876: warning: assignment makes pointer from integer without a cast
command.c: In function `command_interpreter':
command.c:921: error: syntax error before "fds"
command.c:925: warning: implicit declaration of function `FD_ZERO'
command.c:925: error: `fds' undeclared (first use in this function)
command.c:925: error: (Each undeclared identifier is reported only once
command.c:925: error: for each function it appears in.)
command.c:926: warning: implicit declaration of function `FD_SET'
command.c:929: warning: implicit declaration of function `select'
command.c:929: error: `FD_SETSIZE' undeclared (first use in this function)
command.c:930: warning: implicit declaration of function `FD_ISSET'
*** Error code 1


I'm using GCC 3.4.2 and I tried installing readline from ports as metioned in the FreeBSD 4.10 topic. Is there anyone who has this successfully working on a FreeBSD 5.3 machine?

By syfou (Core Developer & Desklet Author), on Mon Apr 11 17:18:13 2005.

Here, is see three libc library issues with low-level string manipulations... Apparently, the strdup (usually in <string.h>, and the virtual printf (usually in <stdarg.h>) were not found, for some unspecified reasons... there seems to be a small mismatch with the select() related calls also.

This should be pretty easy to fix, but unfortunately I do not have access to any FreeBSD 5.X machine right now... Any idea?

By SmokeyXL (User), on Wed Apr 13 06:09:39 2005.

If it's not that much work send me some instructions so I can return you a patch.
If you need access to a remote FreeBSD 5.3 box send me a PM, I have one standing here doing nothing atm..

By syfou (Core Developer & Desklet Author), on Wed Apr 13 11:30:15 2005, last edited on Wed Apr 13 18:28:53 2005.

SmokeyXL wrote:

If it's not that much work send me some instructions so I can return you a patch.

Thanks for the kind offer. As I said, this is due to the way standard functions from libc are made available and were the POSIX/BSD/ANSI C/ functions are supposed to be defined: for instance, vsprintf is defined in two standards: ISO C99 and ANSI C from the way flags are defined at the bottom of src/config.h, ISO C should be used. I scrupulously follow standards, but sometime specific platform need specific tweaks. So the job is to fiddle with those flags at the bottom of src/config.h:

Code:


/* Source is BSD compliant (ISO C, POSIX and 4.3BSD) */
#define _BSD_SOURCE 1

/* Source is POSIX 4 compliant (IEEE Std 1003.1b) */
#define _POSIX_C_SOURCE 199309

/* Source is POSIX 1 compliant (IEEE Std 1003.1) */
/* #undef _POSIX_SOURCE */


as well as with the headers inclusion sequence in the source (command.c right now, probably others too). What is expected is usually explained in the section 3 man pages for the various functions. Browsing through the headers and invoking the C preprocessor (in gcc: gcc -E) while letting the rest of the gcc invocation intact is also helpful.

SmokeyXL wrote:


If you need access to a remote FreeBSD 5.3 box send me a PM, I have one standing here doing nothing atm...

If I do not have news from you in a couple of days, I certainly will, as portability is important to me. Thanks again!

By SmokeyXL (User), on Wed Apr 13 13:23:21 2005.

I'm not that familiar with compilers and options lol..
I can do some basic c but this is probably too much for me to look into right now.. (..but i want to learn tho..)


Let me know how you wish to receive any login details..
I sent you a pm with my email address, might work a bit more convenient..

By cdn (User), on Wed Apr 13 18:00:25 2005.

OK, I now have adesklets working. I commented out the _POSIX_C_SOURCE line from src/config.h:

Code:

/* Source is POSIX 4 compliant (IEEE Std 1003.1b) */ 
/* #define _POSIX_C_SOURCE 199309  */

and now everything seems to be fine. I have yab, Calander and SystemMonitor all working.

By syfou (Core Developer & Desklet Author), on Wed Apr 13 18:22:23 2005.

Glad it was that simple. But say: does it still work if you insert:

Code:


#define _POSIX_SOURCE 1


What about warnings? Many of them? In both settings? I do need more info to provide a correct patch for next version of adesklets (adesklets 0.4.8).

By cdn (User), on Wed Apr 13 19:38:57 2005.

syfou wrote:

Glad it was that simple. But say: does it still work if you insert:

Code:


#define _POSIX_SOURCE 1


No, still fails with the same messages as before.

Quote:

What about warnings? Many of them? In both settings? I do need more info to provide a correct patch for next version of adesklets (adesklets 0.4.8).

Heres the list of warnings for when it actually builds:

Code:

cfg_scanner.c:1520: warning: 'yyunput' defined but not used

and:

Code:

command.c: In function `dupstr_utf8':
command.c:515: warning: unused variable `m'
command.c:516: warning: unused variable `i_buf'
command.c:516: warning: unused variable `o_buf'
command.c:517: warning: unused variable `i_bytes'
command.c:517: warning: unused variable `o_bytes'
command.c:517: warning: unused variable `o_len'


Edit: Missed one of the warnings

By syfou (Core Developer & Desklet Author), on Wed Apr 13 19:50:03 2005, last edited on Wed Apr 13 20:12:32 2005.

Those warnings are related... They are due to your system no having iconv support.. This is corrected in the bitkeeper tree now.

I do not understand your libraries not liking _POSIX_SOURCE either... This feels weird.... But since they are not other warning, I feel I can savely correct things blindly, as long as I get you to test a patch; Could you tell me what the output of

Code:


uname -r  -s


is on your system, just to make sure?

By cdn (User), on Wed Apr 13 19:55:43 2005.

syfou wrote:

Could you tell me what the output of

Code:


uname -r  -s


is on your system, just to make sure?


Code:

glenn% uname -r -s
FreeBSD 5.3-RELEASE-p5

By syfou (Core Developer & Desklet Author), on Wed Apr 13 20:12:55 2005, last edited on Wed Apr 13 20:57:23 2005.

Here is a link to the changes made... Let me know if it works.

By cdn (User), on Wed Apr 13 20:24:47 2005.

I'm still getting the "'yyunput' defined but not used" warning, but the other warnings are gone now. Other than that, everything is smooth to compile and install.

By syfou (Core Developer & Desklet Author), on Wed Apr 13 20:56:41 2005.

This last warning is normal and I tolerate it, since it is due to an unused hook from my flex-generated lexer... Since the rest is working, I will keep things this way, and I will consider this solved for the moment. Of course, since it is already in my tree, it will be incorporated in the upcoming release of adesklets (0.4.8). Thanks for your time, cdn.


adesklets is proud to be hosted on:

SourceForge.net Logo

Back to adesklets.sf.net.