On Tue, 5 Aug 2014 15:31:43 -0400
Dan Langille <d...@langille.org> wrote:

> I am encountering a link error with the Bacula 7.0.4 static client and I 
> don’t know how to fix this.
> 
> long version: 
> https://redports.org//~dvl/20140805183033-13761-230584/bacula-client-static-7.0.4_1.log
> 
> Short version:
> 
> Linking bacula-fd ...
> /usr/bin/c++  -L/usr/local/lib -liconv -L../lib -L../findlib -o bacula-fd 
> filed.o authenticate.o acl.o backup.o estimate.o fd_plugins.o accurate.o 
> filed_conf.o heartbeat.o job.o restore.o status.o verify.o verify_vol.o 
> xattr.o    -lz -lbacfind -lbaccfg -lbac -lm -lpthread  -lintl    
> /usr/local/lib/libintl.so -Wl,-rpath -Wl,/usr/local/lib -lssl -lcrypto   
> -llzo2
> /usr/bin/c++  -L/usr/local/lib -liconv -static -L../lib -L../findlib -o 
> static-bacula-fd filed.o authenticate.o acl.o backup.o estimate.o 
> fd_plugins.o accurate.o filed_conf.o heartbeat.o job.o restore.o status.o 
> verify.o verify_vol.o xattr.o    -lz -lbacfind -lbaccfg -lbac -lm -lpthread  
> -lintl    /usr/local/lib/libintl.a -Wl,-rpath -Wl,/usr/local/lib -lssl 
> -lcrypto   
> backup.o: In function `blast_data_to_storage_daemon(JCR*, char*)':
> backup.c:(.text+0xd64): undefined reference to `__lzo_init_v2'
> backup.o: In function `save_file(JCR*, FF_PKT*, bool)':
> backup.c:(.text+0x2b4e): undefined reference to `lzo1x_1_compress'
> restore.o: In function `decompress_data(JCR*, int, char**, unsigned int*)':
> restore.c:(.text+0x457): undefined reference to `lzo1x_decompress_safe'
> restore.o: In function `do_restore(JCR*)':
> restore.c:(.text+0x1eab): undefined reference to `__lzo_init_v2'
> /usr/local/lib/libintl.a(dcigettext.o): In function `_nl_find_msg':
> dcigettext.c:(.text+0x94b): undefined reference to `libiconv_open'
> dcigettext.c:(.text+0x9fa): undefined reference to `libiconv'
> dcigettext.c:(.text+0xbaf): undefined reference to `libiconv_open'
> /usr/local/lib/libintl.a(relocatable.o): In function 
> `libintl_set_relocation_prefix':
> relocatable.c:(.text+0x14b): undefined reference to 
> `libiconv_set_relocation_prefix'
> *** [static-bacula-fd] Error code 1
> 1 error
> 
> — 
> Dan Langille
> 

Hello Dan,
'-lzo2' is missing from the link command executed to generate the static binary.
I checked the Makefile.in in src/filed provided in 7.0.4 version. If '-lzo2' is 
used for the dynamic binary it should be used for the static one. The same 
variable is used in both case $(LZO_LIBS).

bacula-fd:  Makefile $(SVROBJS) ../findlib/libbacfind$(DEFAULT_ARCHIVE_TYPE) 
../lib/libbaccfg$(DEFAULT_ARCHIVE_TYPE) ../lib/libbac$(DEFAULT_ARCHIVE_T
YPE)
        @echo "Linking $@ ..."
        $(LIBTOOL_LINK) $(CXX) $(WLDFLAGS) $(LDFLAGS) -L../lib -L../findlib -o 
$@ $(SVROBJS) \
          $(WIN32LIBS) $(FDLIBS) $(ZLIBS) -lbacfind -lbaccfg -lbac -lm $(LIBS) \
          $(DLIB) $(WRAPLIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS) $(CAP_LIBS) 
$(AFS_LIBS) $(LZO_LIBS)

static-bacula-fd: Makefile $(SVROBJS) ../findlib/libbacfind.a 
../lib/libbaccfg$(DEFAULT_ARCHIVE_TYPE) ../lib/libbac$(DEFAULT_ARCHIVE_TYPE)
        $(LIBTOOL_LINK) $(CXX) $(WLDFLAGS) $(LDFLAGS) -static -L../lib 
-L../findlib -o $@ $(SVROBJS) \
           $(WIN32LIBS) $(FDLIBS) $(ZLIBS) -lbacfind -lbaccfg -lbac -lm $(LIBS) 
\
           $(DLIB) $(WRAPLIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS) $(CAP_LIBS) 
$(AFS_LIBS) $(LZO_LIBS)
        strip $@

Could you check the generated src/filed/Makefile and src/filed/Makefile.in?

In the log: bacula-client-static-7.0.4_1 depends on shared library: liblzo2.so. 
Shouldn't it be liblzo2.a?
Do you have the static version liblzo2.a installed on your system?

-- 
Laurent

------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls. 
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
_______________________________________________
Bacula-devel mailing list
Bacula-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-devel

Reply via email to