Skip to content

aarch64-linux 交叉 freetype模块失败 #3553

Open
@geekmengran

Description

@geekmengran

image
当我修改了freetype下的CMakeLists.list文件发现其能找到版本了,但是交叉编译链接时还是报错了。

opt/tool_chain/gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu/bin/../lib/gcc/aarch64-linux-gnu/8.3.0/../../../../aarch64-linux-gnu/bin/ld: cannot find -lfreetype
/opt/tool_chain/gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu/bin/../lib/gcc/aarch64-linux-gnu/8.3.0/../../../../aarch64-linux-gnu/bin/ld: cannot find -lharfbuzz
collect2: error: ld returned 1 exit status
modules/freetype/CMakeFiles/opencv_freetype.dir/build.make:96: recipe for target 'lib/libopencv_freetype.so' failed
make[2]: *** [lib/libopencv_freetype.so] Error 1
CMakeFiles/Makefile2:3993: recipe for target 'modules/freetype/CMakeFiles/opencv_freetype.dir/all' failed
make[1]: *** [modules/freetype/CMakeFiles/opencv_freetype.dir/all] Error 2
Makefile:162: recipe for target 'all' failed
make: *** [all] Error 2

这是我修改的文件内容

set(the_description "FreeType module. It enables to draw strings with outlines and mono-bitmaps/gray-bitmaps.")
if(APPLE_FRAMEWORK)
  ocv_module_disable(freetype)
endif()

if(PKG_CONFIG_FOUND)
  find_package(Freetype REQUIRED)
  find_package(harfbuzz CONFIG REQUIRED)
  pkg_search_module(FREETYPE freetype2)
  pkg_search_module(HARFBUZZ harfbuzz)
  ocv_check_modules(FREETYPE freetype2)
  ocv_check_modules(HARFBUZZ harfbuzz)
endif()

if(OPENCV_INITIAL_PASS)
  if(NOT FREETYPE_FOUND)
    message(STATUS "freetype2:   NO")
  else()
    message(STATUS "freetype2:   YES (ver ${FREETYPE_VERSION})")
  endif()

  if(NOT HARFBUZZ_FOUND)
    message(STATUS "harfbuzz:    NO")
  else()
    message(STATUS "harfbuzz:    YES (ver ${HARFBUZZ_VERSION})")
  endif()
endif()

if( FREETYPE_FOUND AND HARFBUZZ_FOUND )
  ocv_define_module(freetype opencv_core opencv_imgproc WRAP python java)  
  ocv_target_link_libraries(${the_module} ${FREETYPE_LIBRARIES} ${HARFBUZZ_LIBRARIES})
  ocv_include_directories( ${FREETYPE_INCLUDE_DIRS} ${HARFBUZZ_INCLUDE_DIRS} )
else()
  ocv_module_disable(freetype)
endif()

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions