From: Dan L. <da...@la...> - 2003-12-08 16:10:05
|
On 6 Dec 2003 at 22:36, Kern Sibbald wrote: > On Sat, 2003-12-06 at 15:16, Dan Langille wrote: > > There is one compile issue (see > > http://beta.freebsddiary.org/bacula/build.1.html for a better format) > > > > c++ -L/usr/local/lib -pthread -L../lib -L../cats -L../findlib -o > > bacula-dir dird.o admin.o authenticate.o autoprune.o backup.o bs > > r.o catreq.o dird_conf.o expand.o fd_cmds.o getmsg.o inc_conf.o > > job.o jobq.o mountreq.o msgchan.o next_vol.o newvol.o recycle.o > > restore.o run_conf.o scheduler.o sql_cmds.o ua_cmds.o ua_dotcmds.o > > ua_query.o ua_input.o ua_label.o ua_output.o ua_prune.o ua > > _purge.o ua_restore.o ua_run.o ua_select.o ua_server.o ua_status.o > > ua_tree.o verify.o -lsql -lbac -lfind -lm -D_THREAD_SAFE -lw > > rap -lxpg4 > > next_vol.o: In function ind_next_volume_for_append(JCR *, MEDIA_DBR > > *, int)': > > next_vol.o(.text+0xbd): undefined reference to > > b_find_next_volume(JCR *, s_db *, int, bool, MEDIA_DBR *)' > > next_vol.o(.text+0x225): undefined reference to > > b_find_next_volume(JCR *, s_db *, int, bool, MEDIA_DBR *)' > > recycle.o: In function ind_recycled_volume(JCR *, bool, MEDIA_DBR > > *)': > > recycle.o(.text+0xcf): undefined reference to b_find_next_volume(JCR > > *, s_db *, int, bool, MEDIA_DBR *)' > > *** Error code 1 > > Three ideas: > > 1. Perhaps you need to do a "make depend". I'm not sure it happens > automatically when you add new files. It is done at ./configure time, > but not otherwise. > > 2. What is the -D_THREAD_SAFE probably shouldn't be on the link. > In any case as long as you #include "bacula.h" as you should, you > will automatically get: > > #define _REENTRANT 1 > #define _THREAD_SAFE 1 > #define _POSIX_PTHREAD_SEMANTICS 1 > This is very unlikely to be causing problems, but should be > eliminated. > > 3. More likely, you have simply called the function in your file, but > with a different # of arguments, or argument type that is not > automatically upgraded (e.g. char -> int). In C++, you can have the > same subroutine name with different number of arguments, or different > argument types, and each one must be independently defined (in reality > each one *is* a separate subroutine call the name is just a mangling of > the arguments). > > 4. Most likely, you used the name b_find_next_volume() instead of > db_find_next_volume(). The above problem was caused by this: #if HAVE_MYSQL || HAVE_SQLITE instead of this: #if HAVE_MYSQL || HAVE_SQLITE || HAVE_POSTGRESQL Once that was fixed, things started to compile. I have completed my first cut at adding PostgreSQL functionality. I have added a new configuration item "--with-postgresql". Everything compiles. The code is incomplete. Some functions are empty, but it does compile. I have have done test builds using with "--with-mysql" and "--with-sqlite" to confirm those are not broken. I have not tested any code associated with these changes. Some changes are to the configuration area of Bacula. The full diff is at http://www.freebsddiary.org/bacula/ I also added some .cvsignore entries, so have a look at those too please. cheers -- Dan Langille : http://www.langille.org/ |