How do I build a C++ program with tree-sitter and tree-sitter-cpp on Windows #2141
-
Hello, I am trying to write a new application that uses tree-sitter to parse c++. Now I want to try and set up a new test program for C++ parsing, so I cloned When I build it, I get numerous linker errors. I am building with the clang command:
It seems like it can't find the tree-sitter-cpp functions, but I'm using the same clang command line as with the json test example, but modified to compile |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I think that grammar has an external scanner portion so that source needs to be accounted for when compiling. The following is part of a shell script that accounts for that kind of situation: https://github.com/casouri/tree-sitter-module/blob/d3ed3beb47dcc7b73098f636af737f489fb5c93c/build.sh#L108-L127 |
Beta Was this translation helpful? Give feedback.
-
Thanks, that seems ot have worked so far... for future searchers, here is what worked for me:
then this to build tree-sitter itself:
then this to build the example (but I modified the exmaple so it was parsing C++ instead of some json):
|
Beta Was this translation helpful? Give feedback.
I think that grammar has an external scanner portion so that source needs to be accounted for when compiling.
The following is part of a shell script that accounts for that kind of situation: https://github.com/casouri/tree-sitter-module/blob/d3ed3beb47dcc7b73098f636af737f489fb5c93c/build.sh#L108-L127