PDA

View Full Version : List share library dependency of Qtopia application (cross-compilation configuration)



haconganh
17th May 2007, 05:50
I have an app built with cross-compilation,the following configuration in my Qt and cross-compile tool chain:
- Qt version: Qtopia-opensource-4.2.2
- Qtopia: Qtopia-core-4.2.3 (built for cross-compilation)
- Tool chain: arm-linux-gcc-3.3.2

What can I do to list of my app share library dependency with my app built with ARM?

Thanks in advance.
ANH.

wysota
17th May 2007, 11:04
Use ldd on the binary.

haconganh
17th May 2007, 11:08
I used it but I generated the message:


[root@localhost intelligent_office]# /usr/local/arm/3.4.1/arm-linux/bin/ldd intelligent_office
not a dynamic executable
[root@localhost intelligent_office]#


What can I do ?

wysota
17th May 2007, 11:31
Was it ldd for the correct platform? what does "file intelligent_office" return?

haconganh
17th May 2007, 14:03
Thank you for your soon answer,

"intelligent_office" is the Qt GUI that allows user input their correct password to access to department, and when execute, it returns a GUI for user.

When cross-compiling, I use toolchain arm-linux-gcc-3.3.2 and it completed successfully, when I usr ldd provided by arm-linux-gcc-3.3.2 it generates the error message that miss and library, I correctd the library but it returns the same message.

I used arm-linux-gcc-3.4.1 to list share library dependency and it generated the error as my previous message.

I have a few questions:
1. Can I use arm-linux-gcc-3.4.1 to ldd the file cross-compiled with arm-linux-gcc-3.3.2 ?
2. Could you please give me the correct configuration command with Qt configure for cross-compiling under arm-linux-gcc ?

I look forward to receive your soon replies.

Thanks a lot.
ANH.

wysota
17th May 2007, 14:27
ldd is not part of gcc but binutils. If compilation ended successfully, then you have the right configuration. Use "file" and "ldd" tools to check if appropriate binaries are built for the correct platform.

haconganh
17th May 2007, 18:54
I think that you wrong with comment:

ldd is not part of gcc but binutils.

I used
/usr/local/arm/3.4.1/arm-linux/bin/ldd intelligent_office

and it worked.

Each arm-linux-gcc-xxx has its own ldd, you can check that./

I used ldd in my arm-linux-gcc-xxx toolchain to list the share library dependencies, and I don't know how it doesn't work, it generated the error message as my previous message.
If you find the reason why it's not work, please show me.

Thanks in advance and I look forward to receive you reply.

ANH.

wysota
17th May 2007, 21:32
I think that you wrong with comment:

ldd is not part of gcc but binutils.

Yes, I'm wrong. It's not part of binutils but glibc. It's certainly not part of gcc though. It may sometimes be distributed with it, but it's not part of gcc.


I used
/usr/local/arm/3.4.1/arm-linux/bin/ldd intelligent_office

and it worked.
What does that prove?


Each arm-linux-gcc-xxx has its own ldd, you can check that./
Each?


I used ldd in my arm-linux-gcc-xxx toolchain to list the share library dependencies, and I don't know how it doesn't work, it generated the error message as my previous message.
If you find the reason why it's not work, please show me.
I told you. Run "file intelligent_office". It'll tell you what kind of binary intelligent_office is.

haconganh
18th May 2007, 04:24
Hi,





Each arm-linux-gcc-xxx has its own ldd, you can check that./

Each?



In my linux system, I've install two toolchains : arm-linux-gcc-3.3.2 and arm-linux-gcc-3.4.1.
In arm-linux-gcc-3.3.2 folder: I file ldd in arm/3.3.2/bin/ldd,
in arm-linux-gcc-3.4.1 folder: I file ldd in arm/3.4.1/arm-linux/bin/ldd.

This is the message received when I execute "ldd" and "file" command (I cross-compiled "intelligent_office" with toolchain arm-linux-gcc-3.3.2) :



[root@localhost intelligent_office]# /usr/local/arm/3.3.2/bin/ldd intelligent_office
/usr/local/arm/3.3.2/bin/ldd: line 130: /usr/local/arm/3.3.2/lib/ld-linux.so.2: cannot execute binary file
/usr/local/arm/3.3.2/bin/ldd: line 140: /usr/local/arm/3.3.2/lib/ld-linux.so.2: cannot execute binary file
ldd: /usr/local/arm/3.3.2/lib/ld-linux.so.2 exited with unknown exit code (126)
[root@localhost intelligent_office]#
[root@localhost intelligent_office]#
[root@localhost intelligent_office]# /usr/local/arm/3.4.1/arm-linux/bin/ldd intelligent_office
not a dynamic executable
[root@localhost intelligent_office]#
[root@localhost intelligent_office]# file intelligent_office
intelligent_office: ELF 32-bit LSB executable, ARM, version 1 (ARM), for GNU/Linux 2.0.0, dynamically linked (uses shared libs), for GNU/Linux 2.0.0, not stripped
[root@localhost intelligent_office]#


I'm sorry for inconvenient for you, you are the only one person replied me.
I really need to solve it. I look forward to get replies from you.

Thanks in advance.
ANH.

wysota
18th May 2007, 09:58
Which toolchain did you use to compile the application? 3.4.1 or 3.3.2? Because one seems to be incompatible with your binary (or is just broken) and the other can't fetch dependencies.
Anyway it looks like it'll lead us nowhere. Let's start guessing. I guess you want to deploy the application somewhere where the environment already contains linux, so we needn't worry about things like glibc or gcc. This means you have to deploy Qtopia libs and their dependencies. Let's try ldd and file once again, but this time on Qtopia libs.

haconganh
18th May 2007, 10:54
Which toolchain did you use to compile the application? 3.4.1 or 3.3.2?

I use version 3.3.2 to cross-compile.



I guess you want to deploy the application somewhere where the environment already contains linux, so we needn't worry about things like glibc or gcc.
Yes, that's right. I used EmbestKit of Mizi company, it contains Linux OS supported.


This means you have to deploy Qtopia libs and their dependencies. Let's try ldd and file once again, but this time on Qtopia libs.

I used it and it generated error message as my previous message.

You could see my same thread for more information : http://www.qtforum.org/thread.php?threadid=20669&sid=05548c1b6637054e38ef2d2b3b0e3b51

Hope you help me.

ANH.

wysota
18th May 2007, 11:38
Could you try uploading the application to the target device, access its shell and call ldd from there?