Re: [beagleboard] error while loading shared libraries BBB 4.1.12-ti-r29

2016-01-24 Thread Dean

I ran strace and it generated the following output. I am not sure exactly 
what it all means. It seems to me that some files are missing. I am unclear 
at this point in how to obtain the missing files? Are the missing files 
generated by make file or do they come from somewhere else? At any rate it 
would appear that the libEBBLibrary.so (highlighted in purple) is there and 
is accessed, but there are others that are not showing up? Any ideas?? By 
the way William thanks for the strace tip although I am unclear at this 
point about how to interpet??

execve("./LCDApp", ["./LCDApp"], [/* 19 vars */]) = 0

brk(0) = 0x4bf000

uname({sys="Linux", node="beaglebone", ...}) = 0

access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)

mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0xb6f95000

access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)

open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3

fstat64(3, {st_mode=S_IFREG|0644, st_size=26752, ...}) = 0

mmap2(NULL, 26752, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb6f8e000

close(3) = 0

access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)

open("/lib/arm-linux-gnueabihf/tls/v7l/neon/vfp/libEBBLibrary.so", 
O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)

stat64("/lib/arm-linux-gnueabihf/tls/v7l/neon/vfp", 0xbea01370) = -1 ENOENT 
(No such file or directory)

open("/lib/arm-linux-gnueabihf/tls/v7l/neon/libEBBLibrary.so", 
O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)

open("/lib/arm-linux-gnueabihf/libEBBLibrary.so", O_RDONLY|O_CLOEXEC) = 3

read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0`m\0\0004\0\0\0"..., 
512) = 512

lseek(3, 95252, SEEK_SET) = 95252

read(3, 
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 
1200) = 1200

lseek(3, 63425, SEEK_SET) = 63425

read(3, "A2\0\0\0aeabi\0\1(\0\0\0\0057-A\0\6\n\7A\10\1\t\2\n\4\22"..., 51) 
= 51

fstat64(3, {st_mode=S_IFREG|0755, st_size=96452, ...}) = 0

mmap2(NULL, 128964, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0xb6f5

mprotect(0xb6f5f000, 65536, PROT_NONE) = 0

mmap2(0xb6f6f000, 4096, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xf000) = 0xb6f6f000

close(3) = 0

access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)

open("/usr/lib/arm-linux-gnueabihf/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = 3

read(3, "\177ELF\1\1\1\3\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0 n\4\0004\0\0\0"..., 
512) = 512

open("/lib/arm-linux-gnueabihf/libEBBLibrary.so", O_RDONLY|O_CLOEXEC) = 3

read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0`m\0\0004\0\0\0"..., 
512) = 512

lseek(3, 95252, SEEK_SET) = 95252

read(3, 
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 
1200) = 1200

lseek(3, 63425, SEEK_SET) = 63425

read(3, "A2\0\0\0aeabi\0\1(\0\0\0\0057-A\0\6\n\7A\10\1\t\2\n\4\22"..., 51) 
= 51

fstat64(3, {st_mode=S_IFREG|0755, st_size=96452, ...}) = 0

mmap2(NULL, 128964, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0xb6f5

mprotect(0xb6f5f000, 65536, PROT_NONE) = 0

mmap2(0xb6f6f000, 4096, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xf000) = 0xb6f6f000

close(3) = 0

access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)

