Sysprogs forums › Forums › VisualGDB › How to Add New Libraries
- This topic has 6 replies, 3 voices, and was last updated 8 years, 2 months ago by support.
-
AuthorPosts
-
May 23, 2016 at 18:01 #8281hushParticipant
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?
- Is there a recursive way, and is that even a good idea if there is?
- Should this instead be moved into the shared area somewhere in AppData\Local\VisualGDB\ to be shared across projects?
- Is there a better way I haven’t considered?
Thanks so much in advance!
May 23, 2016 at 23:37 #8285supportKeymasterHi,
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.
May 24, 2016 at 05:54 #8290hushParticipantYep, 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!
September 7, 2016 at 07:29 #9000toolbandfanParticipantAfter 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 by
Debug/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.
September 8, 2016 at 03:47 #9022toolbandfanParticipantOkay 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.
September 9, 2016 at 00:50 #9025toolbandfanParticipantI 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!
September 11, 2016 at 18:43 #9032supportKeymasterGood to know it works. If you encounter further problems, feel free to contact us again.
-
AuthorPosts
- You must be logged in to reply to this topic.