> -----Original Message-----
> From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-
> boun...@sqlite.org] On Behalf Of Eduardo Morras
> Sent: 08 July 2014 10:19


> On Mon, 7 Jul 2014 12:44:54 +0000
> Andy Ling <andy.l...@quantel.com> wrote:
> 
> > Building the original file with the flags.........
> >
> > -DHAVE_UTIME -DSQLITE_OMIT_LOAD_EXTENSION
> > -DSQLITE_ENABLE_LOCKING_STYLE
> >
> > I get the following errors.....
> >
> > sqlite3.c: In function 'posixFchown':
> > sqlite3.c:24249: warning: implicit declaration of function 'geteuid'
> > sqlite3.c:24249: warning: implicit declaration of function 'fchown'
> > sqlite3.c: At top level:
> > sqlite3.c:24306: error: 'pread' undeclared here (not in a function)
> <snip>
> 
> Are you trying to use -DSQLITE_OMIT* with the amalgamation sqlite3.c or
> with the full sqlite3 src? Most of -DSQLITE_OMIT* won't work if you use the
> amalgamation.
> 

I'm using the amalgamation. I seemed to need the  SQLITE_OMIT_LOAD_EXTENSION to 
get close to a build that works. I've just tried removing all compile options 
and with the patched amalgamation I get......

sqlite3.c: In function 'posixFchown':
sqlite3.c:24249: warning: implicit declaration of function 'geteuid'
sqlite3.c:24249: warning: implicit declaration of function 'fchown'
sqlite3.c: At top level:
sqlite3.c:24996: error: expected specifier-qualifier-list before 'sem_t'
sqlite3.c: In function 'semCheckReservedLock':
sqlite3.c:26377: error: 'sem_t' undeclared (first use in this function)
sqlite3.c:26377: error: (Each undeclared identifier is reported only once
sqlite3.c:26377: error: for each function it appears in.)
sqlite3.c:26377: error: 'pSem' undeclared (first use in this function)
sqlite3.c:26377: error: 'unixInodeInfo' has no member named 'pSem'
sqlite3.c:26379: warning: implicit declaration of function 'sem_trywait'
sqlite3.c:26390: warning: implicit declaration of function 'sem_post'
sqlite3.c: In function 'semLock':
sqlite3.c:26430: error: 'sem_t' undeclared (first use in this function)
sqlite3.c:26430: error: 'pSem' undeclared (first use in this function)
sqlite3.c:26430: error: 'unixInodeInfo' has no member named 'pSem'
sqlite3.c: In function 'semUnlock':
sqlite3.c:26463: error: 'sem_t' undeclared (first use in this function)
sqlite3.c:26463: error: 'pSem' undeclared (first use in this function)
sqlite3.c:26463: error: 'unixInodeInfo' has no member named 'pSem'
sqlite3.c: In function 'fillInUnixFile':
sqlite3.c:29263: error: 'unixInodeInfo' has no member named 'pSem'
sqlite3.c:29264: error: 'unixInodeInfo' has no member named 'aSemName'
sqlite3.c:29270: error: 'unixInodeInfo' has no member named 'pSem'
sqlite3.c:29270: warning: implicit declaration of function 'sem_open'
sqlite3.c:29271: error: 'unixInodeInfo' has no member named 'pSem'
sqlite3.c:29271: error: 'SEM_FAILED' undeclared (first use in this function)
sqlite3.c:29273: error: 'unixInodeInfo' has no member named 'aSemName'

It may be I needed the OMIT to get the link to work, once the above has been 
fixed I'll let you know.

Most of this can be fixed by adding a #include <semaphore.h>. So by making the 
change......

#if SQLITE_ENABLE_LOCKING_STYLE
# include <sys/ioctl.h>
# if OS_VXWORKS
#  include <semaphore.h>
#  include <limits.h>
# else
#  include <sys/file.h>
#  include <sys/param.h>
# endif
#else
# if OS_VXWORKS
#  include <semaphore.h>
# endif
#endif /* SQLITE_ENABLE_LOCKING_STYLE */

I now just get....

sqlite3.c: In function 'posixFchown':
sqlite3.c:24253: warning: implicit declaration of function 'geteuid'
sqlite3.c:24253: warning: implicit declaration of function 'fchown'

Trying to link this I get the following unresolved symbols...

In function `posixFchown':
undefined reference to `geteuid'
In function `dotlockLock':
undefined reference to `utimes'
In function `unixDlError':
undefined reference to `dlerror'
In function `unixDlSym':
undefined reference to `dlsym'
In function `posixFchown':
undefined reference to `fchown'
In function `unixDlClose':
undefined reference to `dlclose'
In function `unixDlOpen':
undefined reference to `dlopen'

Adding the -DHAVE_UTIME option fixes the utimes reference
Adding the -DSQLITE_OMIT_LOAD_EXTENSION fixes the dl* references, which just 
leaves geteuid & fchown.

Regards

Andy Ling

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to