Jump to content

M1: when I build the executable file with geany, the type of file is wrong and does not execute


vr@m

Recommended Posts

Hello everyone, I have some problems with the example of the ir receiver on a Nanopi M1 usign the geany editor with the debian jessie 3.4.... provided by friendlyarm, I decided to modify the original demo program to match de embedded ir receiver but when I try to ececute the program, the information that I have until now is:

The version of geany is: 1.24.1

The response of the console when I try to run the program is:

./geany_run_script.sh: 5: ./geany_run_script.sh: ./Matrix-ir_receiver: Permission denied

 ------------------
(Program exited with code: 126)
Press return to continue

after that I press Enter and the terminal closes.

As you can see, I couldn't run the executable as root user, after that I saw properties of the program and noted that the permissions was set to "fa" on group "fa", changed all to root on group root it says:

root@friendlyELEC:/matrix/demo/matrix-ir_receiver# ./Matrix-ir_receiver
bash: ./Matrix-ir_receiver: cannot execute binary file: Exec format error

when I see the properties of the executable, it doesn't say "executable" in the file type but "object code" file type.

My commands are:

Compile:

gcc -Wall -c "%f"

Build:

gcc -Wall -c -o  "%f" "%e"

before that the command Build isn't had the -c option, it was added because the build command was giving me a lot of errors of the type "don't recognize several functions related to the I/O ports"

 

In other post a user told me to apply readelf -A <name of the file> and it gave this response:

 



Attribute Section aeabi
File Attributes
   Tag_CPU_name: "7-A"
   Tag_CPU_arch: v7
   Tag_CPU__arch_profile: Application
   Tag_ARM_ISA_use: Yes
   Tag_THUMB_ISA_use: Thumb-2
   Tag_FP_arch: VFPv3-D16
   Tag_ABI_PCS_wchar_t: 4
   Tag_ABI_FP_denormal: Needed
   Tag_ABI_FP_exceptions: Needed
   Tag_ABI_FP_number_model: IEEE 754
   Tag_ABI_align_needed: 8-byte
   Tag_ABI_align_presserved: 8-byte, except leaf SP
   Tag_ABI__enum_size: int
   Tag_ABI_Hard_use: SP and DP
   Tag_ABI_VFP_args: VFP registers
   Tag_ABI_optimization_goals: aggressive Debug
   Tag_CPU_unaligned_access: v6

[/CODE]
Link to comment
Share on other sites

Problem solved, it was a linker problem and I was drowning myself in a glass of water. I needed to add the -lfahw and -lm options to the build command, or I think add the makefile to the make command in geany. I don't know how to do the last yet.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines