Join Today
+ Reply to Thread
Results 1 to 9 of 9
  1. #1

    Default Can't find library?

    Can anyone help me with this problem? I'm trying to run an application which is linked dynamically to a shared object file, my problem is that the app won't run from the phone itself, but it runs fine from telnet after running the .profile file. I mean that using my Redhat system, I compiled the library using arm and linked the app dynamically to it successfully and now I have the app binary and the .so file. The problem is that from telnet I can put the .so file somewhere where it's found and the app starts fine, but from the phone the app won't start probably cause it can't find the .so file and I just can't figure it out. Has anyone tried using a shared object (.so) with a custom app and running the app from the phone? Maybe anyone can tell me where the .so files should be put (if infact that is the problem) so that the app can be run from the phone and not telnet?

  2. #2

    Default Re: Can't find library?

    when you say "run from the phone" do you mean via a linloader script?

    to get around this problem i almost always have a corresponding .sh script to set the paths correctly and then start executing the app, this way it can be started by a .lin script (.lin scripts are started as user ezx and the default paths are only what is in /home/native/.profile)

  3. #3

    Default Re: Can't find library?

    no i mean using "linloader" itself and not using a script...by a .sh script do u mean that in the script i set the paths and also run the app from the same script? which brings me to my crucial problem: what paths need to be set for any app to use a .so file? can u maybe show me one of the scripts u used to run an app linked to a .so file?

  4. #4

    Default Re: Can't find library?

    If i had a binary called JoJo, then i'd first make a jojo.sh file that might look something like this:
    Code:
    #!/bin/bash
    #
    
    export PATH=$PATH:/diska/.system/bin:<path_to_any_additional_binaries_you_want>
    
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/diska/.system/.lib:<path_to_any_additional_libs_you_want>
    
    # Sometimes I also add the QTDIR to LD_LIBRARY_PATH
    # and set EZX_RES_FONT_PATH here to run ezx apps
    
    # (i usually cd to the desired directory in case there are any relative
    #  paths to comply with)
    cd /diska/<wherever_the_JoJo_app_is>
    ./JoJo
    then make the jojo.lin script to start the app as root:
    Code:
    #!/bin/bash
    #
    
    start-stop-daemon --start -c root -x /diska/<path_to_jojo.sh_file>/JoJo.sh &
    although you do not have to start all apps as root, i often want the app to have root access (for bluetooth utils and config for example) so i tend to have the .lin script start things as root as my default m.o.

    hope this helps...

  5. #5

    Default Re: Can't find library?

    Quote Originally Posted by rpconnect
    export LD_LIBRARY=$LD_LIBRARY_PATH:/diska/.system/.lib:<path_to_any_additional_libs_you_want>
    [/code:1:83ad0270eb]
    just to be sure about this: do u mean LD_LIBRARY_PATH=$LD_LIBRARY_PATH... or is it exactly as it is above? i'll definitely give this a try tomorrow...

  6. #6

    Default Re: Can't find library?

    @mserougi
    yeah, i made a mistake when typing, it should be LD_LIBRARY_PATH=$LD_LIBRARY_PATH:... (i've fixed it now in the listing above) sorry for the confusion

  7. #7

    Default Re: Can't find library?

    and it's definitely working! thx alot rpconnect by the way i got http working over sockets so if u ever need such functionality then let me know...

  8. #8

    Default Re: Can't find library?

    glad to know you got it working

    i'm a complete newb to http, over sockets or otherwise, but i (and maybe some others?) would love to see some example code. i have a gumstix that i connnect to via the e680 over pand and the http socket access might lead to some interesting control possibilites.

    can you share (post?) some of your example code?

  9. #9

    Default Re: Can't find library?

    sure

    following is the code to create a socket under linux, use it to send an HTTP request and then receive the response in a buffer, and if it's a file then i guess it'll just be downloaded:

    Code:
    #include <string>
    
    #include <errno.h>
    #include <sys/types.h>
    #include <sys/socket.h>
    #include <netinet/in.h>
    #include <netdb.h>
    #include <stdio.h>
    
    #define HTTP_PORT 80
    const std::string IP_ADDRESS = "xxx.xxx.xxx.xxx";
    #define BUFF_SIZE 8192
    
    int main(int argc, char** argv)
    {
    	struct sockaddr_in server;
    	struct hostent* host_info;
    	unsigned long addr;
    	int sock;
    	char buffer[BUFF_SIZE];
    	int count;
    	
    	/* create socket */
    	sock = socket( PF_INET, SOCK_STREAM, 0);
    	if (sock < 0)
    	{
    		perror( "failed to create socket");
    		exit(1);
    	}
    	
    	memset( &server, 0, sizeof (server));
    	/* convert servername to IP address */
    	host_info = gethostbyname(IP_ADDRESS.c_str());
    	if (NULL == host_info)
    	{
    		printf("unknown server");
    		exit(1);
    	}
    	memcpy( (char *)&server.sin_addr, host_info->h_addr, host_info->h_length);
    	
    	server.sin_family = AF_INET;
    	server.sin_port = htons( HTTP_PORT);
    	
    	/* connect to the server */
    	if ( connect( sock, (struct sockaddr*)&server, sizeof( server)) < 0)
    	{
    		perror( "can't connect to server");
    		exit(1);
    	}
    	
    	/* create and send the http GET request */
    	std::string tRequest = "GET /file.txt /*here we're targeting http://xxx.xxx.xxx.xxx/file.txt and we wanna download that file as an example*/HTTP/1.1 \nHost:" + IP_ADDRESS + "\n\n";
    	send( sock, tRequest.c_str(), tRequest.length(), 0);
    	
    	do
    	{
    		count = recv( sock, buffer, sizeof(buffer), 0);
    		// and we have our response stored in the buffer, safe and sound
    	}
    	while (count > 0);
    	return 0;
    }


 
+ Reply to Thread

Similar Threads

  1. 'desktop suite, wont find phone
    By sylvain in forum Symbian UIQ Symbian V7(A1000, M1000)
    Replies: 4
    Last Post: 06-02-2006, 04:27 AM
  2. Multiflex can't find my phone?
    By maxiewawa in forum E680 General Chat
    Replies: 3
    Last Post: 02-27-2006, 10:44 PM
  3. Can't find MMC card in fdisk
    By soh_terence in forum E680i General Chat
    Replies: 6
    Last Post: 08-17-2005, 01:09 AM
  4. help gba emulator help!!..did search can't find answer.
    By mofo in forum E680i General Chat
    Replies: 2
    Last Post: 07-06-2005, 08:11 PM
  5. Where can I find silvio's instruction?
    By r3my83 in forum E680 General Chat
    Replies: 9
    Last Post: 06-09-2005, 05:01 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Single Sign On provided by vBSSO

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1