我有一个项目的下一个结构:
cruceGame/
src/
libCruceGame/...
cruceGameCurses/...
multiplayerCurses/...
networking/...
parser/...
docs/...this doesn't matter...
该项目在 src/ 文件夹中有一个 Makefile.am:
AM_CPPFLAGS = -I$(top_srcdir)/src/libCruceGame -I$(top_srcdir)/src/networking -I$(top_srcdir)/src/cruceGameCurses -I$(top_srcdir)/src/multiplayerCurses
LDFLAGS = -no-undefined
CFLAGS += -std=c99
if DEBUG
CFLAGS += -g -Wall -DDEBUG
endif
lib_LTLIBRARIES = libCruceGame.la libNetworking.la libCruceGameCurses.la libMultiplayerCurses.la
bin_PROGRAMS = cruceGame
cruceGame_SOURCES = cruceGame.c
cruceGame_LDADD = libCruceGame.la libNetworking.la libCruceGameCurses.la libMultiplayerCurses.la
cruceGame_LDFLAGS = -lncursesw -lpthread
libCruceGame_la_SOURCES = libCruceGame/deck.c \
libCruceGame/team.c \
libCruceGame/round.c \
libCruceGame/game.c
libNetworking_la_SOURCES = networking/network.c
libCruceGameCurses_la_SOURCES = cruceGameCurses/main.c \
cruceGameCurses/cli.c
libMultiplayerCurses_la_SOURCES = multiplayerCurses/main.c \
multiplayerCurses/cli.c \
multiplayerCurses/ircHandlers.c
您可以在这里找到项目(查看开发分支):https ://github.com/danij/CruceGame 我正在尝试将 cruceGameCurses 和 multiplayerCurses 打包到库中,但它使用 libCruceGame。当我使用这个 makefile 时,我收到关于 libCruceGame 函数的未识别引用的错误。所以,我的问题是:如何将 libCruceGame 添加到 LDFLAGS?PS这个项目不是我写的,我只是贡献,我是图书馆的初学者。