-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Opencv3.2 freetype module build failed in macOS10.12 #919
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
Comments
What freetype/hardbuzz version do you have? |
|
I think ocv_define_module() line in opencv_contrib/module/freetype/CMakeFile.txt will cause this problem.
Following works well in Ubuntu 16.04 LTS. Would you try this fix in macOS10.12 ?
|
I got the same problem while compile in macos with the same env. @Kumataro your ubuntu version solved this problem. Thanks |
on line 22 of opencv-freetype CMakefile, change ${freetype2_LIBRARIES} ${harfbuzz_LIBRARIES} to ${FREETYPE_LIBRARIES} ${HARFBUZZ_LIBRARIES} |
thank you @Kumataro @mikeseven ,that helped , solved the problem in ubuntu. |
I am still getting the same Import Error after modifying the /home/avinashr175/opencv/opencv_contrib-3.2.0/modules/freetype/CMakeLists.txt file. |
@avinashr175 did you build and installed opencv again after modifying that CMakelists.txt file ? |
Thanks a lot @bharathkotari. I built and installed opencv once again and it worked. |
The fix didn't work for me on ubuntu 16.04 Directories:
And after changing line 22 in cmake, configure, make, make install, still get the same error: |
Thank you and please could you tell us what timing the "ImportError" message shown ? Step 0) execute cmake to generate Makefile If the ImportError message is shown in step 2 or 3, could you try to remove CMakeCache.txt and rerun cmake command ? This cache file keep some partial result that cmake command executed in step 0, so that it may works wrong. If the ImportError message is shown in step 5, could you confirm your linker option for your application ? The Linker should know the location of harfbuzz and freetype libraries to use the functions which is defined in these libraries. Following is Makefile example.
|
Hey, sorry, I cannot recreate the error, I was working with docker image and tried to install it again, this time without any warnings or errors. Thank you. |
I'm experiencing this issue as well: [0] % python
Python 2.7.12 (default, Nov 19 2016, 06:48:10)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: /usr/local/lib/libopencv_freetype.so.3.2: undefined symbol: FT_Set_Pixel_Sizes
>>> I'm using OpenCV 3.2 compiled from source on a Ubuntu 16.04. |
This line causes the problem on my system, as I'm using version 3.2 of the contrib modules. |
This error still even exists in the official release of opencv in the Ubuntu/Debian repository. On a fresh ubuntu 18.04, simply doing sudo apt-get install libopencv-dev
ldd -r /usr/lib/x86_64-linux-gnu/libopencv_freetype.so pops out the following errors: undefined symbol: FT_Set_Pixel_Sizes (/usr/lib/x86_64-linux-gnu/libopencv_freetype.so)
undefined symbol: hb_shape (/usr/lib/x86_64-linux-gnu/libopencv_freetype.so)
undefined symbol: FT_Load_Glyph (/usr/lib/x86_64-linux-gnu/libopencv_freetype.so)
undefined symbol: hb_buffer_guess_segment_properties (/usr/lib/x86_64-linux-gnu/libopencv_freetype.so)
undefined symbol: hb_ft_font_create (/usr/lib/x86_64-linux-gnu/libopencv_freetype.so)
undefined symbol: FT_Outline_Transform (/usr/lib/x86_64-linux-gnu/libopencv_freetype.so)
undefined symbol: hb_buffer_destroy (/usr/lib/x86_64-linux-gnu/libopencv_freetype.so)
undefined symbol: FT_Init_FreeType (/usr/lib/x86_64-linux-gnu/libopencv_freetype.so)
undefined symbol: FT_Outline_Decompose (/usr/lib/x86_64-linux-gnu/libopencv_freetype.so)
undefined symbol: FT_Outline_Translate (/usr/lib/x86_64-linux-gnu/libopencv_freetype.so)
undefined symbol: hb_font_destroy (/usr/lib/x86_64-linux-gnu/libopencv_freetype.so)
undefined symbol: FT_Done_FreeType (/usr/lib/x86_64-linux-gnu/libopencv_freetype.so)
undefined symbol: hb_buffer_add_utf8 (/usr/lib/x86_64-linux-gnu/libopencv_freetype.so)
undefined symbol: hb_buffer_get_glyph_infos (/usr/lib/x86_64-linux-gnu/libopencv_freetype.so)
undefined symbol: FT_New_Face (/usr/lib/x86_64-linux-gnu/libopencv_freetype.so)
undefined symbol: FT_Render_Glyph (/usr/lib/x86_64-linux-gnu/libopencv_freetype.so)
undefined symbol: FT_Done_Face (/usr/lib/x86_64-linux-gnu/libopencv_freetype.so)
undefined symbol: hb_buffer_create (/usr/lib/x86_64-linux-gnu/libopencv_freetype.so) |
To contact with https://bugs.launchpad.net/ubuntu/+source/opencv/+bug/1753928 is helpful to fix this problem. In 2018, "OpenCV version in bionic is old" is reported at ubuntu community ( *1 ) . *1 https://answers.launchpad.net/ubuntu/+source/opencv/+question/665324 |
The text was updated successfully, but these errors were encountered: