gpt4 book ai didi

编译和链接多个 C 库(卡在未找到架构 x86_64 的符号处)

转载 作者:行者123 更新时间:2023-11-30 16:32:22 25 4
gpt4 key购买 nike

我基本上正在尝试编译以下存储库。 https://github.com/zhaozg/lui

以下是我到达的位置:(如果我遵循的步骤可能完全错误,我很抱歉,因为我总体上是 C 和 GCC 的新手,我只是尽力将这个难题整合在一起)

它有两个依赖项:

  1. https://github.com/andlabs/libui
  2. Lua 来自 https://www.lua.org/download.html

我能够从上述 2 个项目生成两个文件:

  1. liblua.a
  2. libui.a

到目前为止我很高兴,但我不知道如何使用上面的.a文件并编译zhaozg/lui项目。

github上编译说明如下:

gcc -shared -Isrc src/lui.c -I{LUAINCDIR} -I{LIBUVINCDIR} -lui -llua-5.1 -o luv.so

另外,我试图将编译后的文件保留在本地,而不是将它们复制到/usr/local

所以,几个小时后,我达到了以下步骤:

gcc -shared -v -Isrc src/lui.c -I ../lua-src  -I ../libui   /Users/silva/Documents/test00x/lui/liblua.a  /Users/silva/Documents/test00x/lui/libui.a

但现在我遇到了以下错误:

