in4lio / ev3dev-c

LEGO MINDSTORMS EV3 Debian C library + Python, Ruby and Perl wrappers
MIT License
71 stars 30 forks source link

Installing docker image #27

Closed cgu2022 closed 4 years ago

cgu2022 commented 5 years ago

So I'm trying to install the docker cross compiler, and it says that I need to clone the ev3dev-c library in the docker folder. So, I run (in powershell): docker build https://github.com/in4lio/ev3dev-c.git#master:docker. And it gives me:

Sending build context to Docker daemon 9.216kB Step 1/4 : FROM ev3dev/debian-jessie-armel-cross:latest latest: Pulling from ev3dev/debian-jessie-armel-cross

.... ....

Removing intermediate container 9a74020d0c2e ---> 1e195ce2dd5d Successfully built 1e195ce2dd5d SECURITY WARNING: You are building a Docker image from Windows against a non-Windows Docker host. All files and directories added to build context will have '-rwxr-xr-x' permissions. It is recommended to double check and reset permissions for sensitive files and directories.

After that, I tried running: cd /PATH/TO/ev3dev-c/docker/ but it doesn't work and gives me an error saying it can't find it. After copying the library, is there anything else I need to set-up?

And also just to clarify: does the bash command line support secure copy protocol (scp) like on linux? If not, how would I transfer my compiled files to my ev3?

Thanks!

tcwan commented 5 years ago

I have not tried doing this in Windows. The Unix environment in Windows should have access to the various command line tools, if they're not installed by default you can try to apt-get them (I think it is based on Ubuntu distro).

As for the issue with the cd /PATH/TO/ev3dev-c/docker/

I think you haven't cloned the ev3dev-c repository to your drive yet. You should go to the directory you want to keep the ev3dev-c code, then:

git clone https://github.com/in4lio/ev3dev-c.git
cgu2022 commented 5 years ago

Thanks tcwan. I followed through the instructions, but after installing the static and shared libraries like on the tutorial, I tried compiling a test cpp file that had the #include "ev3.h" , with g++ test.cpp -lev3dev-c -o test like I normally do on the ev3, but said it couldn't find the ev3.h file. Is there supposed to be a different way to compile the cpp files?

cgu2022 commented 5 years ago

Also, I compiled the hello file at: "/home/robot/ev3dev-c/eg/hello" and get a hello executable. Do you know how I could transfer that file to my ev3?

tcwan commented 5 years ago

Also, I compiled the hello file at: "/home/robot/ev3dev-c/eg/hello" and get a hello executable. Do you know how I could transfer that file to my ev3?

Try looking at some of the info here. You would probably need to adjust a bit for Windows, but you can get WinSCP which is a GUI version of scp for Windows. Putty provides SSH.

Thanks tcwan. I followed through the instructions, but after installing the static and shared libraries like on the tutorial, I tried compiling a test cpp file that had the #include "ev3.h" , with g++ test.cpp -lev3dev-c -o test like I normally do on the ev3, but said it couldn't find the ev3.h file. Is there supposed to be a different way to compile the cpp files?

This has to do with the Include paths. You can check the Makefile.* in the ev3dev-c/eg directory to understand a bit more regarding how to configure CFLAGS and CXXFLAGS. The actual Makefile for the program is found in the respective subdirectories. The easiest is to clone one of the example subdirectories and start from there for your own code.

Note that the Makefiles in the project is a bit advanced. I don't know the details regarding how to do filename substitution and suffix conversion, but there should be something on the Internet.