Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linker does not find libwebp functions #1

Closed
Theverat opened this issue Nov 30, 2017 · 5 comments
Closed

Linker does not find libwebp functions #1

Theverat opened this issue Nov 30, 2017 · 5 comments
Assignees

Comments

@Theverat
Copy link
Member

Theverat commented Nov 30, 2017

Build fails with this error message:

Linking CXX executable ../../bin/luxcoreui
../../lib/libluxcore.so: undefined reference to `WebPPictureImportRGB'
../../lib/libluxcore.so: undefined reference to `WebPPictureFree'
../../lib/libluxcore.so: undefined reference to `WebPPictureImportRGBA'
../../lib/libluxcore.so: undefined reference to `WebPConfigInitInternal'
../../lib/libluxcore.so: undefined reference to `WebPEncode'
../../lib/libluxcore.so: undefined reference to `WebPGetInfo'
../../lib/libluxcore.so: undefined reference to `WebPPictureInitInternal'
../../lib/libluxcore.so: undefined reference to `WebPDecodeRGBA'
collect2: error: ld returned 1 exit status
make[3]: *** [bin/luxcoreui] Error 1
make[2]: *** [samples/luxcoreui/CMakeFiles/luxcoreui.dir/all] Error 2
make[1]: *** [samples/luxcoreui/CMakeFiles/luxcoreui.dir/rule] Error 2
make: *** [luxcoreui] Error 2
 !!! luxrays luxcore pyluxcore luxcoreui compilation failed

I guess there's a -lwebp or some similar linker flag missing - but where do I have to insert it? I guess it's in one of the many CMakeLists.txt files?
I have libwebp-dev and libwebp5 installed (I'm on Ubuntu 14.04).

@Dade916
Copy link
Member

Dade916 commented Dec 1, 2017

You are building the DLL version of LuxCore. This happen because of a bug in a condition checking. If you retry with the latest version and sources, it should work.
There may be still a problem in DLL compiling on your Linux but it wasn't what you were originally trying to do.

@Dade916 Dade916 self-assigned this Dec 1, 2017
@Theverat
Copy link
Member Author

Theverat commented Dec 1, 2017

Thanks for your help. By the way, it says that it's doing an OpenCL build even though I don't have "opencl" in the LuxCore source directory name - maybe that condition check is wrong, too?
I'd like to build without OpenCL on my laptop.

I did a git pull in both LinuxCompile and LuxCore repos, but I still get exactly the same error message as in the first post.
When I cd into LinuxCompile/LuxCore and run make I get these errors:

~/P/l/L/LuxCore [2]> make
[ 21%] Built target luxrays
[ 51%] Built target slg-core
[ 58%] Built target slg-film
[ 90%] Built target slg-kernels
[ 91%] Built target luxcore
[ 92%] Built target pyluxcore
Linking CXX executable ../../bin/luxcoredemo
/home/simon/Projekte/luxcore_build/LinuxCompile/target-64-sse2/lib/libOpenImageIOBase.a(webpinput.cpp.o): In function `OpenImageIO::v1_3::webp_pvt::WebpInput::open(std::string const&, OpenImageIO::v1_3::ImageSpec&)':
webpinput.cpp:(.text+0x83e): undefined reference to `WebPGetInfo'
webpinput.cpp:(.text+0xcbb): undefined reference to `WebPDecodeRGBA'
/home/simon/Projekte/luxcore_build/LinuxCompile/target-64-sse2/lib/libOpenImageIOBase.a(webpoutput.cpp.o): In function `OpenImageIO::v1_3::webp_pvt::WebpOutput::close()':
webpoutput.cpp:(.text+0x36): undefined reference to `WebPPictureFree'
/home/simon/Projekte/luxcore_build/LinuxCompile/target-64-sse2/lib/libOpenImageIOBase.a(webpoutput.cpp.o): In function `OpenImageIO::v1_3::webp_pvt::WebpOutput::open(std::string const&, OpenImageIO::v1_3::ImageSpec const&, OpenImageIO::v1_3::ImageOutput::OpenMode)':
webpoutput.cpp:(.text+0x2ad): undefined reference to `WebPPictureInitInternal'
webpoutput.cpp:(.text+0x2fe): undefined reference to `WebPConfigInitInternal'
/home/simon/Projekte/luxcore_build/LinuxCompile/target-64-sse2/lib/libOpenImageIOBase.a(webpoutput.cpp.o): In function `OpenImageIO::v1_3::webp_pvt::WebpOutput::write_scanline(int, int, OpenImageIO::v1_3::TypeDesc, void const*, long)':
webpoutput.cpp:(.text+0x2a52): undefined reference to `WebPPictureImportRGB'
webpoutput.cpp:(.text+0x2a61): undefined reference to `WebPEncode'
webpoutput.cpp:(.text+0x3021): undefined reference to `WebPPictureImportRGBA'
collect2: error: ld returned 1 exit status
make[2]: *** [bin/luxcoredemo] Error 1
make[1]: *** [samples/luxcoredemo/CMakeFiles/luxcoredemo.dir/all] Error 2
make: *** [all] Error 2

Edit: seems someone else had this problem before:
https://lists.blender.org/pipermail/bf-committers/2012-November/038297.html

@Dade916
Copy link
Member

Dade916 commented Dec 1, 2017

I fixed the OpenCL problem.

The Webp problem happens because you have installed the "libwebp-dev" (it is not installed by default, as far as I know). OpenImageIO will include Webp support if the dev headers/library is available. However OpenImageIO seems to not statically links to the Webp library even if explicitly asked for. It looks like an OIIO makefile bug.

As solution/workaround, just remove the "libwebp-dev" package and retry (it is a good idea to start with a fresh git clone anyway).

I can patch the OIIO CMakeFile to include the support only for a specific list of file format in order to be sure to not have a problem like your.

@Dade916
Copy link
Member

Dade916 commented Dec 1, 2017

Now it should work even if "libwebp-dev" package is installed.

@Theverat
Copy link
Member Author

Theverat commented Dec 1, 2017

Cool, thanks.
After your last comment I did basically the same (commented out all lines containing webp in CMakeLists.txt of oiio) and it finally compiled.
Removing the libwebp-dev package did not help.

@Theverat Theverat closed this as completed Dec 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants