我从bait下载了Scintilla's documentation page,但是每当尝试使用提供的makefile对其进行编译时,都会失败并显示以下错误:
$ make
gcc `pkg-config --cflags gtk+-2.0` -I../scintilla/include -DGTK -DSCI_LEXER -W -Wall -c bait.c -o bait.o
gcc -DGTK bait.o ../scintilla/gtk/LexA68k.o ../scintilla/gtk/LexAPDL.o ../scintilla/gtk/LexASY.o ../scintilla/gtk/LexAU3.o ../scintilla/gtk/LexAVE.o ../scintilla/gtk/LexAVS.o ../scintilla/gtk/LexAbaqus.o ../scintilla/gtk/LexAda.o ../scintilla/gtk/LexAsm.o ../scintilla/gtk/LexAsn1.o ../scintilla/gtk/LexBaan.o ../scintilla/gtk/LexBash.o ../scintilla/gtk/LexBasic.o ../scintilla/gtk/LexBullant.o ../scintilla/gtk/LexCLW.o ../scintilla/gtk/LexCOBOL.o ../scintilla/gtk/LexCPP.o ../scintilla/gtk/LexCSS.o ../scintilla/gtk/LexCaml.o ../scintilla/gtk/LexCmake.o ../scintilla/gtk/LexCoffeeScript.o ../scintilla/gtk/LexConf.o ../scintilla/gtk/LexCrontab.o ../scintilla/gtk/LexCsound.o ../scintilla/gtk/LexD.o ../scintilla/gtk/LexDMAP.o ../scintilla/gtk/LexDMIS.o ../scintilla/gtk/LexECL.o ../scintilla/gtk/LexEScript.o ../scintilla/gtk/LexEiffel.o ../scintilla/gtk/LexErlang.o ../scintilla/gtk/LexFlagship.o ../scintilla/gtk/LexForth.o ../scintilla/gtk/LexFortran.o ../scintilla/gtk/LexGAP.o ../scintilla/gtk/LexGui4Cli.o ../scintilla/gtk/LexHTML.o ../scintilla/gtk/LexHaskell.o ../scintilla/gtk/LexInno.o ../scintilla/gtk/LexKVIrc.o ../scintilla/gtk/LexKix.o ../scintilla/gtk/LexLaTeX.o ../scintilla/gtk/LexLisp.o ../scintilla/gtk/LexLout.o ../scintilla/gtk/LexLua.o ../scintilla/gtk/LexMMIXAL.o ../scintilla/gtk/LexMPT.o ../scintilla/gtk/LexMSSQL.o ../scintilla/gtk/LexMagik.o ../scintilla/gtk/LexMarkdown.o ../scintilla/gtk/LexMatlab.o ../scintilla/gtk/LexMetapost.o ../scintilla/gtk/LexModula.o ../scintilla/gtk/LexMySQL.o ../scintilla/gtk/LexNimrod.o ../scintilla/gtk/LexNsis.o ../scintilla/gtk/LexOScript.o ../scintilla/gtk/LexOpal.o ../scintilla/gtk/LexOthers.o ../scintilla/gtk/LexPB.o ../scintilla/gtk/LexPLM.o ../scintilla/gtk/LexPO.o ../scintilla/gtk/LexPOV.o ../scintilla/gtk/LexPS.o ../scintilla/gtk/LexPascal.o ../scintilla/gtk/LexPerl.o ../scintilla/gtk/LexPowerPro.o ../scintilla/gtk/LexPowerShell.o ../scintilla/gtk/LexProgress.o ../scintilla/gtk/LexPython.o ../scintilla/gtk/LexR.o ../scintilla/gtk/LexRebol.o ../scintilla/gtk/LexRuby.o ../scintilla/gtk/LexRust.o ../scintilla/gtk/LexSML.o ../scintilla/gtk/LexSQL.o ../scintilla/gtk/LexSTTXT.o ../scintilla/gtk/LexScriptol.o ../scintilla/gtk/LexSmalltalk.o ../scintilla/gtk/LexSorcus.o ../scintilla/gtk/LexSpecman.o ../scintilla/gtk/LexSpice.o ../scintilla/gtk/LexTACL.o ../scintilla/gtk/LexTADS3.o ../scintilla/gtk/LexTAL.o ../scintilla/gtk/LexTCL.o ../scintilla/gtk/LexTCMD.o ../scintilla/gtk/LexTeX.o ../scintilla/gtk/LexTxt2tags.o ../scintilla/gtk/LexVB.o ../scintilla/gtk/LexVHDL.o ../scintilla/gtk/LexVerilog.o ../scintilla/gtk/LexVisualProlog.o ../scintilla/gtk/LexYAML.o ../scintilla/gtk/LexerBase.o ../scintilla/gtk/LexerModule.o ../scintilla/gtk/LexerSimple.o ../scintilla/bin/scintilla.a -o bait -lstdc++ `pkg-config --libs gtk+-2.0 gthread-2.0`
Undefined symbols for architecture x86_64:
"_g_module_close", referenced from:
DynamicLibraryImpl::~DynamicLibraryImpl() in scintilla.a(PlatGTK.o)
"_g_module_open", referenced from:
DynamicLibrary::Load(char const*) in scintilla.a(PlatGTK.o)
"_g_module_symbol", referenced from:
DynamicLibraryImpl::FindFunction(char const*) in scintilla.a(PlatGTK.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [bait] Error 1
有一个../scintilla/include目录,其中包含Scintilla头文件。
最佳答案
尝试将-lgmodule添加到cflags