Closed stephanschulz closed 1 year ago
The error "Could not find interface 2." would be an error you only see at run time, but it doesn't make sense for Tic software to show that error because the Tic only has one USB interface, so the software would never attempt to find interface 2.
Also, I'm not sure what program you're even running which is printing that error, because you posted some output showing that you're not even able to compile the code. If the compiler prints "fatal error" then it means it didn't succeed in compiling your executable. We should focus on fixing the compilation errors first. They don't really look like they have anything to do with the Tic, but you could narrow down the problem by removing unneeded or unused things in code.cpp one at a time until you have a very simple, small file the gives the same errors.
You are right. I was trying to make this libusbp example work https://github.com/pololu/libusbp/blob/master/examples/port_name/port_name.cpp
But in fact I only had to add this code to my c++ app and it seems to work well now. https://www.pololu.com/docs/0J71/12.11
Thanks for your advice.
OK, great. Since the problem is solved, I'll close the issue.
I am following the steps in 12.11. Example code using the C++ API and try to run the example code. I am on macOS 12.6.6 with a M1 chip.
first I had to
export PKG_CONFIG_PATH=/Users/stephanschulz/tic/build/lib:$PKG_CONFIG_PATH
(which now points to where the libpololu-tic-1.pc file is located) in order for the commandg++ code.cpp $(pkg-config libpololu-tic-1 --cflags --libs)
to execute correctly.The I tried to run code.cpp which throws the same error as when I tried to add the library to my custom c++ app as mentioned here: https://github.com/pololu/libusbp/blob/master/README.md#incorporating-libusbp-into-a-cc-project
Something about
libusbp::error: Could not find interface 2.