how to cross compile shared object using gcc(g++)?
up vote
0
down vote
favorite
Im trying to create a .so named libfunc.so
, which compile from func.cpp
.
I've been done steps below:arm-none-linux-gnueabi-g++ -c -fPIC func.cpp
arm-none-linux-gnueabi-g++ -shared func.o -o libfunc.so
I get some errors when I try to compile executable:arm-none-linux-gnueabi-gcc -L/usr/local/lib/func test.cpp -o test -lfunc
lib/gcc/arm-none-linux-gnueabi/4.8.3/../../../../arm-none-linux-gnueabi/bin/ld: warning: library search path "/usr/local/lib/func" is unsafe for cross-compilation
/opt/gnutools/arm-2014.05/bin/../lib/gcc/arm-none-linux-gnueabi/4.8.3/../../../../arm-none-linux-gnueabi/bin/ld: /tmp/ccazeIay.o: undefined reference to symbol '_ZNSaIcEC1Ev@@GLIBCXX_3.4'
/opt/gnutools/arm-2014.05/bin/../arm-none-linux-gnueabi/libc/usr/lib/libstdc++.so.6: error adding symbols: DSO missing from command line
what cause those errors and how can I fix it?
linux gcc g++
add a comment |
up vote
0
down vote
favorite
Im trying to create a .so named libfunc.so
, which compile from func.cpp
.
I've been done steps below:arm-none-linux-gnueabi-g++ -c -fPIC func.cpp
arm-none-linux-gnueabi-g++ -shared func.o -o libfunc.so
I get some errors when I try to compile executable:arm-none-linux-gnueabi-gcc -L/usr/local/lib/func test.cpp -o test -lfunc
lib/gcc/arm-none-linux-gnueabi/4.8.3/../../../../arm-none-linux-gnueabi/bin/ld: warning: library search path "/usr/local/lib/func" is unsafe for cross-compilation
/opt/gnutools/arm-2014.05/bin/../lib/gcc/arm-none-linux-gnueabi/4.8.3/../../../../arm-none-linux-gnueabi/bin/ld: /tmp/ccazeIay.o: undefined reference to symbol '_ZNSaIcEC1Ev@@GLIBCXX_3.4'
/opt/gnutools/arm-2014.05/bin/../arm-none-linux-gnueabi/libc/usr/lib/libstdc++.so.6: error adding symbols: DSO missing from command line
what cause those errors and how can I fix it?
linux gcc g++
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Im trying to create a .so named libfunc.so
, which compile from func.cpp
.
I've been done steps below:arm-none-linux-gnueabi-g++ -c -fPIC func.cpp
arm-none-linux-gnueabi-g++ -shared func.o -o libfunc.so
I get some errors when I try to compile executable:arm-none-linux-gnueabi-gcc -L/usr/local/lib/func test.cpp -o test -lfunc
lib/gcc/arm-none-linux-gnueabi/4.8.3/../../../../arm-none-linux-gnueabi/bin/ld: warning: library search path "/usr/local/lib/func" is unsafe for cross-compilation
/opt/gnutools/arm-2014.05/bin/../lib/gcc/arm-none-linux-gnueabi/4.8.3/../../../../arm-none-linux-gnueabi/bin/ld: /tmp/ccazeIay.o: undefined reference to symbol '_ZNSaIcEC1Ev@@GLIBCXX_3.4'
/opt/gnutools/arm-2014.05/bin/../arm-none-linux-gnueabi/libc/usr/lib/libstdc++.so.6: error adding symbols: DSO missing from command line
what cause those errors and how can I fix it?
linux gcc g++
Im trying to create a .so named libfunc.so
, which compile from func.cpp
.
I've been done steps below:arm-none-linux-gnueabi-g++ -c -fPIC func.cpp
arm-none-linux-gnueabi-g++ -shared func.o -o libfunc.so
I get some errors when I try to compile executable:arm-none-linux-gnueabi-gcc -L/usr/local/lib/func test.cpp -o test -lfunc
lib/gcc/arm-none-linux-gnueabi/4.8.3/../../../../arm-none-linux-gnueabi/bin/ld: warning: library search path "/usr/local/lib/func" is unsafe for cross-compilation
/opt/gnutools/arm-2014.05/bin/../lib/gcc/arm-none-linux-gnueabi/4.8.3/../../../../arm-none-linux-gnueabi/bin/ld: /tmp/ccazeIay.o: undefined reference to symbol '_ZNSaIcEC1Ev@@GLIBCXX_3.4'
/opt/gnutools/arm-2014.05/bin/../arm-none-linux-gnueabi/libc/usr/lib/libstdc++.so.6: error adding symbols: DSO missing from command line
what cause those errors and how can I fix it?
linux gcc g++
linux gcc g++
asked 4 hours ago
umbreLLaJYL
788
788
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53371476%2fhow-to-cross-compile-shared-object-using-gccg%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown