I'm trying to compile someone else's code and there isn't a simple header file.
I need to link the default lapack and blas libraries on osx, and after some searching I figured they're in the Accelerate framework, and in my make.inc I used something like
LAPACK_LIBS = -framework Accelerate
Now I read in the man page that I should include
#include <Accelerate/Accelerate.h>
Is there a way I can do it in make.inc?
Sorry if this is dumb I'm not really a programmer and I've tried my best to search...
The errors I'm getting are:
2 warnings generated.
Undefined symbols for architecture x86_64:
"_dgemm_", referenced from:
_umfdi_blas3_update in libumfpack.a(umf_di_blas3_update.o)
"_dgemv_", referenced from:
_umfdi_local_search in libumfpack.a(umf_di_local_search.o)
"_dger_", referenced from:
_umfdi_blas3_update in libumfpack.a(umf_di_blas3_update.o)
"_dtrsm_", referenced from:
_umfdi_blas3_update in libumfpack.a(umf_di_blas3_update.o)
"_dtrsv_", referenced from:
_umfdi_local_search in libumfpack.a(umf_di_local_search.o)
"_main", referenced from:
start in crt1.10.5.o
(maybe you meant: _luaH_mainposition)
"_zgemm_", referenced from:
_umfzi_blas3_update in libumfpack.a(umf_zi_blas3_update.o)
"_zgemv_", referenced from:
_umfzi_local_search in libumfpack.a(umf_zi_local_search.o)
"_zgeru_", referenced from:
_umfzi_blas3_update in libumfpack.a(umf_zi_blas3_update.o)
"_ztrsm_", referenced from:
_umfzi_blas3_update in libumfpack.a(umf_zi_blas3_update.o)
"_ztrsv_", referenced from:
_umfzi_local_search in libumfpack.a(umf_zi_local_search.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
mex: link of ' "meshmex.mexmaci64"' failed.
make[2]: *** [meshmex.] Error 1
make[1]: *** [all] Error 2
make: *** [all] Error 2
The #include line would go into one or more of the source files, whichever ones uses APIs from the Accelerate framework. Are you getting compile errors? If not, then there's no need to add such an include line. If you are, then you need to add it near the top of whichever file is encountering the errors resulting from lack of those declarations.
Related
I'm trying to compile the typescript, tsx, and python parsers for use with neovim, but when I run gcc -o parser.so -shared src/parser.c -Os -I./src as instructed by the tree-sitter tracking issue I get:
Undefined symbols for architecture x86_64:
"_tree_sitter_tsx_external_scanner_create", referenced from:
_tree_sitter_tsx.language in parser-eb4e9b.o
"_tree_sitter_tsx_external_scanner_deserialize", referenced from:
_tree_sitter_tsx.language in parser-eb4e9b.o
"_tree_sitter_tsx_external_scanner_destroy", referenced from:
_tree_sitter_tsx.language in parser-eb4e9b.o
"_tree_sitter_tsx_external_scanner_scan", referenced from:
_tree_sitter_tsx.language in parser-eb4e9b.o
"_tree_sitter_tsx_external_scanner_serialize", referenced from:
_tree_sitter_tsx.language in parser-eb4e9b.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I've run the npm build steps, and tried the make file in build, but I'm not able to get the final .so files.
the error undefined symbol: tree_sitter_parsername_external_scanner_create also appears, when there is a mismatch between parser name and function names
// grammar.js
name: 'parsername',
// scanner.cc
void *tree_sitter_oldparsername_external_scanner_create() {
return new Scanner();
}
quickfix: replace name in scanner source
sed -i -E 's|(tree_sitter)_oldparsername_|\1_parsername_|g' src/scanner.*
Some grammars have external scanners - hand written C/C++ source files that are by convention called scanner.c or scanner.cc, which need to be compiled along with parser.c.
I'm trying to use the MWPhotoBrowser project in my project. I followed the whole installation process and was able to import the MWPhotoBrowser.h file. When I tried to build, I run into this error...
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_MWPhotoBrowser", referenced from:
objc-class-ref in PhotoBrowserViewController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Does anyone know how to resolve this?
Thanks
For anyone getting this issue...Please check if you correctly linked your project to the libMWPhotoBrowser.a file under Build Phases in your target settings !
I used Xcode to build a example of boost, but as you see followed it is failed. And the error
I've got is:
Undefined symbols for architecture x86_64:
"boost::system::system_category()", referenced from:
___cxx_global_var_init2 in sync_client.o
boost::asio::error::get_system_category() in sync_client.o
boost::system::error_code::error_code() in sync_client.o
"boost::system::generic_category()", referenced from:
___cxx_global_var_init in sync_client.o
___cxx_global_var_init1 in sync_client.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I don't know how I can fix it. I've added the include and libs path of boost into Xcode Build Setting. Does anyone have any idea about this problem?
Either link against a pre-built version of libboost-system.so or pull in libs/system/src/error_code.cpp (from your boost source package), into your project.
I have been forced to return to an old bugbear lately: compiling a fortran script to run under Matlab on Mac. I have managed to compile the example c file to mex but the Fortran file refuses unless I use -c and the object of my desire, kt3d.for, throws up a whole list of fun but all linked to the same error (I guess).
I'm running Matlab R2011b on OSX 10.7.5 with XCode 4.6.1.
I've patched Matlab according http://www.mathworks.se/support/solutions/en/data/1-FR6LXJ/
Got a Fortran compiler running according to https://sites.google.com/site/dwhipp/tutorials/mac_compilers
I altered the mex file to call bash rather than sh but still no joy. Getting tired of having to boot up my old XP machine every time I want to run a kriging package so I would really like to compile these things for OSX.
Below is the error, it looks like an architecture issue but I cant figure out how to fix it.
>> mex kt3d.for
Undefined symbols for architecture x86_64:
"_chknam_", referenced from:
_readparm_ in kt3d.o
"_cova3_", referenced from:
_kt3d_ in kt3d.o
"_ktsol_", referenced from:
_kt3d_ in kt3d.o
"_mexfunction_", referenced from:
-exported_symbol[s_list] command line option
"_picksup_", referenced from:
_kt3d_ in kt3d.o
"_setrot_", referenced from:
_kt3d_ in kt3d.o
"_setsupr_", referenced from:
_kt3d_ in kt3d.o
"_srchsupr_", referenced from:
_kt3d_ in kt3d.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
mex: link of ' "kt3d.mexmaci64"' failed.
Error using mex (line 206)
Unable to complete successfully.
I believe those symbols are found in GSLIB. Assuming you have this installed and somewhere that your compiler can find it, you may need to add something like "-lgslib" to your mex command to get it to link the library for you.
I'm probably missing something simple, but I'm getting the following linker error when trying to build:
Undefined symbols for architecture i386:
"CAStreamBasicDescription::CAStreamBasicDescription()", referenced from:
-[AudioController initializeAUGraph] in AudioController.o
-[AudioController .cxx_construct] in AudioController.o
"CAStreamBasicDescription::AsString(char*, unsigned long) const", referenced from:
CAStreamBasicDescription::PrintFormat(__sFILE*, char const*, char const*) const in AudioController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I can't figure out what's going on here as the compiler is finding CAStreamBasicDescription.h just fine. I've seen suggestions of clearing the framework search path when encountering this type of error, but there's nothing in that path. Probably something simple, but I feel like I'm drinking from a fire hose. Thanks!
Have you added CAStreamBasicDescription.cpp to your project also? It's part of the unofficial Core Audio SDK, so it isn't available unless you compile it yourself.