CANNOT LINK EXECUTABLE

2,579 views
Skip to first unread message

Ngo Van Luyen

unread,
Jul 30, 2010, 8:00:35 AM7/30/10
to andro...@googlegroups.com
Hi all,

I copied my app and a shared lib to( Emulator)/data/

But when launching my app on emulator (and via adb) I got a message :


link_image[1995]: failed to link /data/mp4client
CANNOT LINK EXECUTABLE


What is the error?

Thanks,


--
Hello Android!
http://androidcore.com/

David Turner

unread,
Jul 30, 2010, 1:51:43 PM7/30/10
to andro...@googlegroups.com
On Fri, Jul 30, 2010 at 5:00 AM, Ngo Van Luyen <nvlu...@gmail.com> wrote:
Hi all,

I copied my app and a shared lib to( Emulator)/data/

did you copy that manually ? what did you do exactly to generate the shared lib, the application and install it on the emulator ?
 
But when launching my app on emulator (and via adb) I got a message :

how do you launch it exactly (e.g. through "am" ?) 

link_image[1995]: failed to link /data/mp4client
CANNOT LINK EXECUTABLE

it looks like "mp4client" is not a valid executable. I suspect you didn't generate it with the NDK, and used a broken cross-compiler instead.


What is the error?

Thanks,


--
Hello Android!
http://androidcore.com/

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.

Ngo Van Luyen

unread,
Jul 30, 2010, 2:00:02 PM7/30/10
to andro...@googlegroups.com
Hi,

I'm using official NDK to build them.

I have 2 project, one for lib and one for app. Everything was built ok, (at least there is no error). Both lib and app was built using NDK, they are c/c++ code.

I used adb push to copy files to /data/

Then use adb shell /data/mp4client to execute it. I tried also just simply type /data/mp4client on emulator's terminal.

thanks,



2010/7/30 David Turner <di...@android.com>

David Turner

unread,
Jul 30, 2010, 2:44:25 PM7/30/10
to andro...@googlegroups.com
On Fri, Jul 30, 2010 at 11:00 AM, Ngo Van Luyen <nvlu...@gmail.com> wrote:
Hi,

I'm using official NDK to build them.

I have 2 project, one for lib and one for app. Everything was built ok, (at least there is no error). Both lib and app was built using NDK, they are c/c++ code.

ok, you're not building an application, just a standalone executable, that's very different.
 
I used adb push to copy files to /data/

ok, did you change its mode to executable before that ? i.e: adb shell chmod 0755 /data/mp4client

David Turner

unread,
Jul 30, 2010, 2:45:33 PM7/30/10
to andro...@googlegroups.com
On Fri, Jul 30, 2010 at 11:00 AM, Ngo Van Luyen <nvlu...@gmail.com> wrote:
Hi,

I'm using official NDK to build them.

I have 2 project, one for lib and one for app. Everything was built ok, (at least there is no error). Both lib and app was built using NDK, they are c/c++ code.

I used adb push to copy files to /data/


let me guess, you're copying both a shared library and an executable, and you want the executable to dynamically link to the shared library  when you start it ?
that will probably not work unless you set LD_LIBRARY_PATH to include /data before that.

Ngo Van Luyen

unread,
Jul 30, 2010, 3:18:36 PM7/30/10
to andro...@googlegroups.com
You are right, I used adb push to copy both of them. I will try with your suggestion.

Thanks,
Reply all
Reply to author
Forward
0 new messages