There are two official ways of compiling Arduino sketches; The Arduino IDE that can either be installed by ppa or by downloading the source or the "ino" compiler that also could be downloaded by source.
I don't like both of them. The Arduino IDE needs to be run as root to work fully correctly and has a way too simple editor. The Ino Compiler Doesn't work with my Sketches (especially those with ethernet support, see Arduino CLI Compiler “ino” and some basic sketches lead to compile errors) and I also don't really know how it behaves when I feed it with some C++ or even C++11
What I really like to know: Is there a way to compile the arduino sketches the "Unix"-Way either with gcc or with clang. What libraries do I need to include, are there any example makefiles? How do I upload them to my arduino?
btw. Using Ubuntu 13.10 and soon 14.04 on 64bits. Having Arduino Mega 2560, Arduino Uno and Arduino Mini/Nano compatible board as well as an Ethernet Shield.
The Arduino IDE needs to be run as root to work fully correctly and has a way too simple editor.
that is a configuration fault of the deb package. Arduino ide runs fine if user has right priviledges on the serial. Especially the newest 1.5.6-R2 witch is compatible with new linux /run rules (old RXTX has been replaced)
The Ino Compiler Doesn't work with my Sketches
you are not using the packaged compiler, but your distribution one's witch is a lot newer and break code. Also we don't know witch patch are applied on that compiler, so the results will be unreitable. Try to download the arduino IDE from the official site, and just unzip it and run. It will compile fine, as it will use its own (old) compiler. On github you'll see they are working on resolving these bug, you can download the specific branch.
Is there a way to compile the arduino sketches the "Unix"-Way
yes, but not easily. you have to convert the .ino into a .cpp and add a main() method. there are some makefile that do that, but they will be break-prone, you should use CLI now that it has been provided. If you still want to use an external makefile, see https://github.com/sudar/Arduino-Makefile
Related
I am trying to make a C++ application with wxWidgets for raspberry on Visual studio.
I created a blink project from the templates and I only added the library wx.h in order to test the code and when I try to compile it fails because it doesn't find the library.
By the way, the blink project itself works fine. It only fails when I add the wx.h library.
#include <wx-3.1\wx\wx.h>
It's odd, because whe I open the file it has the right path.
Even intellisense detects the path correctly.
But I can't figure out what is causing the error.
I configured a remote connection to the raspberry:
And these are the errors displayed:
There is not enough information to answer your question, e.g. you don't explain how do you build your project at all (e.g. do you use CMake?), but a couple of observations that may be helpful:
wxWidgets headers are included as <wx/wx.h>, you definitely should not have the wx-3.1 component and you must use slashes and not backslashes.
You have to provide the compiler with the appropriate options, which usually happens by running wx-config --cxxflags under Unix systems (which may be hidden from you if you use CMake FindwxWidgets module which uses wx-config internally).
I have an Ubuntu server (with a VPN and a samba share), where I store all my project files and so on.
I would like not to have to back up the files I have on my computer to the server, but instead, directly use the files that are on the server.
But, when I want to build a project on Windows, it gets really slow, since I basically have to be transferring that whole bunch of files visual studio creates through the internet, so I can build the project.
The core concept is:
Open files that are on the server and use them (ie. saving one file at a time is fast enough not to make a difference).
Compile the code on Linux (Maybe code a VS extension with sockets that will tell the server to build, and that server-side, when done building, will send a message back, for VS to run and debug the program). Which would be much better since my laptop is nothing compared to the server performance-wise.
Run and debug the program with VS on windows.
I've so far only been able to find this(which is not what I want because it uses g++, and I'd like VC++) and this(which is not what I want because it's compiling for linux and executing it remotely). What I'm looking for is a mixture of both.
Remote compiling, local programming and executing.
Would also be great because supposedly, I could build with whatever VC++ version I wanted with whatever SDK I wanted. So I could basically easily switch between compiling for Windows 7 and 10.
I'd just like to know: Is it possible to achieve that? And if so how?
Using VC++ directly on Linux is not possible.
To let the Linux server do the compiling with VC++ anyway you could either use wine which apparently works with older Versions (see https://appdb.winehq.org/objectManager.php?sClass=application&iId=5766
) but propably is not easy to set up in a CLI envrioment and might cause License Issues with Microsoft, or use Windows Virtual Machines, which tend to have some Performance drawback.
The best Solution would be to use GCC (g++), which works on a wide range of architectures and operating systems and supports cross compiling.
I'm currently working on a Linux project. This project needs to run under every Linux distribution (without installing any package/libraries/others for the clients) and it's a bit hard to do it well.
I already tried to do it myself, see this, i have also tried to use CDE but it didn't work well since i got an error with some distribution. For example:
Ubuntu 8.04: Impossible to read the header ELF
Debian 7.8: version of GLIBC_2.14 not found
So, i would like to know if there is a way to get a package of my program who can run under every Linux distribution.
Thanks
Edit: I would like to avoid the static compilation, since my program is pretty big.
There are big differences between linux distributions, especially version of libraries and package management system.
The only way how to do it is to build/compile your project against all libraries you need to use statically, and distribute them with your project.
For example skype and ejabberd do it this way.
I'm working on a library which was intended to use on Linux-only machines. So I choosed GNU autotools for build system and did everything with only Unix-like OSs in mind. After a while, we needed to port the library to Windows. Thanks to CygWin everything compiles and works fine. Now we need to provide the library for WindowsCE. Is this possible? I think CygWin does not support WinCE. Do I need to re-write the library for WinCE?
Cygwin does not support WinCE, so you will need to port your code to WinCE APIs.
I looked all over on google but I can only find answers for unix systems or windows with cygwin. I want to be able to use clang_complete on windows without cygwin.
Is it possible to get clang_complete to work on windows without cygwin? I've installed clang_complete with pathogen. But I know I need clang and llvm itself, but I don't know how I could install clang and llvm and make it portable so it works anywhere. (such as a usb drive, etc) I've already gotten vim and gvim to work on the usb drive by just copying the folder that vim was installed to and putting it on the drive, but I need help getting clang_complete to work.
Thanks.
At this stage, you'll probably need to compile Clang yourself from either MinGW/MSys environment or through MSVC. It will probably still be quite buggy at the moment. Note that libc++, Clang's C++ runtime, is not ported to Windows yet, so you're stuck with an old, pre-C++11 version of gcc 4.2's libstdc++.
Also, I don't think it is currently possible to relocate Clang — it uses fixed paths for things like includes and libraries.