gcc -shared -v -Isrc src/lui.c -I ../lua-src  -I ../libui   /Users/silva/Documents/test00x/lui/liblua.a  /Users/silva/Documents/test00x/lui/libui.a
Apple LLVM version 9.1.0 (clang-902.0.39.1)
Target: x86_64-apple-darwin17.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1 -triple x86_64-apple-macosx10.13.0 -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name lui.c -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -fno-strict-return -masm-verbose -munwind-tables -target-cpu penryn -target-linker-version 351.8 -v -dwarf-column-info -debugger-tuning=lldb -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.1.0 -I src -I ../lua-src -I ../libui -fdebug-compilation-dir /Users/silva/Documents/test00x/lui -ferror-limit 19 -fmessage-length 129 -stack-protector 1 -fblocks -fobjc-runtime=macosx-10.13.0 -fencode-extended-block-signature -fmax-type-align=16 -fdiagnostics-show-option -fcolor-diagnostics -o /var/folders/ps/568797890l55qcbrzmcjd6tr0000gp/T/lui-101fc8.o -x c src/lui.c
clang -cc1 version 9.1.0 (clang-902.0.39.1) default target x86_64-apple-darwin17.5.0
#include "..." search starts here:
#include <...> search starts here:
src
../lua-src
../libui
/usr/local/include
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.1.0/include
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
/usr/include
/System/Library/Frameworks (framework directory)
/Library/Frameworks (framework directory)
End of search list.
src/lui.c:152:13: warning: implicit declaration of function 'luaL_checkint' is invalid in C99 [-Wimplicit-function-declaration]
ret = luaL_checkint(L, -1);
^
In file included from src/lui.c:210:
src/ldraw.c:51:3: warning: implicit declaration of function '_i64toa' is invalid in C99 [-Wimplicit-function-declaration]
lua_pushINT64(L, evt->Held1To64);
^
src/ldraw.c:26:23: note: expanded from macro 'lua_pushINT64'
lua_pushstring(L, _i64toa(n, buf, 10)); \
^
src/ldraw.c:51:3: warning: incompatible integer to pointer conversion passing 'int' to parameter of type 'const char *'
[-Wint-conversion]
lua_pushINT64(L, evt->Held1To64);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/ldraw.c:26:23: note: expanded from macro 'lua_pushINT64'
lua_pushstring(L, _i64toa(n, buf, 10)); \
^~~~~~~~~~~~~~~~~~~
/usr/local/include/lua.h:228:65: note: passing argument to parameter 's' here
LUA_API const char *(lua_pushstring) (lua_State *L, const char *s);
^
In file included from src/lui.c:210:
src/ldraw.c:796:9: warning: implicit declaration of function 'luaL_optint' is invalid in C99 [-Wimplicit-function-declaration]
def = luaL_optint(L, -1, def);
^
In file included from src/lui.c:211:
src/lentry.c:1:8: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
static l_uiNewEntry(lua_State *L)
~~~~~~ ^
src/lentry.c:10:8: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
static l_uiNewPasswordEntry(lua_State *L)
~~~~~~ ^
src/lentry.c:19:8: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
static l_uiNewSearchEntry(lua_State *L)
~~~~~~ ^
src/lentry.c:28:8: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
static l_uiEntryText(lua_State *L)
~~~~~~ ^
src/lentry.c:51:8: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
static l_uiEntryReadOnly(lua_State *L)
~~~~~~ ^
In file included from src/lui.c:220:
src/lmultiline.c:1:8: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
static l_uiNewMultilineEntry(lua_State *L)
~~~~~~ ^
src/lmultiline.c:10:8: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
static l_uiNewNonWrappingMultilineEntry(lua_State *L)
~~~~~~ ^
src/lmultiline.c:19:8: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
static l_uiMultilineEntryText(lua_State *L)
~~~~~~ ^
src/lmultiline.c:30:8: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
static l_uiMultilineEntryAppend(lua_State *L)
~~~~~~ ^
src/lmultiline.c:48:8: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
static l_uiMultilineEntryReadOnly(lua_State *L)
~~~~~~ ^
14 warnings generated.
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -no_deduplicate -dynamic -dylib -arch x86_64 -macosx_version_min 10.13.0 -o a.out /var/folders/ps/568797890l55qcbrzmcjd6tr0000gp/T/lui-101fc8.o /Users/silva/Documents/test00x/lui/liblua.a /Users/silva/Documents/test00x/lui/libui.a -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.1.0/lib/darwin/libclang_rt.osx.a
Undefined symbols for architecture x86_64:
"_CFArrayAppendValue", referenced from:
_addCTFeatureEntry in libui.a(libui-combined.o)
"_CFArrayCreateMutable", referenced from:
_uiprivOpenTypeFeaturesToCTFeatures in libui.a(libui-combined.o)
"_CFArrayGetCount", referenced from:
_matchStyle in libui.a(libui-combined.o)
_uiprivMakeVariationAxisDict in libui.a(libui-combined.o)
"_CFArrayGetValueAtIndex", referenced from:
_matchStyle in libui.a(libui-combined.o)
_uiprivMakeVariationAxisDict in libui.a(libui-combined.o)
"_CFAttributedStringBeginEditing", referenced from:
_uiprivAttributedStringToCFAttributedString in libui.a(libui-combined.o)
"_CFAttributedStringCreate", referenced from:
_uiprivAttributedStringToCFAttributedString in libui.a(libui-combined.o)
"_CFAttributedStringCreateMutableCopy", referenced from:
_uiprivAttributedStringToCFAttributedString in libui.a(libui-combined.o)
"_CFAttributedStringEndEditing", referenced from:
_uiprivAttributedStringToCFAttributedString in libui.a(libui-combined.o)
"_CFAttributedStringGetAttribute", referenced from:
_applyFontAttributes in libui.a(libui-combined.o)
_addFontAttributeToRange in libui.a(libui-combined.o)
"_CFAttributedStringGetLength", referenced from:
_applyFontAttributes in libui.a(libui-combined.o)
-[uiprivTextFrame initWithLayoutParams:] in libui.a(libui-combined.o)
"_CFAttributedStringRemoveAttribute", referenced from:
_applyFontAttributes in libui.a(libui-combined.o)
"_CFAttributedStringSetAttribute", referenced from:
_processAttribute in libui.a(libui-combined.o)
_applyFontAttributes in libui.a(libui-combined.o)
_addFontAttributeToRange in libui.a(libui-combined.o)
_addBackgroundAttribute in libui.a(libui-combined.o)
"_CFDataGetBytePtr", referenced from:
_trySecondaryOS2Values in libui.a(libui-combined.o)
_avarExtract in libui.a(libui-combined.o)
"_CFDataGetLength", referenced from:
_trySecondaryOS2Values in libui.a(libui-combined.o)
"_CFDictionaryAddValue", referenced from:
_uiprivAttributedStringToCFAttributedString in libui.a(libui-combined.o)
_uiprivFontDescriptorToCTFontDescriptor in libui.a(libui-combined.o)


