How to Add New Libraries

Sysprogs forums Forums VisualGDB How to Add New Libraries

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #8281
    hush
    Participant

    I just downloaded the trial version, and I really like what I see so far. However, I don’t understand the best way to add libraries for my project and VisualGDB to use. I’m developing on the STM32F411RE, and I’m working with STMicro’s example project for their bluetooth X-NUCLEO-IDB04A1 module. Their code for X-CUBE-BLE1 library has a directory structure of .h and .cpp files that is fairly complex. I am currently copying this entire folder to the location where my visual studio project is located. If I do that, then it looks like I need to add a couple of dozen lines into the Makefile settings “Include directory”. That seems painful and requires me to do this for every project that uses this library. What is the best way for me to build a project with this?

    1. Is there a recursive way, and is that even a good idea if there is?
    2. Should this instead be moved into the shared area somewhere in AppData\Local\VisualGDB\ to be shared across projects?
    3. Is there a better way I haven’t considered?

    Thanks so much in advance!

    #8285
    support
    Keymaster

    Hi,

    Yes, you can right-click on the Source Files folder in Solution Explorer and select “Add->Import Folder Recursively”. VisualGDB will then allow automatically adding all files from a given directory and subdirectories to the project. You can choose to either copy those files to the project directory, or reference them in their current location (that can be a directory shared between several projects as you suggested).

    You can also set a checkbox to automatically add all directories containing .h files to the include directory list in your project so you won’t need to do that manually.

    Let us know if this does not work.

    #8290
    hush
    Participant

    Yep, the “Import Folder Recursively” option was exactly what I needed. I am able to compile and execute the example project with this. I also used the “Exclude from Project” option on the few files I didn’t need in that folder.

    Thanks!

    #9000
    toolbandfan
    Participant

    After the libraries are added with the “import recursively”, is there something else that needs to be done to get everything to compile? I am getting this error while trying to compile a simple gpio library I made:

    make: *** No rule to make target ../../../libraries/gpio/gpio.c', needed byDebug/gpio.o’.  Stop.

    • This reply was modified 8 years, 2 months ago by toolbandfan.
    • This reply was modified 8 years, 2 months ago by toolbandfan.
    #9022
    toolbandfan
    Participant

    Okay so based off this thread: https://sysprogs.com/w/forums/topic/no-rule-to-make-target/ I tried putting my library in the project folder and I tried putting it in the VisualGDB shared folder that has the STM files. I also started looking at the make files. I checked the VisualGDB settings and it looks like the correct path is shown in the make file and GDB settings. Not sure what is going here. Although my file is a .cpp file but it looks like make is trying to compile it as a C file? Could that be the problem?

    • This reply was modified 8 years, 2 months ago by toolbandfan.
    #9025
    toolbandfan
    Participant

    I wanted to update that I got everything working. I started a new project and everything works now. I’m pretty sure the problem was that I totally forgot how to write a class implementation. Doh!

    #9032
    support
    Keymaster

    Good to know it works. If you encounter further problems, feel free to contact us again.

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.