open("/usr/lib/arm-linux-gnueabihf/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = 3

read(3, "\177ELF\1\1\1\3\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0 n\4\0004\0\0\0"..., 
512) = 512

lseek(3, 100684, SEEK_SET) = 100684

read(3, 
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 
1520) = 1520

lseek(3, 65940, SEEK_SET) = 65940

read(3, "A4\0\0\0aeabi\0\1*\0\0\0\0057-A\0\6\n\7A\10\1\t\2\n\4\22"..., 53) 
= 53

fstat64(3, {st_mode=S_IFREG|0755, st_size=102204, ...}) = 0

mmap2(NULL, 139836, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0xb6ceb000

mprotect(0xb6cfb000, 61440, PROT_NONE) = 0

mmap2(0xb6d0a000, 8192, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xf000) = 0xb6d0a000

mmap2(0xb6d0c000, 4668, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb6d0c000

close(3) = 0

mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0xb6f8c000

mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0xb6f8b000

set_tls(0xb6f8b4c0, 0xb6f98050, 0xb6f8bbb8, 0xb6f8b4c0, 0xb6f98050) = 0

mprotect(0xb6df6000, 8192, PROT_READ) = 0

mprotect(0xb6d0a000, 4096, PROT_READ) = 0

mprotect(0xb6e97000, 4096, PROT_READ) = 0

mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0xb6f8a000

mprotect(0xb6f44000, 16384, PROT_READ) = 0

mprotect(0xb6f97000, 4096, PROT_READ) = 0

munmap(0xb6f8e000, 26752) = 0

set_tid_address(0xb6f8b068) = 650

set_robust_list(0xb6f8b070, 12) = 0

rt_sigaction(SIGRTMIN, {0xb6cefd9d, [], SA_RESTORER|SA_SIGINFO, 
0xb6d34ae1}, NULL, 8) = 0

rt_sigaction(SIGRT_1, {0xb6cefcbd, [], SA_RESTORER|SA_RESTART|SA_SIGINFO, 
0xb6d34ae1}, 

Re: [beagleboard] error while loading shared libraries BBB 4.1.12-ti-r29

2016-01-24 Thread Dean
I decided to close this post and repost as an strace question as it is more 
to the point. Thanks William for directing my attention to strace.


-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [beagleboard] error while loading shared libraries BBB 4.1.12-ti-r29

2016-01-19 Thread William Hermans
>
> *Why do you think it's wrong? The point of LD_LIBRARY_PATH is to*
> * collect all the places you might have shared libs, whether system or*
> * application or private.*
>

Because it's wrong. *LD_LIBRARY_PATH *is executation time, not link time.
Link time is *-L /path/to/lib*( gcc / g++ )

http://unix.stackexchange.com/questions/168340/where-is-ld-library-path-how-do-i-set-the-ld-library-path-env-variable

On Mon, Jan 18, 2016 at 9:00 PM, Dean  wrote:

> All said something else is going on here. libEBBLibrary.so is definitely
> there yet it does not take. I should mention that namespace std is being
> used to make updates on code easier. See code listed below.
>
>
> root@beaglebone:~/exploringBB/chp09/LCDcharacter# export
> LD_LIBRARY_PATH="~/exploringBB/library/libEBBLibrary.so:$LD_LIBRARY_PATH"
>
> root@beaglebone:~/exploringBB/chp09/LCDcharacter# ./LCDApp
>
> ./LCDApp: error while loading shared libraries: libEBBLibrary.so: cannot
> open shared object file: No such file or directory
>
> root@beaglebone:~/exploringBB/chp09/LCDcharacter# cd ../../library
>
> root@beaglebone:~/exploringBB/library# ls
>
> CMakeLists.txt README build bus display docs example gpio libEBBLibrary.a
> libEBBLibrary.so motor network sensor
>
> root@beaglebone:~/exploringBB/library#
>
>
> Here is the code ...
>
>
> #include 
> #include 
> #include 
> #include "display/LCDCharacterDisplay.h"
> using namespace std;
> using namespace exploringBB;
>
> int main(){
>cout << "Starting EBB LCD Character Display Example" << endl;
>SPIDevice *busDevice = new SPIDevice(2,0); //Using second SPI bus (both
> loaded)
>busDevice->setSpeed(100);  // Have access to SPI Device object
>ostringstream s;   // Using this to combine text and
> int data
>LCDCharacterDisplay display(busDevice, 16, 2); // Construct 16x2 LCD
> Display
>display.clear();   // Clear the character LCD module
>display.home();// Move the cursor to the (0,0)
> position
>display.print("EBB by D. Molloy"); // String to display on the first row
>for(int x=0; x<=1; x++){   // Do this 10,000 times
>   s.str("");  // clear the ostringstream object s
>   display.setCursorPosition(1,3); // move the cursor to second row
>   s << "X=" << x; // construct a string that has an
> int value
>   display.print(s.str()); // print the string X=*** on the LCD
> module
>}
>cout << "End of EBB LCD Character Display Example" << endl;
> }
>
>
> --
> For more options, visit http://beagleboard.org/discuss
> ---
> You received this message because you are subscribed to the Google Groups
> "BeagleBoard" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to beagleboard+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [beagleboard] error while loading shared libraries BBB 4.1.12-ti-r29

2016-01-19 Thread Dean

I now know what is going on, but I'll be damned if I know how to resolve 
it. Prior to adding #include  the usleep function would not take. 
Hopefully a coding guru might be able to help me out on this one as I am 
novice when it comes to coding.

http://stackoverflow.com/questions/34184743/kernel-compiles-but-wont-link-with-unistd-h-reference


-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [beagleboard] error while loading shared libraries BBB 4.1.12-ti-r29

2016-01-19 Thread Dean

It turns out that #include is not required. I was using the 
usleep function earlier. Regardless the end result is the same. No go. 
Everything would indicate that although it compiles and builds it fails to 
come through on the link. Back to reading.

root@beaglebone:~/exploringBB/chp09/LCDcharacter# ls
LCDAppLCDApp.cpp  build  build_static
root@beaglebone:~/exploringBB/chp09/LCDcharacter# sudo sh -c "echo 
BB-SPIDEV1 > $SLOTS"
root@beaglebone:~/exploringBB/chp09/LCDcharacter# cat $SLOTS|grep SPI
 4: P-O-L-   0 Override Board Name,00A0,Override Manuf,BB-SPIDEV1
root@beaglebone:~/exploringBB/chp09/LCDcharacter# ./build
root@beaglebone:~/exploringBB/chp09/LCDcharacter# ./LCDApp
./LCDApp: error while loading shared libraries: libEBBLibrary.so: cannot 
open shared object file: No such file or directory
root@beaglebone:~/exploringBB/chp09/LCDcharacter# 


>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [beagleboard] error while loading shared libraries BBB 4.1.12-ti-r29

2016-01-18 Thread Mike

On 01/18/2016 08:00 PM, Dean wrote:

*My BBB setup is as follows ...*
Linux beaglebone 4.1.12-ti-r29 #1 SMP PREEMPT Mon Nov 9 22:46:19 UTC 
2015 armv7l GNU/Linux

BeagleBoard.org Debian Image 2015-11-12

*For whatever reason I cannot access a library (i.e. libEBBLibrary.so) 
and I am not sure what I am missing. Might someone offer a suggestion 
on where I am going wrong or what I can do to rectify it?? Thanks in 
advance who those that reply.*
root@beaglebone:~/exploringBB/chp09/LCDcharacter# sudo sh -c "echo 
BB-SPIDEV1 > $SLOTS"


root@beaglebone:~/exploringBB/chp09/LCDcharacter# cat $SLOTS|grep SPI

4: P-O-L- 0 Override Board Name,00A0,Override Manuf,BB-SPIDEV1



root@beaglebone:~/exploringBB/chp09/LCDcharacter# ./build

root@beaglebone:~/exploringBB/chp09/LCDcharacter# ./LCDApp

./LCDApp: error while loading shared libraries: libEBBLibrary.so: 
cannot open shared object file: No such file or directory



root@beaglebone:~/exploringBB/chp09/LCDcharacter# g++ LCDApp.cpp 
../../library/libEBBLibrary.so -o LCDApp -I "../../library"


root@beaglebone:~/exploringBB/chp09/LCDcharacter# ./LCDApp

./LCDApp: error while loading shared libraries: libEBBLibrary.so: 
cannot open shared object file: No such file or directory



root@beaglebone:~/exploringBB/chp09/LCDcharacter# echo $PATH

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

root@beaglebone:~/exploringBB/chp09/LCDcharacter# export 
LD_LIBRARY_PATH="../../library/libEBBLibrary.so:$LD_LIBRARY_PATH"

root@beaglebone:~/exploringBB/chp09/LCDcharacter# ./LCDApp
./LCDApp: error while loading shared libraries: libEBBLibrary.so: 
cannot open shared object file: No such file or directory




I don't believe that LD_LIBRARY_PATH is searched in the manner you're 
thinking in the last lines.  If memory serves you need to specify the 
full path from / i.e. absolute not relative.


Mike

--
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [beagleboard] error while loading shared libraries BBB 4.1.12-ti-r29

2016-01-18 Thread Robert Nelson
On Mon, Jan 18, 2016 at 7:00 PM, Dean  wrote:
> My BBB setup is as follows ...
> Linux beaglebone 4.1.12-ti-r29 #1 SMP PREEMPT Mon Nov 9 22:46:19 UTC 2015
> armv7l GNU/Linux
> BeagleBoard.org Debian Image 2015-11-12
>
> For whatever reason I cannot access a library (i.e. libEBBLibrary.so) and I
> am not sure what I am missing. Might someone offer a suggestion on where I
> am going wrong or what I can do to rectify it?? Thanks in advance who those
> that reply.
> root@beaglebone:~/exploringBB/chp09/LCDcharacter# sudo sh -c "echo
> BB-SPIDEV1 > $SLOTS"
>
> root@beaglebone:~/exploringBB/chp09/LCDcharacter# cat $SLOTS|grep SPI
>
> 4: P-O-L- 0 Override Board Name,00A0,Override Manuf,BB-SPIDEV1
>
>
>
> root@beaglebone:~/exploringBB/chp09/LCDcharacter# ./build
>
> root@beaglebone:~/exploringBB/chp09/LCDcharacter# ./LCDApp
>
> ./LCDApp: error while loading shared libraries: libEBBLibrary.so: cannot
> open shared object file: No such file or directory
>
>
> root@beaglebone:~/exploringBB/chp09/LCDcharacter# g++ LCDApp.cpp
> ../../library/libEBBLibrary.so -o LCDApp -I "../../library"
>
> root@beaglebone:~/exploringBB/chp09/LCDcharacter# ./LCDApp
>
> ./LCDApp: error while loading shared libraries: libEBBLibrary.so: cannot
> open shared object file: No such file or directory
>
>
> root@beaglebone:~/exploringBB/chp09/LCDcharacter# echo $PATH
>
> /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
>
> root@beaglebone:~/exploringBB/chp09/LCDcharacter# export
> LD_LIBRARY_PATH="../../library/libEBBLibrary.so:$LD_LIBRARY_PATH"
> root@beaglebone:~/exploringBB/chp09/LCDcharacter# ./LCDApp
> ./LCDApp: error while loading shared libraries: libEBBLibrary.so: cannot
> open shared object file: No such file or directory

Well "No such file or directory"..

and it's not available:

https://packages.debian.org/search?searchon=contents=libEBBLibrary.so=exactfilename=stable=any

So, you better check where you built "LCDApp", and fix your error..

Regards,


-- 
Robert Nelson
https://rcn-ee.com/

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[beagleboard] error while loading shared libraries BBB 4.1.12-ti-r29

2016-01-18 Thread Dean
*My BBB setup is as follows ...* 
Linux beaglebone 4.1.12-ti-r29 #1 SMP PREEMPT Mon Nov 9 22:46:19 UTC 2015 
armv7l GNU/Linux
BeagleBoard.org Debian Image 2015-11-12

*For whatever reason I cannot access a library (i.e. libEBBLibrary.so) and 
I am not sure what I am missing. Might someone offer a suggestion on where 
I am going wrong or what I can do to rectify it?? Thanks in advance who 
those that reply.*
root@beaglebone:~/exploringBB/chp09/LCDcharacter# sudo sh -c "echo 
BB-SPIDEV1 > $SLOTS" 

root@beaglebone:~/exploringBB/chp09/LCDcharacter# cat $SLOTS|grep SPI

4: P-O-L- 0 Override Board Name,00A0,Override Manuf,BB-SPIDEV1



root@beaglebone:~/exploringBB/chp09/LCDcharacter# ./build 

root@beaglebone:~/exploringBB/chp09/LCDcharacter# ./LCDApp

./LCDApp: error while loading shared libraries: libEBBLibrary.so: cannot 
open shared object file: No such file or directory


root@beaglebone:~/exploringBB/chp09/LCDcharacter# g++ LCDApp.cpp 
../../library/libEBBLibrary.so -o LCDApp -I "../../library"

root@beaglebone:~/exploringBB/chp09/LCDcharacter# ./LCDApp

./LCDApp: error while loading shared libraries: libEBBLibrary.so: cannot 
open shared object file: No such file or directory


root@beaglebone:~/exploringBB/chp09/LCDcharacter# echo $PATH

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

root@beaglebone:~/exploringBB/chp09/LCDcharacter# export 
LD_LIBRARY_PATH="../../library/libEBBLibrary.so:$LD_LIBRARY_PATH"
root@beaglebone:~/exploringBB/chp09/LCDcharacter# ./LCDApp 
./LCDApp: error while loading shared libraries: libEBBLibrary.so: cannot 
open shared object file: No such file or directory


-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [beagleboard] error while loading shared libraries BBB 4.1.12-ti-r29

2016-01-18 Thread Mike

On 01/18/2016 09:57 PM, William Hermans wrote:
Also, using LD_LIBRARY_PATH in this manner is just flat out wrong. If 
you have a shared library file, put it in the correct directory to 
begin with.


On Mon, Jan 18, 2016 at 6:24 PM, Mike > wrote:




root@beaglebone:~/exploringBB/chp09/LCDcharacter# export 
LD_LIBRARY_PATH="../../library/libEBBLibrary.so:$LD_LIBRARY_PATH"

root@beaglebone:~/exploringBB/chp09/LCDcharacter# ./LCDApp
./LCDApp: error while loading shared libraries: libEBBLibrary.so: 
cannot open shared object file: No such file or directory



I don't believe that LD_LIBRARY_PATH is searched in the manner
you're thinking in the last lines.  If memory serves you need to
specify the full path from / i.e. absolute not relative.

Mike

Exactly my thoughts William.  As a sys admin I've seen way to much LD_* 
abuse not just LD_LIBRARY_PATH...  It's really not that hard on Linux, 
but if following other bad examples, well what can one say? Somewhere 
out there is a great reference on GCC, G++ and using libraries.  The 
title or link eludes me now.  Was from the UK somewhere I believe.


Mike

--
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [beagleboard] error while loading shared libraries BBB 4.1.12-ti-r29

2016-01-18 Thread Dean
All said something else is going on here. libEBBLibrary.so is definitely 
there yet it does not take. I should mention that namespace std is being 
used to make updates on code easier. See code listed below. 


root@beaglebone:~/exploringBB/chp09/LCDcharacter# export 
LD_LIBRARY_PATH="~/exploringBB/library/libEBBLibrary.so:$LD_LIBRARY_PATH"

root@beaglebone:~/exploringBB/chp09/LCDcharacter# ./LCDApp

./LCDApp: error while loading shared libraries: libEBBLibrary.so: cannot 
open shared object file: No such file or directory

root@beaglebone:~/exploringBB/chp09/LCDcharacter# cd ../../library

root@beaglebone:~/exploringBB/library# ls

CMakeLists.txt README build bus display docs example gpio libEBBLibrary.a 
libEBBLibrary.so motor network sensor

root@beaglebone:~/exploringBB/library# 


Here is the code ...


#include 
#include 
#include 
#include "display/LCDCharacterDisplay.h"
using namespace std;
using namespace exploringBB;

int main(){
   cout << "Starting EBB LCD Character Display Example" << endl;
   SPIDevice *busDevice = new SPIDevice(2,0); //Using second SPI bus (both 
loaded)
   busDevice->setSpeed(100);  // Have access to SPI Device object
   ostringstream s;   // Using this to combine text and int 
data
   LCDCharacterDisplay display(busDevice, 16, 2); // Construct 16x2 LCD 
Display
   display.clear();   // Clear the character LCD module
   display.home();// Move the cursor to the (0,0) 
position
   display.print("EBB by D. Molloy"); // String to display on the first row
   for(int x=0; x<=1; x++){   // Do this 10,000 times
  s.str("");  // clear the ostringstream object s
  display.setCursorPosition(1,3); // move the cursor to second row
  s << "X=" << x; // construct a string that has an int 
value
  display.print(s.str()); // print the string X=*** on the LCD 
module
   }
   cout << "End of EBB LCD Character Display Example" << endl;
}


-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [beagleboard] error while loading shared libraries BBB 4.1.12-ti-r29

2016-01-18 Thread Mike

On 01/18/2016 10:14 PM, Przemek Klosowski wrote:

On Mon, Jan 18, 2016 at 9:57 PM, William Hermans  wrote:

Also, using LD_LIBRARY_PATH in this manner is just flat out wrong. If you
have a shared library file, put it in the correct directory to begin with.

On Mon, Jan 18, 2016 at 6:24 PM, Mike  wrote:

  export LD_LIBRARY_PATH="../../library/libEBBLibrary.so:$LD_LIBRARY_PATH"

Why do you think it's wrong? The point of LD_LIBRARY_PATH is to
collect all the places you might have shared libs, whether system or
application or private.
There's even another trick, using LD_PRELOAD to force certain library
into the image to override symbols from e.g. system libraries; this
works great for debugging.

BTW, if you need to add a library file or directory to a single
application, I'd recommend just setting the environment for this
single command rather than exporting it for general use:

LD_PRELOAD=/home/user/proj/lib/libdebug.so  LCDApp

I'm not going debate the use of LD_LIBRARY_PATH, as an admin all I'll 
say is it's terribly abused and a security nightmare if not used properly.


Your example may well solve his issue and is a workable solution. Noting 
the the path is absolute and not relative...


Mike

--
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.