Click here to Skip to main content
14,269,409 members

Linux Programming

 
GeneralRe: Change package architecture - no go Pin
k505424-Mar-19 14:38
memberk505424-Mar-19 14:38 
GeneralRe: Change package architecture - no go Pin
k505424-Mar-19 9:49
memberk505424-Mar-19 9:49 
GeneralRe: Change package architecture - no go Pin
Vaclav_25-Mar-19 6:12
memberVaclav_25-Mar-19 6:12 
GeneralRe: Change package architecture - no go Pin
k505425-Mar-19 7:30
memberk505425-Mar-19 7:30 
GeneralRe: linker error file not recognized: File format not recognized Pin
Member 1419936827-Mar-19 1:12
memberMember 1419936827-Mar-19 1:12 
GeneralRe: linker error file not recognized: File format not recognized Pin
Vaclav_27-Mar-19 3:15
memberVaclav_27-Mar-19 3:15 
GeneralRe: linker error file not recognized: File format not recognized Pin
Richard Deeming27-Mar-19 5:37
mveRichard Deeming27-Mar-19 5:37 
AnswerRe: SOLVED ??? linker error file not recognized: File format not recognized Pin
k505426-Mar-19 8:15
memberk505426-Mar-19 8:15 
something to consider ...
2019-03-26 11:35:24 ~/tmp $ #Starting from minimal Debian install ... 
2019-03-26 11:35:41 ~/tmp $ #No compiler ...
2019-03-26 11:36:06 ~/tmp $ gcc -v
-bash: gcc: command not found
2019-03-26 11:36:24 ~/tmp $ # no cross-compiler ...
2019-03-26 11:36:35 ~/tmp $ arm-linux-gnueabihf-gcc -v
-bash: arm-linux-gnueabihf-gcc: command not found
2019-03-26 11:36:55 ~/tmp $ #lets install cross-compiler
2019-03-26 11:37:12 ~/tmp $ sudo apt install -q -y gcc-arm-linux-gnueabihf
Reading package lists...
Building dependency tree...
Reading state information...
[ ... output snipped ... ]
Setting up gcc-6-arm-linux-gnueabihf (6.3.0-18cross1) ...
Setting up gcc-arm-linux-gnueabihf (4:6.3.0-4) ...
Processing triggers for libc-bin (2.24-11+deb9u4) ...
2019-03-26 11:39:53 ~/tmp $ # now we can cross-compile ...
2019-03-26 11:41:02 ~/tmp $ arm-linux-gnueabihf-gcc -Wall -Wextra hello.c -o hello_arm 
2019-03-26 11:41:10 ~/tmp $ #that won't run on this system ...
2019-03-26 11:41:26 ~/tmp $ ./hello_arm 
-bash: ./hello_arm: cannot execute binary file: Exec format error
2019-03-26 11:41:29 ~/tmp $ #what about the pi
2019-03-26 11:42:32 ~/tmp $ scp hello_arm pi3:
hello_arm                                                                                         100% 8376     3.0MB/s   00:00<br />
2019-03-26 11:42:41 ~/tmp $ ssh pi3
Linux pi3 4.14.98-v7+ #1200 SMP Tue Feb 12 20:27:48 GMT 2019 armv7l
Last login: Tue Mar 26 11:42:12 2019 from 192.168.235.51
k5054@pi3:~ $ ls
hello_arm
k5054@pi3:~ $ ./hello_arm
Hello from a pi!
k5054@pi3:~ $ logout
Connection to pi3 closed.
2019-03-26 11:42:57 ~/tmp $ #so far so good
2019-03-26 11:43:08 ~/tmp $ # now lets add armhf as foreign arch 
2019-03-26 11:43:28 ~/tmp $ sudo dpkg --add-architecture armhf
2019-03-26 11:44:05 ~/tmp $ dpkg --print-foreign-architectures
armhf
2019-03-26 11:44:17 ~/tmp $ #update apt ...
2019-03-26 11:44:34 ~/tmp $ sudo apt-get -q update
[ ... output snipped ...]
Reading package lists...
2019-03-26 11:44:54 ~/tmp $ # now add libbluetooth for armhf
2019-03-26 11:45:22 ~/tmp $ sudo apt install libbluetooth-dev:armhf
Reading package lists... Done
Building dependency tree<br />
Reading state information... Done
[... output snipped ...]
Setting up libbluetooth3:armhf (5.43-2+deb9u1) ...
Setting up libbluetooth-dev:armhf (5.43-2+deb9u1) ...
Processing triggers for libc-bin (2.24-11+deb9u4) ...
2019-03-26 11:45:56 ~/tmp $ #Now, lets compile that test program you posted some time back ...
2019-03-26 11:46:40 ~/tmp $ arm-linux-gnueabihf-gcc vscan.c -o vscan -lbluetooth -o vscan
2019-03-26 11:46:51 ~/tmp $ file vscan
vscan: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, BuildID[sha1]=6f7c63c8962a94e135b127cf3cf5033d512f6bb6, not stripped
2019-03-26 11:46:59 ~/tmp $ #that looks good ... lets test it on the pi
2019-03-26 11:47:23 ~/tmp $ scp vscan pi3:
vscan                                                                                             100% 8696     3.0MB/s   00:00<br />
2019-03-26 11:47:33 ~/tmp $ ssh pi3
Linux pi3 4.14.98-v7+ #1200 SMP Tue Feb 12 20:27:48 GMT 2019 armv7l
Last login: Tue Mar 26 11:42:47 2019 from 192.168.235.205
k5054@pi3:~ $ ls
hello_arm  vscan
k5054@pi3:~ $ ./vscan 
Basic bluetooth app BLUEZ_LINUX 
k5054@pi3:~ $ logout
Connection to pi3 closed.
2019-03-26 11:48:22 ~/tmp $ # Ta Da ... total time about 15 minutes ...
2019-03-26 11:49:20 ~/tmp $

