ccリンカエラー

ccリンカエラー

私はDebian 12でGTKlibraryに基づいてCアプリケーションを書いています。
このプログラムはcmakeによって生成されたMakefileで構築されました。
ソースファイルのコンパイルステップは正確ですが、リンカがトリガされると次のエラーが発生します。

[ 3%] Linking C executable lux
cc: error: -E or -x required when input is from standard input

CMakeLists.txt ファイルは次のとおりです。

# Set the name and the supported language of the project
PROJECT(Lux C)
# Set the minimum version of cmake required to build this project
CMAKE_MINIMUM_REQUIRED(VERSION 3.10 FATAL_ERROR)

# Use the package PkgConfig to detect GTK+ headers/library files
FIND_PACKAGE(PkgConfig REQUIRED)
PKG_CHECK_MODULES(GTK3 REQUIRED gtk+-3.0)

set ( ORACLE_LIBS "-locci -lclntsh")
set ( ORACLE_DIR "/opt/oracle/instantclient_19_20")

# Setup CMake to use GTK+, tell the compiler where to look for headers
# and to the linker where to look for libraries
INCLUDE_DIRECTORIES(${GTK3_INCLUDE_DIRS} ./include ./websocket/include ${ORACLE_DIR}/sdk/include/)
LINK_DIRECTORIES(${GTK3_LIBRARY_DIRS} ${ORACLE_DIR})

# Add other flags to the compiler
ADD_DEFINITIONS(${GTK3_CFLAGS_OTHER})

# Add an executable compiled from *.c
ADD_EXECUTABLE( lux
    main.c log.c 
...
    dbOracle.c
)

# Link the target to the GTK+ libraries
TARGET_LINK_LIBRARIES(lux ${GTK3_LIBRARIES} -lmysqlclient -lcurl -lpthread ${ORACLE_LIBS})

add_compile_options( -rdynamic )

私は旗を直接制御することはできません...

ベストアンサー1

おすすめ記事