FFMPEG Link error - linker
I'm trying to compile a modified version of this transcoding example from the FFMPEG site, I've used all the required includes and joined the libs using this :
INCLUDEPATH += $$(FFMPEG_DEV_PATH)\include
LIBS += -L$$(FFMPEG_DEV_PATH)\lib -lavformat -lavcodec -lavutil -lswscale -liconv -lz -lavfilter
but I get this linking error that I can't understand :
"avio_close(AVIOContext*)", referenced from:
PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
"av_strerror(int, char*, unsigned long)", referenced from:
av_make_error_string(char*, unsigned long, int) in PhVideoEncoder.o
"av_rescale_q(long long, AVRational, AVRational)", referenced from:
PhVideoEncoder::encode_write_frame(AVFrame*, unsigned int, int*) in PhVideoEncoder.o
"av_frame_free(AVFrame**)", referenced from:
PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
PhVideoEncoder::filter_encode_write_frame(AVFrame*, unsigned int) in PhVideoEncoder.o
PhVideoEncoder::encode_write_frame(AVFrame*, unsigned int, int*) in PhVideoEncoder.o
"av_read_frame(AVFormatContext*, AVPacket*)", referenced from:
PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
"avcodec_close(AVCodecContext*)", referenced from:
PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
"avcodec_open2(AVCodecContext*, AVCodec const*, AVDictionary**)", referenced from:
PhVideoEncoder::open_input_file(char const*) in PhVideoEncoder.o
PhVideoEncoder::open_output_file(char const*) in PhVideoEncoder.o
"av_dump_format(AVFormatContext*, int, char const*, int)", referenced from:
PhVideoEncoder::open_input_file(char const*) in PhVideoEncoder.o
PhVideoEncoder::open_output_file(char const*) in PhVideoEncoder.o
"av_frame_alloc()", referenced from:
PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
PhVideoEncoder::filter_encode_write_frame(AVFrame*, unsigned int) in PhVideoEncoder.o
"av_free_packet(AVPacket*)", referenced from:
PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
"av_init_packet(AVPacket*)", referenced from:
PhVideoEncoder::encode_write_frame(AVFrame*, unsigned int, int*) in PhVideoEncoder.o
"av_opt_set_bin(void*, char const*, unsigned char const*, int, int)", referenced from:
PhVideoEncoder::init_filter(FilteringContext*, AVCodecContext*, AVCodecContext*, char const*) in PhVideoEncoder.o
"av_register_all()", referenced from:
PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
"av_rescale_q_rnd(long long, AVRational, AVRational, AVRounding)", referenced from:
PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
PhVideoEncoder::encode_write_frame(AVFrame*, unsigned int, int*) in PhVideoEncoder.o
"av_write_trailer(AVFormatContext*)", referenced from:
PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
"avfilter_graph_free(AVFilterGraph**)", referenced from:
PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
"avfilter_inout_free(AVFilterInOut**)", referenced from:
PhVideoEncoder::init_filter(FilteringContext*, AVCodecContext*, AVCodecContext*, char const*) in PhVideoEncoder.o
"avformat_new_stream(AVFormatContext*, AVCodec const*)", referenced from:
PhVideoEncoder::open_output_file(char const*) in PhVideoEncoder.o
"avformat_open_input(AVFormatContext**, char const*, AVInputFormat*, AVDictionary**)", referenced from:
PhVideoEncoder::open_input_file(char const*) in PhVideoEncoder.o
"avcodec_copy_context(AVCodecContext*, AVCodecContext const*)", referenced from:
PhVideoEncoder::open_output_file(char const*) in PhVideoEncoder.o
"avcodec_find_decoder(AVCodecID)", referenced from:
PhVideoEncoder::open_input_file(char const*) in PhVideoEncoder.o
"avcodec_find_encoder(AVCodecID)", referenced from:
PhVideoEncoder::open_output_file(char const*) in PhVideoEncoder.o
"avfilter_get_by_name(char const*)", referenced from:
PhVideoEncoder::init_filter(FilteringContext*, AVCodecContext*, AVCodecContext*, char const*) in PhVideoEncoder.o
"avfilter_graph_alloc()", referenced from:
PhVideoEncoder::init_filter(FilteringContext*, AVCodecContext*, AVCodecContext*, char const*) in PhVideoEncoder.o
"avfilter_inout_alloc()", referenced from:
PhVideoEncoder::init_filter(FilteringContext*, AVCodecContext*, AVCodecContext*, char const*) in PhVideoEncoder.o
"avformat_close_input(AVFormatContext**)", referenced from:
PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
"avcodec_decode_audio4(AVCodecContext*, AVFrame*, int*, AVPacket const*)", referenced from:
PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
"avcodec_decode_video2(AVCodecContext*, AVFrame*, int*, AVPacket const*)", referenced from:
PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
"avcodec_encode_audio2(AVCodecContext*, AVPacket*, AVFrame const*, int*)", referenced from:
PhVideoEncoder::encode_write_frame(AVFrame*, unsigned int, int*) in PhVideoEncoder.o
"avcodec_encode_video2(AVCodecContext*, AVPacket*, AVFrame const*, int*)", referenced from:
PhVideoEncoder::encode_write_frame(AVFrame*, unsigned int, int*) in PhVideoEncoder.o
"avfilter_graph_config(AVFilterGraph*, void*)", referenced from:
PhVideoEncoder::init_filter(FilteringContext*, AVCodecContext*, AVCodecContext*, char const*) in PhVideoEncoder.o
"avfilter_register_all()", referenced from:
PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
"avformat_free_context(AVFormatContext*)", referenced from:
PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
"avformat_write_header(AVFormatContext*, AVDictionary**)", referenced from:
PhVideoEncoder::open_output_file(char const*) in PhVideoEncoder.o
"av_get_sample_fmt_name(AVSampleFormat)", referenced from:
PhVideoEncoder::init_filter(FilteringContext*, AVCodecContext*, AVCodecContext*, char const*) in PhVideoEncoder.o
"av_buffersink_get_frame(AVFilterContext*, AVFrame*)", referenced from:
PhVideoEncoder::filter_encode_write_frame(AVFrame*, unsigned int) in PhVideoEncoder.o
"avfilter_graph_parse_ptr(AVFilterGraph*, char const*, AVFilterInOut**, AVFilterInOut**, void*)", referenced from:
PhVideoEncoder::init_filter(FilteringContext*, AVCodecContext*, AVCodecContext*, char const*) in PhVideoEncoder.o
"avformat_find_stream_info(AVFormatContext*, AVDictionary**)", referenced from:
PhVideoEncoder::open_input_file(char const*) in PhVideoEncoder.o
"av_interleaved_write_frame(AVFormatContext*, AVPacket*)", referenced from:
PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
PhVideoEncoder::encode_write_frame(AVFrame*, unsigned int, int*) in PhVideoEncoder.o
"av_buffersrc_add_frame_flags(AVFilterContext*, AVFrame*, int)", referenced from:
PhVideoEncoder::filter_encode_write_frame(AVFrame*, unsigned int) in PhVideoEncoder.o
"avfilter_graph_create_filter(AVFilterContext**, AVFilter const*, char const*, char const*, void*, AVFilterGraph*)", referenced from:
PhVideoEncoder::init_filter(FilteringContext*, AVCodecContext*, AVCodecContext*, char const*) in PhVideoEncoder.o
"av_get_default_channel_layout(int)", referenced from:
PhVideoEncoder::init_filter(FilteringContext*, AVCodecContext*, AVCodecContext*, char const*) in PhVideoEncoder.o
"avformat_alloc_output_context2(AVFormatContext**, AVOutputFormat*, char const*, char const*)", referenced from:
PhVideoEncoder::open_output_file(char const*) in PhVideoEncoder.o
"av_get_channel_layout_nb_channels(unsigned long long)", referenced from:
PhVideoEncoder::open_output_file(char const*) in PhVideoEncoder.o
"av_frame_get_best_effort_timestamp(AVFrame const*)", referenced from:
PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
"av_log(void*, int, char const*, ...)", referenced from:
PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
PhVideoEncoder::filter_encode_write_frame(AVFrame*, unsigned int) in PhVideoEncoder.o
PhVideoEncoder::flush_encoder(unsigned int) in PhVideoEncoder.o
PhVideoEncoder::open_input_file(char const*) in PhVideoEncoder.o
PhVideoEncoder::open_output_file(char const*) in PhVideoEncoder.o
PhVideoEncoder::init_filter(FilteringContext*, AVCodecContext*, AVCodecContext*, char const*) in PhVideoEncoder.o
PhVideoEncoder::encode_write_frame(AVFrame*, unsigned int, int*) in PhVideoEncoder.o
...
"av_free(void*)", referenced from:
PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
"av_malloc(unsigned long)", referenced from:
av_malloc_array(unsigned long, unsigned long) in PhVideoEncoder.o
"av_strdup(char const*)", referenced from:
PhVideoEncoder::init_filter(FilteringContext*, AVCodecContext*, AVCodecContext*, char const*) in PhVideoEncoder.o
"avio_open(AVIOContext**, char const*, int)", referenced from:
PhVideoEncoder::open_output_file(char const*) in PhVideoEncoder.o
I tried looking for missing libraries but with no luck... What am I missing ?
EDIT
Thanks to the first answer, I added the extern C stuff but I still face a few errors :
Undefined symbols for architecture x86_64:
"_av_buffersink_get_frame", referenced from:
PhVideoEncoder::filter_encode_write_frame(AVFrame*, unsigned int) in PhVideoEncoder.o
"_av_buffersrc_add_frame_flags", referenced from:
PhVideoEncoder::filter_encode_write_frame(AVFrame*, unsigned int) in PhVideoEncoder.o
"_avfilter_get_by_name", referenced from:
PhVideoEncoder::init_filter(FilteringContext*, AVCodecContext*, AVCodecContext*, char const*) in PhVideoEncoder.o
"_avfilter_graph_alloc", referenced from:
PhVideoEncoder::init_filter(FilteringContext*, AVCodecContext*, AVCodecContext*, char const*) in PhVideoEncoder.o
"_avfilter_graph_config", referenced from:
PhVideoEncoder::init_filter(FilteringContext*, AVCodecContext*, AVCodecContext*, char const*) in PhVideoEncoder.o
"_avfilter_graph_create_filter", referenced from:
PhVideoEncoder::init_filter(FilteringContext*, AVCodecContext*, AVCodecContext*, char const*) in PhVideoEncoder.o
"_avfilter_graph_free", referenced from:
PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
"_avfilter_graph_parse_ptr", referenced from:
PhVideoEncoder::init_filter(FilteringContext*, AVCodecContext*, AVCodecContext*, char const*) in PhVideoEncoder.o
"_avfilter_inout_alloc", referenced from:
PhVideoEncoder::init_filter(FilteringContext*, AVCodecContext*, AVCodecContext*, char const*) in PhVideoEncoder.o
"_avfilter_inout_free", referenced from:
PhVideoEncoder::init_filter(FilteringContext*, AVCodecContext*, AVCodecContext*, char const*) in PhVideoEncoder.o
"_avfilter_register_all", referenced from:
PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
ld: symbol(s) not found for architecture x86_64
See this post - most likely when mixing C++ code with the C interface of FFMPEG you forgot the extern "C" keyword so linker is using C++ function name mangling and thus cannot find the references. You should wrap the FFMPEG includes with extern "C" like this:
extern "C" {
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
}
The link to FFmpeg site with transcoding example is broken now, but you can find it here: http://ffmpeg.org/doxygen/trunk/doc_2examples_2transcoding_8c-example.html
I think the problem is that the example uses a later version of FFmpeg. I'm using an Android port of FFmpeg 1.0 from https://github.com/appunite/AndroidFFmpeg and I'm also facing the same issues (ie undeclared avfilter_graph_parse_ptr). My FFmpeg source code does not have it but declares avfilter_graph_parse instead.
My source code desn't have transcoding example, I think doc/examples/decoding_encoding.c should be used instead.
I changed code to use old functions, for example av_frame_free -> avcodec_free_frame, av_buffersrc_write_frame_flags -> av_buffersrc_write_frame and so on, now it at least compiles...
Related
Can I use init_ui() in architecture x86_64?
I am learning for fun with building my own matrix and im on my Mac is the only computer I have and I dont want to go through Virtual environment just to play around with matrix on Mac. Is there a way or no is what I will like to find out. int main(int argc, char **argv) { if (!init_ui()) { return EXIT_FAILURE; } matrix_init(); for (int i = 0; i < ITERATIONS; i++) { matrix_update(); show_matrix(); usleep(REFRESH_DELAY); } return EXIT_SUCCESS; } Here is the init_ui() function bool init_ui() { //set the matrix all to black //move this later to matrix.c for (int x = 0; x < MAXX; x++) { for (int y = 0; y < MAXY; y++) { matrix[x][y].char_value = 0; matrix[x][y].char_value = 0; } } //init curses uiwindow = initscr(); if (uiwindow == NULL) return false; start_color(); if (!has_colors() || !can_change_color() || COLOR_PAIRS < 6) { printf("Warning. Your terminal can't handle this program.\n"); return false; } set_colors(); return true; }//end bool Error : clang -Wall -g main.o matrix.o ui.o -o mainapp Undefined symbols for architecture x86_64: "_COLOR_PAIRS", referenced from: _init_ui in ui.o "_can_change_color", referenced from: _init_ui in ui.o "_delwin", referenced from: _cleanup_ui in ui.o "_endwin", referenced from: _cleanup_ui in ui.o "_has_colors", referenced from: _init_ui in ui.o "_init_color", referenced from: _set_colors in ui.o "_init_pair", referenced from: _set_colors in ui.o "_initscr", referenced from: _init_ui in ui.o "_start_color", referenced from: _init_ui in ui.o "_stdscr", referenced from: _cleanup_ui in ui.o _show_matrix in ui.o "_waddch", referenced from: _show_matrix in ui.o "_wcolor_set", referenced from: _show_matrix in ui.o "_wmove", referenced from: _show_matrix in ui.o "_wrefresh", referenced from: _cleanup_ui in ui.o _show_matrix in ui.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: *** [mainapp] Error 1 The init_ui() is not the only the problem here. I mean I fell in love with c so I can't stop coding in c even though I mastered python but c just took my attention. So idk I would love to know more than just write boring code
So to fix this error. The only thing needed was -lncurses which is explained # Error while compiling ncurses app on Mac OS X In my scenario I needed to compile as according shown below mainapp: main.o matrix.o ui.o $(CC) $(CFLAGS) main.o matrix.o ui.o -o mainapp -lncurses Thank you #dratenik && #kaylum
Compiling and linking multiple C libraries (stuck at symbol(s) not found for architecture x86_64)
I am basically trying to compile the following repo. https://github.com/zhaozg/lui The following is where I have reached: (I am sorry if the steps I am following may be completely wrong as I am new to C and GCC in general, I am just trying my best to bring this puzzle together) It has two dependencies: https://github.com/andlabs/libui Lua from https://www.lua.org/download.html I was able to generate two files from the above 2 projects: liblua.a libui.a I was happy so far, but I am not able to figure out how to use the above .a files and compile the zhaozg/lui project. The instructions on compiling in github are as follows: gcc -shared -Isrc src/lui.c -I{LUAINCDIR} -I{LIBUVINCDIR} -lui -llua-5.1 -o luv.so Also, I am trying to keep the compiled files locally and not have them copied all over /usr/local So, After a few hours, I reached the following step: 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 But now I am stuck at the following error: 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)
for those facing this problem in Mac OS, gcc -shared -v -framework Foundation -framework AppKit -Isrc src/lui.c ...etc When using the static library, you have to explicitly link against the system libraries as well, A static library is just a bunch of .o files; they do not contain any information about external dependencies.
Error compiling allegro5 program using gcc on osx
I am trying to compile a simple allegro5 program on Mac OSX 10.12 but am getting an undefined symbols error. Here is the command I ran in the terminal gcc main.c -o hello -I/usr/local/include/ -L/usr/local/lib -lallegro_main And here is my code. #include <stdio.h> #include <allegro5/allegro.h> int main(int argc, char **argv) { ALLEGRO_DISPLAY *display = NULL; if(!al_init()) { fprintf(stderr, "failed to initialize allegro!\n"); return -1; } display = al_create_display(640, 480); if(!display) { fprintf(stderr, "failed to create display!\n"); return -1; } al_clear_to_color(al_map_rgb(0,0,0)); al_flip_display(); al_rest(10.0); al_destroy_display(display); return 0; } Here is the error I get Undefined symbols for architecture x86_64: "_al_clear_to_color", referenced from: __al_mangled_main in main-b86b99.o "_al_create_display", referenced from: __al_mangled_main in main-b86b99.o "_al_destroy_display", referenced from: __al_mangled_main in main-b86b99.o "_al_flip_display", referenced from: __al_mangled_main in main-b86b99.o "_al_install_system", referenced from: __al_mangled_main in main-b86b99.o "_al_map_rgb", referenced from: __al_mangled_main in main-b86b99.o "_al_rest", referenced from: __al_mangled_main in main-b86b99.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) Is it possible that I did not install allegro correctly? I installed it using homebrew according to the allegro wiki instructions. https://wiki.allegro.cc/index.php?title=Getting_Started#Mac_OS
Those are linker errors. You need to link to lallegro.
Compile Cilk plus in GCC5.2.0
Does anybody know how to compile the following code with Cilk plus in gcc5.2.0 correctly? With gcc -fcilkplus * or g++, I always get errors. #include <cilk/cilk.h> #include <assert.h> int fib(int n) { if (n < 2) return n; int a = cilk_spawn fib(n-1); int b = fib(n-2); cilk_sync; return a + b; } int main() { int result = fib(30); assert(result == 832040); return 0; } result: Undefined symbols for architecture x86_64: "___cilkrts_enter_frame_1", referenced from: fib(int) in ccY1qrGL.o "___cilkrts_enter_frame_fast_1", referenced from: __cilk_spn_0 in ccY1qrGL.o "___cilkrts_leave_frame", referenced from: fib(int) in ccY1qrGL.o __cilk_spn_0 in ccY1qrGL.o "___cilkrts_rethrow", referenced from: fib(int) in ccY1qrGL.o "___cilkrts_save_fp_ctrl_state", referenced from: fib(int) in ccY1qrGL.o "___cilkrts_sync", referenced from: fib(int) in ccY1qrGL.o ld: symbol(s) not found for architecture x86_64 collect2: error: ld returned 1 exit status There are very few topics about this online. thanks
GCC is configured to add -lcilkrts by default to its linker command when -fcilkplus is given by users, but this default behavior can be overridden if there is any platform-specific configuration. I think that is happening on OS X, but it needs to be fixed in my opinion. Anyway, it seems that there is no short-term solution other than adding -lcilkrts as suggested above.
Compile embedded lua in C
Hey everyone I found this code that embeds Lua in C and I cannot figure out how to get GCC to compile it. I have Lua installed, but how do I link the Lua libraries? Here is the code I found: #include <stdio.h> #include "lua.h" #include "lualib.h" #include "lauxlib.h" /* lua interpreter */ lua_State* l; int main () { int dofile; /* initialize lua */ l = lua_open(); /* load lua libraries */ luaL_openlibs(l); /* run the hello.lua script */ dofile = luaL_dofile(l, "hello.lua"); if (dofile == 0) { /* call foo */ lua_getglobal(l,"foo"); lua_call(l,0,0); } else { printf("Error, unable to run hello.lua\n"); } /* cleanup Lua */ lua_close(l); return 0; } How do I get this to compile? I am trying this command to compile gcc -o embed_hello -L/users/etrosclair/Downloads/lua-5.1.4 -I/users/etrosclair/Downloads/lua-5.1.4 luaTest.c Here is the error: Undefined symbols for architecture x86_64: "_luaL_newstate", referenced from: _main in ccF0995Q.o "_luaL_openlibs", referenced from: _main in ccF0995Q.o "_luaL_loadfile", referenced from: _main in ccF0995Q.o "_lua_pcall", referenced from: _main in ccF0995Q.o "_lua_getfield", referenced from: _main in ccF0995Q.o "_lua_call", referenced from: _main in ccF0995Q.o "_lua_close", referenced from: _main in ccF0995Q.o ld: symbol(s) not found for architecture x86_64 collect2: ld returned 1 exit status All the lua libraries and headers are in the lua-5.1.4 folder the .o files are also in there too. Thanks Thanks
Depends if you want it statically or dynamically compiled. For static, add -llua (or lua5.1 or lua51; depending on your setup)