Add files to c project in geany5/24/2023 ![]() Then I has to change the second line of the Trill.h file to readįinally I had to change the Set Build Commands so the Execute Command read "./e%" 1 'bar' Next I had to make the first two lines of your general-print.cpp file look like this Then I added the Trill.h, Trill.cpp and I2C.h into the same folder as the general-print.cpp file. First off I added the file I2C.h to the editor window. However, I have managed to get it to compile with a few changes. I have spent time looking for this place on the web but this is not common knowledge, or at least easily found on a search engine. So the other libraries must be in the "right place". ![]() Just simply use a statement #include just like the #include in your code. Giuliomoro what process did you use to "pull in external libraries"? You can always build your program from the command line (or instruct Geany to do so if possible) by running g++ /path/to/your/file.cpp /path/to/Trill-Linux/lib/Trill.cpp -I /path/to?Trill-Linux/lib -o /path/to/binaryoutputfile Again, I don't know Geany and I don't know if it is capable of handling multi-file programs. Otherwise, you may have to add that file as a dependency. If the building system does compiling and linking in one stage, it would be sufficient to add /path/to/Trill-Linux/lib/Trill.cpp to the build line. is normally accomplished by passing to the compiler the option -I/path/to/Trill-Linux/lib. I am not familiar with Geany, so I will try to give generic instructions. The alternative, which is the more generic approach, is to somehow instruct your build systems to perform steps 1. cpp files in there, e.g.: Trill-Linux/examples/myproject/myproject.cpp and then run make again. The provided Trill-Linux/examples/Makefile does just that for all the folders in Trill-Linux/examples, so one easy way to add a new program is to create another subfolder in there, e.g.: Trill-Linux/examples/myproject, with one or more. build the Trill-Linux/lib/Trill.cpp file as part of the program.have the Trill-Linux/lib folder included among the folders to search for.None of these files is installed in a special place on your system. When you download the repo, the files are within the Trill-Linux folder. Grumpy_Mike I interpreted this as meaning either the libraries have not been put in the correct place, Although I have hardly used C much on the Pi before, I have been programming the Arduino for about 12 years. I interpreted this as meaning either the libraries have not been put in the correct place, or that I need to tell Geany where to look for your libraries.Īs this is my first time using Geany I tried a Hello World example where I had to pull in external libraries and that worked fine. But I also copied the general-print folder and the library files to other places, but the result was the same. I unzipped the Trill-Linux-master in the Downloads folder, and that is where the general-print.cpp was. This came up with a file not found on the first line which is an #include. Then I loaded in the general-print.cpp file from the examples/general-print folder and chose the compile option from the Build menu. What I did to try to compile it was to open the Geany editor and set the document type to C++. No the one I ran was compiled as a result of the make process when installing the library. ![]() Giuliomoro you must have managed to build them, too, as you managed to run one!
0 Comments
Leave a Reply. |