Pololu Robotics & Electronics
Menu
My account Comments or questions? About Pololu Contact Ordering information Distributors

Pololu Forum

Static C Tic library

Are their instructions for generating a static library (.lib) version of the Tic library.

I am working with the Tic 36v4 controller.

The serial interface for the USB port does not seem to work.

I used MSYS2 to build the solfware. This results in a dynamic library that does not work with MSVC, aside from that I would actually prefer a static link library. I see instructions for building the dynamic library but I don’t see any instructions for building a static link library. My ideal would be to use the Tic library for control.

Thanks much

-glenn

Hello, Glenn.

Thank you for your interest in the Tic.

When building the Tic software or libusbp, you can use the -DBUILD_SHARED_LIBS=false option when you run CMake to make it build static libraries instead of shared libraries. The header files of the Tic library and libusbp need to know that you are using static libraries, so you would need to define preprocessor macros named LIBUSBP_STATIC and TIC_STATIC when you use the libraries in your project. (The values of those macros do not matter, they just need to be defined.)

If you want to use the Tic library from an MSVC program, you should probably make sure that you compile the Tic software with MSVC instead of GCC. We do not have instructions for how to do that. If you are familiar with compiling C code into a static library with Visual Studio, then you might try doing that with the Tic and libusbp code. We can help you fix any specific errors or warnings that you get.

You can also use CMake to generate Visual Studio projects, but I have not tried it to see how well it works. To do that, you can either remove the -G"MSYS Makefiles" argument to CMake or change it to something like -G"Visual Studio 16 2019". You can run cmake --help to see the list of supported generators.

By the way, it might be easier to just invoke ticcmd from your program instead of building the Tic software yourself and learning how to use the C API.

The Tic’s USB interface does not provide a virtual serial port.

Please let me know if you have any further questions.

–David

David,

Thanks for the input. I was able to recomple both libusbp and the tic library under MSVC 2019 directly.

Though about using the ticcmd, but it is a complicated motor control where we need to watch several motors and make changes after they reach locations. Direct programming will probably be more efficien

-glenn