Platform.io - how to compile just library files, which are used in project - platformio

I'm using library ESP8266 audio, which contains lot of files. I'm using just a few of them, but when I want to build my project, platformio tryes to complie ewerything. It's quite issue, because unused filles has dependecies, which are not included in my project (eg. SD card library, file system library...). I can build my code with arduino IDE without any issues, but I'm not able to do the same thing in platformio. I tried to tweak src_filter flag, but it has no effect at all. I'm stucked on this for more than day and I wasn't able to find any relevant informations :/
Thank you for your answers.

Oh, I solved it myself! :D I have set 'lib_ldf_mode' to 'deep' on platformio.ini. It's now acts exactly as I need. It starts in 'src/' folder and then recursively compiles imports and imports of imports and so on.

Related

Arduino with multiple libraries in Eclipse IDE

I have an Arduino code and want to continue programming in Eclipse IDE. Basically it consists of 2 main projects which use a lot of common, mostly self-written libraries and structs.
I want to include the two main projects and the libraries in Eclipse.
The problem is, that the compiler can't find the Libraries.
I already Googled a lot but didn't come to a working solution yet.
There are many possible solutions to this problem:
- Move the libraries to C:\Users\Andreas.arduinocdt\libaries - does not work.
- The best one: Set the Arduino Sketchbook location of the Eclipse Arduino IDE. But I can't find the location of this setting.
- Tell the compiler all location of the libraries.
- Write something ugly like this: #define INCLUDE_PATH(N) - But it doesn't work with external (downloaded) libraries or libraries consisting of multiple files.
But I didn't get any Solution to work.
Eclipse Version: 2020-03 (4.15.0)
Can you help me, please! Thank you very much!
Andreas
The current structure of the project. The SettingsGateway is one of many libraries.
Hi I ditched Eclipse for Arduino (microcontroller) development. I use a combination of ArduinoIDE wirh notepad++ as Editor (with plugins) and doxygen for documentation. I write code in C, C++, Javascript CSS, HTML so pretty different code bases. The "problem" with eclipse: it saves the libs woth the project, so if I change something in a lib I have found so far no easy way to automaticlly distribute it to the other projects using the same lib.>br>I am sure there is some plugin, but my job is to code and not to readd ocumentation of an ever changing IDE. If you stay with eclipse for Arduino Sloeber is your easiest option: http://eclipse.baeyens.it/index.shtml Everything together in a central place, you can then install other modules if needed

JAVA Project Import Difficulty

first off thanks for any help! I am relatively proficient at programming in languages like python, but that's not going to stop me from asking a dumb, and probably very basic question about JAVA
I am working on some satellite orbit research for graduate school, and I am using the maven compiled java project OREKIT. Information on OREKIT can be found here;https://www.orekit.org/site-orekit-9.2
I believe I have built the project correctly using the steps to import a maven project into eclipse, but I am having issues getting any of the included tutorial programs included to run. The first errors I get are "Error: Could not find or load main class" and then followed by the name of whichever tutorial script I'm attempting to run.
MY attempt at solutions, which have not worked are as follows: First I attempted to create an entirely different java project with a main class and import the scripts I wanted to run, but I think this created more problems than it solved. Secondly, in the OREKIT project folder which was created with the maven building, there is a src folder. I right clicked and set it as the source. It contains a "main" folder with various contents but still the errors persist.
I probably am asking something extremely simple, and googlable but I haven't figured out what to google or what to do to fix my problem. If anyone has some suggestions I would be extremely grateful!
Thanks a ton!

Why can't I debug into UnityEngine.UI code?

I add the UnityEngine.UI.dll and UnityEditor.UI.dll to my assets folder with their mdb files . also i add the both project to my current project. i am sure all the unity engine ugui code build success, because i debug log in the event system, and it print message. when i want to step into the event system class, i always failed . I find unity will load the code from a build path ,rather than i original code. Why does it do this ? if i want to debug unity engine ugui code, what should i do ?
To debug code, you need two things:
Symbols, the list of all functions, classes, variables used throughout the module. When using C++ symbols are stored in special .pdb files on Windows (and you obviously are using Windows since you are talking about dlls). Symbols in C# (.NET in general) are stored in the .dll itself. Having symbols will let you see the name of functions on the call stack and possibly some variables but nothing more.
Source code of the module.
U3D's source code is proprietary - you need to spend a good amount of money to receive it. And if I am guess to - UnityEngine.UI.dll is a C++ module with stripped (removed) symbols removed.
Thus you have neither, so you can't debug U3D's code at all.
Why would you need to that anyway? If you want to see how the internals of a big game engine work, there are plenty of other options (for example UE4 and Lumberyard). If you are struggling with a problem and you'd like to be able to solve it through debugging...well though luck. Your best bet would be to ask in unity community.

opencv example not working in OpenFrameworks

I have downloaded openframeworks from Github. I can run all the samples but if I am trying to run opencv example given in openframeworks. Its not working, showing 44 errors and errors are not common too. I think there linking files are also missing in github. Do you have any idea why only opencv example cant get executed ?
In, for example, iPhoneFaceSamplesSomething some files are missing that you can get from other parts of the project (jpg, xml) or just ignore (png). You get a ton of warnings because they added OS X libs which XCode ignore, no big deal. And then some libs are missing for the iPhone like opencv highgui and some other. You should try to get them from somewhere else or compile them yourself. The project definition is a bit messy, you can also file a bug in github.
actually the answer to this is that the ofxOpenCv examples only work when run on the actual device. ofxOpenCv doesn't work in the simulator on iphone currently.
Check the read me file for includes. Often times OF addons have dependancies that are not included in the download.
Also another thing that will get you sometimes is when you're running the incorrect profile on your system. Like OSX 10.5 instead of OSX 10.6. Also fiddle with the release and debug options(switch back and forth), that will often help (I know it sounds hack-ish).

Considerations for including library as binary vs source

I'm trying to write an SSH client for the iPhone, and I'd like to use the libssh2 open source library to do so. It's written in C.
How should I include this C library for my iPhone app? Should I compile it into some binary that I include into the my app, or do I add all the source to my project and try to compile it along with the rest of my app?
I'm interpretting this question as:
"Should I compile the C library code once, and include the binary library in my project? Or should I include all the source and compile it every time I build my app?"
It depends. One of the projects I work one depends on several external libraries. Basically, we have a simple rule:
Do you think you will need to change code in the C library often?
If you will be changing the code, or updating versions often, include the source and build it with the rest of your project.
If you're not going to change the code often or at all, it might make sense to just include the pre-built binary in your project.
Depending on the size of the library, you may want to set it up as a distinct target in your project, or for even more flexibility, as a sub-project of your main project.
If I was in your place, I would build libssh2 ahead of time and just include the binary library in my iPhone project. I would still keep the libssh2 source around, of course, in case it does need to be re-built down the road.
I have an iPhone app that is 90% c. I have had no problem adding 3rd party sources to my project and compiling. I am using Lua, zLib, and libpng with no modifications. I've also included standard libraries like unistd and libgen and they just work™
The Three20 iPhone library has a great howto on adding their library to your xcode project. Give that a shot.
I think you will find in the long run you will be better off building it into a standalone library and linking it with your application. This makes it easier to integrate into future apps. Another benefit is that it encourages code separation. If you feel pretty confident with the library, you can link your debug exe to the release build of the library and get some extra performance.
I can't really think of any downsides to creating a library, after the initial cost of setting it up, and having an extra project to modify if you have some changes that need to be made to all your projects. Even if you don't know how to make a library for the iPhone, this is a good excuse to learn.
Just adding the source to you project should work fine as well.