1

I want to use ch.h file from chibios in my project. The embedded project is created and is using HAL drivers for stm32. I want to find a way to add or import chibios library to the current project.

My question is that

  1. how can I add these embedded libraries with lots of dependencies by visualGDB in visual studio?
  2. Do I need to create .lib files of chibios?
  3. What are the differences between C/C++ paths and linker paths?
  4. Adding .a and .h files is enough or do I have to look for other files?

There are 3 ways that I followed and it wasn't successful.

  1. I followed the link to add the paths. The files that added to projects are libch.a and ch.h. It is called other header files inside ch.h. Then, I added the other header paths to C/C++ "additional include directories" too. After I added the third header file, I got the error "redefinition".

  2. The second way, I wanted to use vcpkg, a library manager. But the chibios library wasn't available in vcpkg.

  3. One another way is to add libraries in standard libraries without adding any paths. But how can I find standard libraries? If the location is in the compiler (gcc-arm-none-eabi), the chibios package was added, but it still wasn't detected in visual studio.

I really appreciate it if you know any tutorials or ways to add chibios in the visual studio

Mary
  • 71
  • 1
  • 7
  • @drescherjm Yes. I am using visual studio professional 2017 + visualgdb. – Mary Dec 15 '21 at 00:47
  • I asked because so many people are using VSCode and still mention Visual Studio which is very different. I changed the tag to clarify the vs version. – drescherjm Dec 15 '21 at 00:49
  • Maybe did not unzip the file? **no such file/directory** Can you find the required file in the path folder? It will be better to provide detailed steps(how and where). – Minxin Yu - MSFT Dec 15 '21 at 03:11
  • @MinxinYu-MSFT I solved the "no such file/directory" error by adding the paths. It is unzipped. I can also open and use the chibios libraries by chibiStudio without errors. I only don't know how to import it in visual studio. Because it is embedded, there are lots of dependencies (each header files call another header files from another path). I think it doesn't make sense to add each header path one by one. Or I don't know the way. The only steps I did, it is based on the shared [link](https://www.learncpp.com/cpp-tutorial/a2-using-libraries-with-visual-studio-2005-express/) – Mary Dec 15 '21 at 21:42

0 Answers0