你的第 17 行有一个错误src/Makefile.am
:
swin-adventure_SOURCES = src/main.cc
真的应该读:
swin-adventure_SOURCES = main.cc
因为您已经在 src/ 目录中(除非有 src/src/ 子文件夹)
还有另一个错误,因为您在 _SOURCES 变量中使用了特殊字符:swin-adventure_SOURCES
具有禁止-
字符;尝试将其标准化为swin_adventure_SOURCES
最后,您试图bin_PROGRAMS
多次分配一个值(并且每次都是相同的值),尽量避免这种情况。
就像是:
## Additional flags to pass to aclocal when it is invoked automatically at
## make time. The ${ACLOCAL_FLAGS} variable is picked up from the environment
## to provide a way for the user to supply additional arguments.
ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS}
## Define an executable target "swin-adventure", which will be installed into the
## directory named by the predefined variable $(bindir).
bin_PROGRAMS = swin-adventure
## Define the list of source files for the "swin-adventure" target. The file
## extension .cc is recognized by Automake, and causes it to produce rules
## which invoke the C++ compiler to produce an object file (.o) from each
## source file. The ## header files (.h) do not result in object files by
## themselves, but will be included in distribution archives of the project.
swin_adventure_SOURCES = main.cc