I'm trying to build a C GTK app on my windows desktop that will run on a raspberry pi.
I'm using a docker container running ubuntu.
I have installed
eclipse
gtk3.0
I have included the library and can build a GTK app that just opens a window with nothing in it as a test and it runs with no errors.
I tried to move this on to the Pi an it returned an exec format error.
After a short google I realised it's because I used the standard gcc and not a 32 bit one.
I installed arm-linux-gcueabihf and configured the compiler.
Now when I try to compile I get the error.
usr/lib/x86_64-linux-gnu/libgtk-3.so: file not recognized: file format not recognized
collect2: error: ld returned 1 exit status
Any ideaa on where to go from here or can anyone suggest a better way to do this?
I've gone down the container route so I could save the container as an image when I have it all set up.
So I can create new containers in the future without all this hassle.
Related
I managed to setup the Neutrino 6.5.0 RTOS in a virtual box and connect to it over qconn from Momentics IDE for Blackberry IDE 2.1.2 .....
I can get the system information perspective view for my Neutrino.
BUT
when I am trying to run my compiled application I am getting the errors :
Could not launch
Cannot find qnx launch process
and
Error starting remote application.
Target launcher#<192.168.56.101:8000>: Error: Attempting to exec a shared lib
SO I manually copied the executable file I compiled to the /tmp dir on my Neutrino virtual machine and run it using ./Test ,still get this error:
"/bin/sh: ./Test: Attempting to exec a shared lib"
I rechecked the project option and make sure that this is an Application output and not a shared library output type.
Any idea what am I doing wrong ?
I also encountered the same problem. Later, I found that the cross compiler was selected incorrectly. This error occurs when x86 programs are run on arm processors; Specify the correct compiler to solve the problem;
When I try to add it to sources as per debian install instructions I get this error. I'm guessing this means that there are no arm packages for it.
Failed to fetch https://dist.crystal-lang.org/apt/dists/crystal/InRelease Unable to find expected entry 'main/binary-armhf/Packages' in Release file (Wrong sources.list entry or malformed file)
I'm guessing I probably need to install it from source. How would I go about doing that with an arm cpu? When I check it out and run make I get the error:
You need to have a crystal executable in your path! Makefile:113:
recipe for target '.build/crystal' failed make: *** [.build/crystal]
Error 1
Any suggestions would be greatly appreciated.
EDIT: There's now a semi-official repository for crystal on raspbian, check it out here: http://public.portalier.com/raspbian
Crystal doesn't build Debian packages for ARM, and you're correct in that you'll need to build from source.
However, the Crystal compiler is written in Crystal. This presents the obvious problem of how to get a compiler to build the compiler. The answer is cross-compilation: building an arm binary on a x86 desktop computer and copying it across.
Here's a quick step-by-step based on my memory of last time I cross-compiled:
Install Crystal on a x86 desktop PC, and check it works.
Install all required libraries on the desktop and Raspberry Pi. You'll need the same LLVM version on the Raspberry Pi and desktop. This is probably the hardest and longest step. You can install llvm 3.9 from debian testing for ARM, see this stackoverflow post for how to install only LLVM from debian testing.
Check out the sources from git on both computers, and run make deps.
Cross-compile the compiler by running this command in the root of the git repository:
./bin/crystal build src/compiler/crystal.cr --cross-compile --target arm-unknown-linux-gnueabihf --release -s -D without_openssl -D without_zlib
This command will create a crystal.o file in your current directory, and also output a linker command (cc crystal.o -o crystal ...).
Copy crystal.o to the raspberry pi, and run the linker command. Be sure to edit the absolute path to llvm_ext.o so that it points to the Crystal checkout on your Raspberry Pi, not the checkout on your desktop. Also make sure that all references to llvm-config in the command are for the correct LLVM version. For example, changing /usr/local/bin/llvm-config to llvm-config-3.9 on Raspbian.
Run the crystal executable in your current directory (./crystal -v) and make sure it works.
Ensure to set CRYSTAL_PATH environment variable is set to lib:/path/to/crystal/source/checkout/src so that the compiler can find the standard library when compiling applications.
I've finished the setup of my jetson tk1 eval board and I've started to setup my Nsight Eclipse to remotely run my programs on the Jetson board.
I've created a CUDA C project in Eclipse and completed the setup and connected my board to my eclipse.
When I build the sample CUDA file locally on eclipse it's working fine but when I try to run on the remote board, I get this output :
echo $PWD'>'
/bin/sh -c "cd \"/home/ubuntu\";export LD_LIBRARY_PATH=\"/usr/local/cuda-
6.0/lib\":\${LD_LIBRARY_PATH};\"/home/ubuntu/test\"";exit
ubuntu#tegra-ubuntu:~$ echo $PWD'>'
/home/ubuntu>
ubuntu#tegra-ubuntu:~$ /bin/sh -c "cd \"/home/ubuntu\";export
LD_LIBRARY_PATH=\" /usr/local/cuda-
6.0/lib\":\${LD_LIBRARY_PATH};\"/home/ubuntu/test\"";exit
/home/ubuntu/test: 1: /home/ubuntu/test: Syntax error: ")" unexpected
logout
From the last line of output, it seems like it's an executable format error. Does anyone ever encountered something similar? I'm running out of ideas.
I managed to find the answer. The version of Eclipse I had wasn't able to correctly compile my cuda file into the ARMv7 format. So I was always uploading an x64_86 format executable file.
My solution was to create a bash script that transfers the cuda file and compile it directly on the board when I launch the run sequence from eclipse.
In the end it took a bit of programming to make things work but it's now compiling and executing correctly on the remote board.
Hello I meet the same problem. I solve these problem by delete the whole workspace and generate a new one. You can have a try.
I am a newbie working with Cygwin and CUnit. I have to develop some Unit Tests using CUnit and Netbeans and I have followed the next tutorial:
https://netbeans.org/kb/docs/cnd/c-unit-test.html?print=yes#project
At the end, when I was trying to run the first example test I got stocked by an error:
0 [main] make 4380 C:\cygwin\bin\make.exe: *** fatal error - error while loading shared libraries: /cygdrive/C/Program Files/NetBeans 8.0.2/ide/bin/nativeexecution/Windows-x86_64/unbuffer.dll: cannot open shared object file: Exec format error
448 [main] make 4380 open_stackdumpfile: Dumping stack trace to make.exe.stackdump
I don't know if this has relation to the Cygwin version I have, I have a computer running Windows 7 Enterprise 64bits edition. I have configured my C project to use Cygwin 64bits edition...
Could you please share any idea about how I can solve this?
Thanks!
I had a similar issue, but in my case I was trying to run CppUnit tests in Netbeans. I was using make provided by MSYS2 and it was failing to load unbuffer.dll, but error was "No such file or directory". I switched the make from MSYS2 for the one found in MSYS and the error went away. You could try this as a workaround.
I found sole here:
https://bz.apache.org/netbeans/attachment.cgi?id=164026&action=edit
Need download new version of unbuffer.dll.
Yar
I have a CC2538dk board. I am using Ubuntu 12.04 and cloned Contiki repository from github. I was able to compile all the code in Contiki using make TARGET=cc2538dk hello-world, but I'm not able to upload the code to the CC2538dk board from command line.
The error I'm getting when I ran make TARGET=cc2538dk hello-world.upload is as below.
make: No rule to make target `hello-world.upload'. Stop.
I used to use TI's Uniflash tool (CCS_Uniflash v2.2) to upload the the .elf binary, but it is not available in Contiki.
There is no make target for uploading to CC2538dk boards. According to the documentation one should use TI's UniFlash.
I had success compiling the contiki examples on a separate computer, then using Code Compose Studio v 5.4 to import my binaries (ELF files) to an empty CC2538 project, then debug it from there in order to get it loaded onto the board. Definitely not ideal, but it works.
Setup:
Compile contiki source and examples from instantContiki
move the example directory, included blink.elf to windows machine with CCS 5.4 installed
make a new project in CCS, select Other Examples->Empty CC2538 Project
Import a C/C++ executable, then using the GNU Elf reader, select the blink.elf file you moved over
copy+paste the CC2538SF53.ccxml and the cx2538xf53_ccs.cmd to the new project, and try to debug using those configurations.
The reason this seems to work is that the xds100v3 drivers that come with the board's install disc and the uniflash tool don't seem to work right and just give me any number of errors. There's a black-magic-configuration-combination of the CCS 5.4 for Window's drivers/Other Example's CC2538SF53.ccxml that was the only way I was able to connect to the target.