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.
Related
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.
I am getting this error when I try to run my unit tests. The entire error is:
Undefined symbols for architecture i386:
"_CGImageRelease", referenced from:
_releaseImages in UIImage+animatedGIF.o
"_CGImageSourceCopyPropertiesAtIndex", referenced from:
_delayCentisecondsForImageAtIndex in UIImage+animatedGIF.o
"_CGImageSourceCreateImageAtIndex", referenced from:
_createImagesAndDelays in UIImage+animatedGIF.o
"_CGImageSourceCreateWithData", referenced from:
+[UIImage(animatedGIF) animatedImageWithAnimatedGIFData:] in UIImage+animatedGIF.o
"_CGImageSourceCreateWithURL", referenced from:
+[UIImage(animatedGIF) animatedImageWithAnimatedGIFURL:] in UIImage+animatedGIF.o
"_CGImageSourceGetCount", referenced from:
_animatedImageWithAnimatedGIFImageSource in UIImage+animatedGIF.o
"_kCGImagePropertyGIFDelayTime", referenced from:
_delayCentisecondsForImageAtIndex in UIImage+animatedGIF.o
"_kCGImagePropertyGIFDictionary", referenced from:
_delayCentisecondsForImageAtIndex in UIImage+animatedGIF.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I did all the instructions here:
http://twobitlabs.com/2011/06/adding-ocunit-to-an-existing-ios-project-with-xcode-4/
Also added the library to "Compile Sources" in Build Phrases of the test target. Still no luck.
Looks like you need to add "CoreGraphics.framework" and "ApplicationServices.framework" to your unit test target membership.
Here's how it's done for a file:
Just go to "CoreGraphics.framework" in the list of files and folders on the left side and make certain the checkmark is "ON" for the unit tests target.
Go to build phases of target, Add ImageIO.framework
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 use zxing lib in my OS X application. I've included zxing-objc to my project and simply copy-pasted code from zxing demo (zxing-root/objc/examples/demo) to the separate ViewController class. When trying to compile project, I get the following linker errors:
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_QTCaptureDevice", referenced from:
objc-class-ref in ScanViewController.o
"_OBJC_CLASS_$_ZXCapture", referenced from:
objc-class-ref in ScanViewController.o
"_QTMediaTypeMuxed", referenced from:
-[ScanViewController performVideoSourceScan] in ScanViewController.o
"_QTMediaTypeVideo", referenced from:
-[ScanViewController performVideoSourceScan] in ScanViewController.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 carefully checked all code and compared my project properties (including c++ compiler options) to demo project properties, and everything is done right.
You need to add the necessary frameworks to your app target. You can look in the sample app for an example. Select the target in Xcode, select Build Phases, and open the Link With Libraries entry. You'll see that it includes both QuartzCore and zxing-objc-framework. It sounds like you don't have those in 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.