-1

我收到错误消息: :-1: Fehler: error: gegl-0.4: linker input file not found: No such file or directory :-1: Fehler: error: babl-01: linker input file not found: No such file或目录

因此链接器无法找到库或由于未知原因无法链接它们。

我努力了:

cmake_minimum_required(VERSION 3.5)

project(perspective_lines LANGUAGES C)

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -lm gegl-0.4 babl-01 ")


#export (PKG_CONFIG_PATH="${GIMP_PREFIX}/share/pkgconfig:${GIMP_PREFIX}/lib64/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"")

#add_compile_options(  -L/usr/lib64/libm.so -lm -std=gnu11 -v)
find_package(GTK2 REQUIRED)
include_directories(${GTK2_ATK_INCLUDE_DIR})
include_directories(${GTK2_CAIRO_INCLUDE_DIR})
include_directories(${GTK2_GDKCONFIG_INCLUDE_DIR})
include_directories(${GTK2_GDK_PIXBUF_INCLUDE_DIR})
include_directories(${GTK2_GLIBCONFIG_INCLUDE_DIR})
include_directories(${GTK2_GLIB_INCLUDE_DIR})
include_directories(${GTK2_GTK_INCLUDE_DIR})
include_directories(${GTK2_PANGO_INCLUDE_DIR})

include_directories("${ROOT_SOURCE_DIR}/usr/include/gegl-0.4")
include_directories("${ROOT_SOURCE_DIR}/usr/include/babl-0.1")

include_directories("${ROOT_SOURCE_DIR}/usr/lib64")
include_directories("${ROOT_SOURCE_DIR}/usr/src/debug/glibc-2.34-2.1.x86_64/cc-base/math")
include_directories("${ROOT_SOURCE_DIR}/usr/src/debug/glibc-2.34-2.1.x86_64/")

find_path(LIBGIMP_INCLUDE_DIR libgimp PATH_SUFFIXES gimp-2.0)
find_library(LIBGIMP_LIBRARY NAMES gimp-2.0 libgimp-2.0 PATH_SUFFIXES lib)
find_library(LIBGIMP_UI_LIBRARY NAMES gimpui-2.0 libgimpui-2.0 PATH_SUFFIXES lib)
find_library(LIBGIMP_WIDGETS_LIBRARY NAMES gimpwidgets-2.0 libgimpwidgets-2.0 PATH_SUFFIXES lib)
include_directories(${LIBGIMP_INCLUDE_DIR})


#find_path(LIBGEGL_INCLUDE_DIR libgegl PATH_SUFFIXES gegl-0.4)
#find_library(LIBGEGL_LIBRARY NAMES gegl-0.4 libgegl-0.4 PATH_SUFFIXES lib)
#include_directories(${LIBGEGL_INCLUDE_DIR})

include_directories(${CMAKE_SOURCE_DIR}/src)

set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "/usr/lib64/gcc/x86_64-suse-linux/9;/usr/lib64;/lib64;/usr/x86_64-suse-linux/lib")

set(SOURCES  perspective_lines.c )

add_executable(perspective_lines perspective_lines.c)

target_link_libraries(perspective_lines
  ${GTK2_GLIB_LIBRARY_RELEASE}
  ${GTK2_ATK_LIBRARY_RELEASE}
  ${GTK2_CAIRO_LIBRARY_RELEASE}
  ${GTK2_GDK_LIBRARY_RELEASE}
  ${GTK2_GDK_PIXBUF_LIBRARY_RELEASE}
  ${GTK2_GIO_LIBRARY_RELEASE}
  ${GTK2_GMODULE_LIBRARY_RELEASE}
  ${GTK2_GOBJECT_LIBRARY_RELEASE}
  ${GTK2_GTHREAD_LIBRARY_RELEASE}
  ${GTK2_GTK_LIBRARY_RELEASE}
  ${GTK2_PANGOCAIRO_LIBRARY_RELEASE}
  ${GTK2_PANGO_LIBRARY_RELEASE}
  ${LIBGIMP_LIBRARY}
  ${LIBGIMP_UI_LIBRARY}
  ${LIBGIMP_WIDGETS_LIBRARY})

target_link_libraries(perspective_lines "/usr/lib64/libbabl-0.1.so")
target_link_libraries(perspective_lines "/usr/lib64/libgegl-04.so")
#target_link_libraries(perspective_lines gegl)

install(TARGETS perspective_lines DESTINATION ~/.config/GIMP/2.10/plug-ins/)

这也不起作用: set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -lm gegl-0.4 -L /usr/lib64/libgegl-04.so")

我的错误在哪里?

4

1 回答 1

-1

非常感谢您的回答。这就是问题所在......(令人尴尬)错误的文件名:target_link_libraries(perspective_lines "/usr/lib64/libgegl-0.4.so")

于 2021-12-06T01:04:28.067 回答