[removed a few messages in between to keep within stackoverflow limit]

"_OBJC_CLASS_$_NSMenu", referenced from:
objc-class-ref in libui.a(libui-combined.o)
"_OBJC_CLASS_$_NSMenuItem", referenced from:
objc-class-ref in libui.a(libui-combined.o)
"_OBJC_CLASS_$_NSMutableArray", referenced from:
objc-class-ref in libui.a(libui-combined.o)
"_OBJC_CLASS_$_NSMutableDictionary", referenced from:
objc-class-ref in libui.a(libui-combined.o)
"_OBJC_CLASS_$_NSMutableString", referenced from:
objc-class-ref in libui.a(libui-combined.o)
"_OBJC_CLASS_$_NSNotificationCenter", referenced from:
objc-class-ref in libui.a(libui-combined.o)
"_OBJC_CLASS_$_NSNumber", referenced from:
objc-class-ref in libui.a(libui-combined.o)
"_OBJC_CLASS_$_NSNumberFormatter", referenced from:
objc-class-ref in libui.a(libui-combined.o)
"_OBJC_CLASS_$_NSObject", referenced from:
objc-class-ref in libui.a(libui-combined.o)
_OBJC_CLASS_$_uiprivCombinedFontAttr in libui.a(libui-combined.o)
_OBJC_CLASS_$_boxChild in libui.a(libui-combined.o)
_OBJC_CLASS_$_buttonDelegateClass in libui.a(libui-combined.o)
_OBJC_CLASS_$_checkboxDelegateClass in libui.a(libui-combined.o)
_OBJC_CLASS_$_comboboxDelegateClass in libui.a(libui-combined.o)
_OBJC_CLASS_$_uiprivDrawTextBackgroundParams in libui.a(libui-combined.o)
...
"_OBJC_CLASS_$_NSOpenPanel", referenced from:
objc-class-ref in libui.a(libui-combined.o)
"_OBJC_CLASS_$_NSPopUpButton", referenced from:
objc-class-ref in libui.a(libui-combined.o)
"_OBJC_CLASS_$_NSProcessInfo", referenced from:
objc-class-ref in libui.a(libui-combined.o)
"_OBJC_CLASS_$_NSProgressIndicator", referenced from:
_OBJC_CLASS_$_intrinsicWidthNSProgressIndicator in libui.a(libui-combined.o)
"_OBJC_CLASS_$_NSSavePanel", referenced from:
objc-class-ref in libui.a(libui-combined.o)
"_OBJC_CLASS_$_NSScrollView", referenced from:
objc-class-ref in libui.a(libui-combined.o)
"_OBJC_CLASS_$_NSSearchField", referenced from:
objc-class-ref in libui.a(libui-combined.o)
_OBJC_CLASS_$_libui_intrinsicWidthNSSearchField in libui.a(libui-combined.o)
"_OBJC_CLASS_$_NSSecureTextField", referenced from:
_OBJC_CLASS_$_libui_intrinsicWidthNSSecureTextField in libui.a(libui-combined.o)
"_OBJC_CLASS_$_NSSlider", referenced from:
_OBJC_CLASS_$_libui_intrinsicWidthNSSlider in libui.a(libui-combined.o)
"_OBJC_CLASS_$_NSStepper", referenced from:
objc-class-ref in libui.a(libui-combined.o)
"_OBJC_CLASS_$_NSString", referenced from:
objc-class-ref in libui.a(libui-combined.o)
"_OBJC_CLASS_$_NSTabView", referenced from:
objc-class-ref in libui.a(libui-combined.o)
"_OBJC_CLASS_$_NSTabViewItem", referenced from:
objc-class-ref in libui.a(libui-combined.o)
"_OBJC_CLASS_$_NSTextField", referenced from:
objc-class-ref in libui.a(libui-combined.o)
_OBJC_CLASS_$_libui_intrinsicWidthNSTextField in libui.a(libui-combined.o)
"_OBJC_CLASS_$_NSTextView", referenced from:
_OBJC_CLASS_$_intrinsicSizeTextView in libui.a(libui-combined.o)
"_OBJC_CLASS_$_NSTimer", referenced from:
objc-class-ref in libui.a(libui-combined.o)
"_OBJC_CLASS_$_NSTrackingArea", referenced from:
objc-class-ref in libui.a(libui-combined.o)
"_OBJC_CLASS_$_NSValue", referenced from:
objc-class-ref in libui.a(libui-combined.o)
"_OBJC_CLASS_$_NSView", referenced from:
objc-class-ref in libui.a(libui-combined.o)
_OBJC_CLASS_$_areaView in libui.a(libui-combined.o)
_OBJC_CLASS_$_boxView in libui.a(libui-combined.o)
_OBJC_CLASS_$_formChild in libui.a(libui-combined.o)
_OBJC_CLASS_$_formView in libui.a(libui-combined.o)
_OBJC_CLASS_$_gridChild in libui.a(libui-combined.o)
_OBJC_CLASS_$_gridView in libui.a(libui-combined.o)
...
"_OBJC_CLASS_$_NSWindow", referenced from:
_OBJC_CLASS_$_libuiNSWindow in libui.a(libui-combined.o)
"_OBJC_METACLASS_$_NSApplication", referenced from:
_OBJC_METACLASS_$_applicationClass in libui.a(libui-combined.o)
"_OBJC_METACLASS_$_NSButton", referenced from:
_OBJC_METACLASS_$_uiprivFontButton in libui.a(libui-combined.o)
"_OBJC_METACLASS_$_NSColorWell", referenced from:
_OBJC_METACLASS_$_colorButton in libui.a(libui-combined.o)
"_OBJC_METACLASS_$_NSComboBox", referenced from:
_OBJC_METACLASS_$_libui_intrinsicWidthNSComboBox in libui.a(libui-combined.o)
"_OBJC_METACLASS_$_NSFontPanel", referenced from:
_OBJC_METACLASS_$_uiprivNonModalFontPanel in libui.a(libui-combined.o)
"_OBJC_METACLASS_$_NSObject", referenced from:
_OBJC_METACLASS_$_areaView in libui.a(libui-combined.o)
_OBJC_METACLASS_$_uiprivCombinedFontAttr in libui.a(libui-combined.o)
_OBJC_METACLASS_$_boxChild in libui.a(libui-combined.o)
_OBJC_METACLASS_$_boxView in libui.a(libui-combined.o)
_OBJC_METACLASS_$_buttonDelegateClass in libui.a(libui-combined.o)
_OBJC_METACLASS_$_checkboxDelegateClass in libui.a(libui-combined.o)
_OBJC_METACLASS_$_colorButton in libui.a(libui-combined.o)
...
"_OBJC_METACLASS_$_NSProgressIndicator", referenced from:
_OBJC_METACLASS_$_intrinsicWidthNSProgressIndicator in libui.a(libui-combined.o)
"_OBJC_METACLASS_$_NSSearchField", referenced from:
_OBJC_METACLASS_$_libui_intrinsicWidthNSSearchField in libui.a(libui-combined.o)
"_OBJC_METACLASS_$_NSSecureTextField", referenced from:
_OBJC_METACLASS_$_libui_intrinsicWidthNSSecureTextField in libui.a(libui-combined.o)
"_OBJC_METACLASS_$_NSSlider", referenced from:
_OBJC_METACLASS_$_libui_intrinsicWidthNSSlider in libui.a(libui-combined.o)
"_OBJC_METACLASS_$_NSTextField", referenced from:
_OBJC_METACLASS_$_libui_intrinsicWidthNSTextField in libui.a(libui-combined.o)
"_OBJC_METACLASS_$_NSTextView", referenced from:
_OBJC_METACLASS_$_intrinsicSizeTextView in libui.a(libui-combined.o)
"_OBJC_METACLASS_$_NSView", referenced from:
_OBJC_METACLASS_$_areaView in libui.a(libui-combined.o)
_OBJC_METACLASS_$_boxView in libui.a(libui-combined.o)
_OBJC_METACLASS_$_formChild in libui.a(libui-combined.o)
_OBJC_METACLASS_$_formView in libui.a(libui-combined.o)
_OBJC_METACLASS_$_gridChild in libui.a(libui-combined.o)
_OBJC_METACLASS_$_gridView in libui.a(libui-combined.o)
_OBJC_METACLASS_$_libui_spinbox in libui.a(libui-combined.o)
...
"_OBJC_METACLASS_$_NSWindow", referenced from:
_OBJC_METACLASS_$_libuiNSWindow in libui.a(libui-combined.o)
"___CFConstantStringClassReference", referenced from:
CFString in libui.a(libui-combined.o)
CFString in libui.a(libui-combined.o)
CFString in libui.a(libui-combined.o)
CFString in libui.a(libui-combined.o)
CFString in libui.a(libui-combined.o)
CFString in libui.a(libui-combined.o)
CFString in libui.a(libui-combined.o)
...
"___objc_personality_v0", referenced from:
_otfArrayForEachAAT in libui.a(libui-combined.o)
_doManualMove in libui.a(libui-combined.o)
_doManualResize in libui.a(libui-combined.o)
Dwarf Exception Unwind Info (__eh_frame) in libui.a(libui-combined.o)
Dwarf Exception Unwind Info (__eh_frame) in libui.a(libui-combined.o)
"__i64toa", referenced from:
_l_uiAreaMouseEvent_2_table in lui-101fc8.o
"__objc_empty_cache", referenced from:
_OBJC_CLASS_$_areaView in libui.a(libui-combined.o)
_OBJC_METACLASS_$_areaView in libui.a(libui-combined.o)
_OBJC_CLASS_$_uiprivCombinedFontAttr in libui.a(libui-combined.o)
_OBJC_METACLASS_$_uiprivCombinedFontAttr in libui.a(libui-combined.o)
_OBJC_METACLASS_$_boxChild in libui.a(libui-combined.o)
_OBJC_CLASS_$_boxChild in libui.a(libui-combined.o)
_OBJC_CLASS_$_boxView in libui.a(libui-combined.o)
...
"__objc_empty_vtable", referenced from:
_OBJC_CLASS_$_areaView in libui.a(libui-combined.o)
_OBJC_METACLASS_$_areaView in libui.a(libui-combined.o)
_OBJC_CLASS_$_uiprivCombinedFontAttr in libui.a(libui-combined.o)
_OBJC_METACLASS_$_uiprivCombinedFontAttr in libui.a(libui-combined.o)
_OBJC_METACLASS_$_boxChild in libui.a(libui-combined.o)
_OBJC_CLASS_$_boxChild in libui.a(libui-combined.o)
_OBJC_CLASS_$_boxView in libui.a(libui-combined.o)
...
"_kCFAllocatorNull", referenced from:
_uiprivNewGraphemes in libui.a(libui-combined.o)
"_kCFCopyStringDictionaryKeyCallBacks", referenced from:
_uiprivAttributedStringToCFAttributedString in libui.a(libui-combined.o)
_uiprivFontDescriptorToCTFontDescriptor in libui.a(libui-combined.o)
_uiprivCTFontDescriptorAppendFeatures in libui.a(libui-combined.o)
_addCTFeatureEntry in libui.a(libui-combined.o)
"_kCFTypeArrayCallBacks", referenced from:
_uiprivOpenTypeFeaturesToCTFeatures in libui.a(libui-combined.o)
"_kCFTypeDictionaryValueCallBacks", referenced from:
_uiprivAttributedStringToCFAttributedString in libui.a(libui-combined.o)
_uiprivFontDescriptorToCTFontDescriptor in libui.a(libui-combined.o)
_uiprivCTFontDescriptorAppendFeatures in libui.a(libui-combined.o)
_addCTFeatureEntry in libui.a(libui-combined.o)
"_kCGColorSpaceSRGB", referenced from:
_mkcolor in libui.a(libui-combined.o)
_fillGradient in libui.a(libui-combined.o)
"_kCTFontAttributeName", referenced from:
_applyFontAttributes in libui.a(libui-combined.o)
"_kCTFontFamilyNameAttribute", referenced from:
_uiprivFontDescriptorToCTFontDescriptor in libui.a(libui-combined.o)
_uiprivFontDescriptorFromCTFontDescriptor in libui.a(libui-combined.o)
"_kCTFontFamilyNameKey", referenced from:
-[uiprivFontStyleData familyName] in libui.a(libui-combined.o)
"_kCTFontFeatureSelectorIdentifierKey", referenced from:
___otfArrayForEachAAT_block_invoke in libui.a(libui-combined.o)
"_kCTFontFeatureSettingsAttribute", referenced from:
_uiprivCTFontDescriptorAppendFeatures in libui.a(libui-combined.o)
"_kCTFontFeatureTypeIdentifierKey", referenced from:
___otfArrayForEachAAT_block_invoke in libui.a(libui-combined.o)
"_kCTFontFormatAttribute", referenced from:
-[uiprivFontStyleData prepare] in libui.a(libui-combined.o)
"_kCTFontFullNameKey", referenced from:
-[uiprivFontStyleData fullName] in libui.a(libui-combined.o)
"_kCTFontRegistrationScopeAttribute", referenced from:
-[uiprivFontStyleData prepare] in libui.a(libui-combined.o)
"_kCTFontSizeAttribute", referenced from:
_uiprivFontDescriptorToCTFontDescriptor in libui.a(libui-combined.o)
"_kCTFontStyleNameAttribute", referenced from:
-[uiprivFontStyleData styleName] in libui.a(libui-combined.o)
"_kCTFontSubFamilyNameKey", referenced from:
-[uiprivFontStyleData subFamilyName] in libui.a(libui-combined.o)
"_kCTFontSymbolicTrait", referenced from:
-[uiprivFontStyleData prepare] in libui.a(libui-combined.o)
"_kCTFontTraitsAttribute", referenced from:
-[uiprivFontStyleData prepare] in libui.a(libui-combined.o)
"_kCTFontVariationAttribute", referenced from:
-[uiprivFontStyleData variation] in libui.a(libui-combined.o)
"_kCTFontVariationAxisDefaultValueKey", referenced from:
-[fvarAxis initWithIndex:dict:avarTable:] in libui.a(libui-combined.o)
"_kCTFontVariationAxisIdentifierKey", referenced from:
_uiprivMakeVariationAxisDict in libui.a(libui-combined.o)
"_kCTFontVariationAxisMaximumValueKey", referenced from:
-[fvarAxis initWithIndex:dict:avarTable:] in libui.a(libui-combined.o)
"_kCTFontVariationAxisMinimumValueKey", referenced from:
-[fvarAxis initWithIndex:dict:avarTable:] in libui.a(libui-combined.o)
"_kCTFontWeightTrait", referenced from:
-[uiprivFontStyleData prepare] in libui.a(libui-combined.o)
"_kCTFontWidthTrait", referenced from:
-[uiprivFontStyleData prepare] in libui.a(libui-combined.o)
"_kCTForegroundColorAttributeName", referenced from:
_processAttribute in libui.a(libui-combined.o)
"_kCTParagraphStyleAttributeName", referenced from:
_uiprivAttributedStringToCFAttributedString in libui.a(libui-combined.o)
"_kCTUnderlineColorAttributeName", referenced from:
_processAttribute in libui.a(libui-combined.o)
"_kCTUnderlineStyleAttributeName", referenced from:
_processAttribute in libui.a(libui-combined.o)
"_luaL_checkint", referenced from:
_l_uiAreaSetSize in lui-101fc8.o
_l_uiAreaBeginUserWindowResize in lui-101fc8.o
_l_uiAttributedStringInsertAtUnattributed in lui-101fc8.o
_l_uiAttributedStringDelete in lui-101fc8.o
_l_uiAttributedStringSetAttribute in lui-101fc8.o
_l_uiAttributedStringByteIndexToGrapheme in lui-101fc8.o
_l_uiAttributedStringGraphemeToByteIndex in lui-101fc8.o
...
(maybe you meant: _luaL_checkinteger)
"_objc_autoreleasePoolPop", referenced from:
-[uiprivCombinedFontAttr hash] in libui.a(libui-combined.o)
_uiInit in libui.a(libui-combined.o)
_uiUninit in libui.a(libui-combined.o)
_mainStep in libui.a(libui-combined.o)
_newItem in libui.a(libui-combined.o)
_uiNewMenu in libui.a(libui-combined.o)
"_objc_autoreleasePoolPush", referenced from:
-[uiprivCombinedFontAttr hash] in libui.a(libui-combined.o)
_uiInit in libui.a(libui-combined.o)
_uiUninit in libui.a(libui-combined.o)
_mainStep in libui.a(libui-combined.o)
_newItem in libui.a(libui-combined.o)
_uiNewMenu in libui.a(libui-combined.o)
"_objc_enumerationMutation", referenced from:
_uninitAlloc in libui.a(libui-combined.o)
-[boxView onDestroy] in libui.a(libui-combined.o)
-[boxView syncEnableStates:] in libui.a(libui-combined.o)
-[boxView establishOurConstraints] in libui.a(libui-combined.o)
-[boxView setPadded:] in libui.a(libui-combined.o)
-[boxView nStretchy] in libui.a(libui-combined.o)
-[uiprivTextFrame draw:textLayout:at:y:] in libui.a(libui-combined.o)
...
"_objc_getProperty", referenced from:
-[formChild label] in libui.a(libui-combined.o)
-[formChild baseline] in libui.a(libui-combined.o)
-[formChild leading] in libui.a(libui-combined.o)
-[formChild top] in libui.a(libui-combined.o)
-[formChild trailing] in libui.a(libui-combined.o)
-[formChild bottom] in libui.a(libui-combined.o)
-[gridChild leadingc] in libui.a(libui-combined.o)
...
"_objc_msgSend", referenced from:
_initAlloc in libui.a(libui-combined.o)
_uninitAlloc in libui.a(libui-combined.o)
_uiprivAlloc in libui.a(libui-combined.o)
_uiprivRealloc in libui.a(libui-combined.o)
_uiprivFree in libui.a(libui-combined.o)
-[areaView initWithFrame:area:] in libui.a(libui-combined.o)
-[areaView drawRect:] in libui.a(libui-combined.o)
...
"_objc_msgSendSuper2", referenced from:
-[areaView initWithFrame:area:] in libui.a(libui-combined.o)
-[areaView setFrameSize:] in libui.a(libui-combined.o)
-[areaView intrinsicContentSize] in libui.a(libui-combined.o)
-[uiprivCombinedFontAttr init] in libui.a(libui-combined.o)
-[uiprivCombinedFontAttr dealloc] in libui.a(libui-combined.o)
-[boxView initWithVertical:b:] in libui.a(libui-combined.o)
-[buttonDelegateClass init] in libui.a(libui-combined.o)
...
"_objc_msgSend_stret", referenced from:
-[areaView drawRect:] in libui.a(libui-combined.o)
-[areaView setupNewTrackingArea] in libui.a(libui-combined.o)
-[areaView doMouseEvent:] in libui.a(libui-combined.o)
-[intrinsicSizeTextView intrinsicContentSize] in libui.a(libui-combined.o)
_uiWindowContentSize in libui.a(libui-combined.o)
_makeIndependent in libui.a(libui-combined.o)
_doManualMove in libui.a(libui-combined.o)
...
"_objc_setProperty_atomic", referenced from:
-[formChild setLabel:] in libui.a(libui-combined.o)
-[formChild setBaseline:] in libui.a(libui-combined.o)
-[formChild setLeading:] in libui.a(libui-combined.o)
-[formChild setTop:] in libui.a(libui-combined.o)
-[formChild setTrailing:] in libui.a(libui-combined.o)
-[formChild setBottom:] in libui.a(libui-combined.o)
-[gridChild setLeadingc:] in libui.a(libui-combined.o)
...
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

最佳答案

对于那些在 Mac 操作系统中遇到此问题的人,

gcc -shared -v -framework Foundation -framework AppKit -Isrc src/lui.c ...等

使用静态库时,您还必须显式链接系统库,

静态库只是一堆 .o 文件;它们不包含任何有关外部依赖项的信息。

关于编译和链接多个 C 库(卡在未找到架构 x86_64 的符号处),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50190861/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com