ddemidov / ev3dev-lang-cpp

C++ language bindings for http://ev3dev.org
MIT License
73 stars 38 forks source link

Cannot compile library on brick #45

Open magic-dave opened 5 years ago

magic-dave commented 5 years ago

When typing make as per the ev3 brick instructions I receive the error:

c++: internal compiler error: Killed (program cc1plus)

This happens no matter how many jobs I assign: -j1 does not even work.

Is there a reason for this? I considered the idea that my SD card is too small, but this is more of a processor problem, right?

Thank you

ddemidov commented 5 years ago

This looks like the compiler ran out of memory, which is not unreasonable given the amount of RAM available on the brick. I would try to use a cross-compiler: https://github.com/ddemidov/ev3dev-lang-cpp#cross-compiling

From the experience, cross-compiling on your desktop and copying the results to the brick is much more pleasant simply because it takes much less time. Compiling anything C++ on the brick takes ages even when it does work.

magic-dave commented 5 years ago

This would be fine for me, but it is my students that need to be able to use it. Im already pretty annoyed that they dont know how to use their own OS's to do this. Never mind. Thanks for your help.

Ill write them an instruction list for cross compiling

ddemidov commented 5 years ago

You can try to precompile the library for them, copy it into the brick (or provide a download link), and let them compile the actual program (and link it to the library) on the brick. It could work if the program compilation requires less memory that the library compilation.