Language Binding C examples

Help
2008-02-27
2013-05-01
  • Ramon Velasquez

    Ramon Velasquez - 2008-02-27

    Hi, After installing Open Obex I tested it, and everything is ok.  I can send and receive files from CLI command.

    I tried to test the Language Binding examples from http://dev.zuckschwerdt.org/openobex/wiki/ObexFtpBindings, I don`t know what I`m doing wrong but c_examples did not compile.

    This is the log,
    Debian, spanish version, but it`s mean reference to `obexftp_open' no defined

    c_example.c:(.text+0xb2): referencia a `obexftp_open' sin definir
    c_example.c:(.text+0x154): referencia a `obexftp_connect_uuid' sin definir
    c_example.c:(.text+0x18d): referencia a `obexftp_close' sin definir
    c_example.c:(.text+0x1c9): referencia a `obexftp_get_type' sin definir
    c_example.c:(.text+0x22b): referencia a `obexftp_get_type' sin definir
    c_example.c:(.text+0x264): referencia a `obexftp_disconnect' sin definir
    c_example.c:(.text+0x29d): referencia a `obexftp_close' sin definir
    collect2: ld returned 1 exit status

    This is the path where client.h is located /usr/include/obexftp/client.h

    Thanks you so much
    By the way, I tested perl client example and it works very good.

     
    • Christian W. Zuckschwerdt

      Looks like the obexftp library is not linked in (the linker is complaining about a missing reference).
      Did you use the compiler command from the example?

      gcc -Wall -lobexftp -o c_example c_example.c

      If the libobexftp.so is not in /usr/lib/ you need to add a -L/path/to/libdir before the -lobexftp

      btw: use "unset LANG" in a terminal to get english error messages.

       
    • Ramon Velasquez

      Ramon Velasquez - 2008-02-27

      Thanks Zany,

      the libobexftp.so is installed in /usr/lib/

      /tmp/ccekPExy.o: In function `main':
      c_example.c:(.text+0xb2): undefined reference to `obexftp_open'
      c_example.c:(.text+0x154): undefined reference to `obexftp_connect_uuid'
      c_example.c:(.text+0x18d): undefined reference to `obexftp_close'
      c_example.c:(.text+0x1c9): undefined reference to `obexftp_get_type'
      c_example.c:(.text+0x22b): undefined reference to `obexftp_get_type'
      c_example.c:(.text+0x264): undefined reference to `obexftp_disconnect'
      c_example.c:(.text+0x29d): undefined reference to `obexftp_close'
      collect2: ld returned 1 exit status

      I already change the terminal to english error messages.

      Thanks again.

       
      • Christian W. Zuckschwerdt

        Then this line should work:

        gcc -Wall -L/usr/lib -lobexftp -o c_example c_example.c

        Check if you got the command right and which exact obexftp libs you have installed ( ls /usr{,/local}/lib/libobexftp* )

         
    • Ramon Velasquez

      Ramon Velasquez - 2008-02-27

      Sorry I forgot to tell you, Yes I´m using the compiler command from the example.

      gcc -Wall -lobexftp -o c_example c_example.c

      Thanks

       
    • Ramon Velasquez

      Ramon Velasquez - 2008-02-27

      Now it compiled without errors. This is the error when I execute the program

      ./c_example
      ./c_example: error while loading shared libraries: libobexftp.so.0: cannot open shared object file: No such file or directory

      Look in /usr/local/lib
      directory I have this library

      voiplocal:/usr/local/lib# ls libop
      libopenobex.a         libopenobex.so        libopenobex.so.1.3.0  liboplodbcS.so        liboplodbcS.so.1.0.0
      libopenobex.la        libopenobex.so.1      liboplodbcS.la        liboplodbcS.so.1

      and in /usr/lib

      voiplocal:/usr/lib#
      voiplocal:/usr/lib# ls libopen
      libopencdk.so.8       libopenobex.a         libopenobex.so.1
      libopencdk.so.8.0.5   libopenobex.so        libopenobex.so.1.3.0

      From the beginning I installed from apt-get install command, but I removed it and reinstalled from the source code obexftp-0.22 version.
      Thanks

       
    • Ramon Velasquez

      Ramon Velasquez - 2008-02-27

      Ready Zany, I created a symbolic link and when  I execute the program.

      It says

      ./c_example
      Usage: ./c_example <bt_addr> <channel> [<filename>]

      ./c_example 00:02:EE:95:46:1A 10 /test.jpg
      ./c_example: symbol lookup error: ./c_example: undefined symbol: obexftp_open

       
    • Ramon Velasquez

      Ramon Velasquez - 2008-02-28

      Hi, Zany, thanks for your help, now is working.

      I unistalled openobex obexftp and reinstalled to /usr/lib directory.

      Thanks again

       

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks