[Bf-committers] Libraries missing target_link_libraries(...

Richard Shaw hobbes1069 at gmail.com
Sat Aug 6 14:21:48 CEST 2011

Not having gotten any replies to my last few questions I'm starting to
think I'm becoming a bother, but I'll try again...

I've been working on a blender-cycles build for Fedora and I thought I
was getting pretty close until I ran rpmlint on the installed blender

I noticed I had seemingly 1000+ errors of:
"undefined-non-weak-symbols" which basically means the libraries built
by blender are not being linked with all the libraries they should be.

I've started adding "target_link_libraries(..." after
"blender_add_lib" to fix this, for example:

>From my installed blender instance:
$ ldd -d /usr/lib64/libbf_avi.so
	linux-vdso.so.1 =>  (0x00007ffff09d1000)
	libgomp.so.1 => /usr/lib64/libgomp.so.1 (0x00007fc621e67000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fc621c4c000)
	libc.so.6 => /lib64/libc.so.6 (0x00007fc6218b2000)
	librt.so.1 => /lib64/librt.so.1 (0x00007fc6216aa000)
	libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fc621495000)
	/lib64/ld-linux-x86-64.so.2 (0x00007fc6222aa000)
undefined symbol: jpeg_resync_to_restart	(/usr/lib64/libbf_avi.so)

All I did was add:

target_link_librarires(bf_avi ${JPEG_LIBRARIES})

after the appropriate "blender_add_lib(bf_avi...)

And now I get this from my local build lib directory:
$ ldd -d libbf_avi.so
	linux-vdso.so.1 =>  (0x00007fff48fff000)
	libjpeg.so.62 => /usr/lib64/libjpeg.so.62 (0x00007f57dc894000) <----
	libgomp.so.1 => /usr/lib64/libgomp.so.1 (0x00007f57dc687000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f57dc46b000)
	libc.so.6 => /lib64/libc.so.6 (0x00007f57dc0d2000)
	librt.so.1 => /lib64/librt.so.1 (0x00007f57dbeca000)
	libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f57dbcb4000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f57dcd16000)

So I have two questions:

1. Is this the right way to fix this? (I would assume yes from a cmake
perspective, but wasn't sure if there was a more "blender" way to do

2. Am I wasting my time fixing this? In other words. If I can supply a
diff when I'm done, will you use it?


More information about the Bf-committers mailing list