GeneralRe: SOLVED ??? linker error file not recognized: File format not recognized Pin
Vaclav_26-Mar-19 9:44
memberVaclav_26-Mar-19 9:44 
GeneralRe: SOLVED ??? linker error file not recognized: File format not recognized Pin
k505426-Mar-19 11:41
memberk505426-Mar-19 11:41 
GeneralRe: SOLVED ??? linker error file not recognized: File format not recognized Pin
Vaclav_26-Mar-19 16:24
memberVaclav_26-Mar-19 16:24 
GeneralUsing virtualbox to load Debian OS Pin
Vaclav_27-Mar-19 3:23
memberVaclav_27-Mar-19 3:23 
GeneralRe: Using virtualbox to load Debian OS Pin
k505427-Mar-19 5:05
memberk505427-Mar-19 5:05 
GeneralRe: Using virtualbox to load Debian OS Pin
Vaclav_27-Mar-19 5:32
memberVaclav_27-Mar-19 5:32 
GeneralRe: Using virtualbox to load Debian OS Pin
k505427-Mar-19 6:25
memberk505427-Mar-19 6:25 
GeneralRe: Using virtualbox to load Debian OS Pin
Vaclav_27-Mar-19 10:54
memberVaclav_27-Mar-19 10:54 
QuestionBlueZ part 3 - English translation please Pin
Vaclav_9-Mar-19 4:14
memberVaclav_9-Mar-19 4:14 
GeneralRe: BlueZ part 3 - English translation please Pin
k50549-Mar-19 6:59
memberk50549-Mar-19 6:59 
AnswerRe: BlueZ part 3 - English translation please Pin
Richard MacCutchan9-Mar-19 21:46
protectorRichard MacCutchan9-Mar-19 21:46 
GeneralRe: BlueZ part 3 - English translation please Pin
Gerry Schmitz10-Mar-19 5:26
mveGerry Schmitz10-Mar-19 5:26 
QuestionBlueZ part 2 - which "bluetooth" library is actually used / linked to? Pin
Vaclav_9-Mar-19 3:46
memberVaclav_9-Mar-19 3:46 
AnswerRe: BlueZ part 2 - which "bluetooth" library is actually used / linked to? Pin
Richard MacCutchan9-Mar-19 4:07
protectorRichard MacCutchan9-Mar-19 4:07 
GeneralRe: BlueZ part 2 - which "bluetooth" library is actually used / linked to? Pin
Vaclav_9-Mar-19 4:19
memberVaclav_9-Mar-19 4:19 
GeneralRe: BlueZ part 2 - which "bluetooth" library is actually used / linked to? Pin
k50549-Mar-19 4:27
memberk50549-Mar-19 4:27 
AnswerRe: BlueZ part 2 - which "bluetooth" library is actually used / linked to? Pin
k50549-Mar-19 4:18
memberk50549-Mar-19 4:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.