Kylix [Linker Error] Unresolved external 'function name' referenced

Hello Friends,

I m facing problem while running Kylix Application
Following are the details:

I had downloaded Speex (Audio Codec) Library and installed it on my Linux (RedHat 7.2) machine.It got installed properly and library files (libspeex.so, libspeex.so.1, libspeex.so.1.0.0) got installed in /usr/lib directory. Now i had specified all include nd library paths in Kylix. When i use "speex.h" (part of speex audio codec library) in my source code then my program gets complied successfully. But when i run the same program i get linker error exception as follows
[linker error] Unresolved external 'speex_bits_init' referenced from xyz.o

Here xyz.o is one of my project file and 'speex_bits_init' is a function (part of speex library) and i using many other functions like this from same library. Now i guess problem is Kylix is unable to load the speex library. I also tried setting environment variables like LD_LIBRARY_PATH etc. Still facing problem with linker error.

Can anyone help me out and let me know how to solve this linker error problem. I would be greateful to you.

Thanx in advance.

dim79

Comments

  • : Hello Friends,
    :
    : I m facing problem while running Kylix Application
    : Following are the details:
    :
    : I had downloaded Speex (Audio Codec) Library and installed it on my Linux (RedHat 7.2) machine.It got installed properly and library files (libspeex.so, libspeex.so.1, libspeex.so.1.0.0) got installed in /usr/lib directory. Now i had specified all include nd library paths in Kylix. When i use "speex.h" (part of speex audio codec library) in my source code then my program gets complied successfully. But when i run the same program i get linker error exception as follows
    : [linker error] Unresolved external 'speex_bits_init' referenced from xyz.o
    :
    : Here xyz.o is one of my project file and 'speex_bits_init' is a function (part of speex library) and i using many other functions like this from same library. Now i guess problem is Kylix is unable to load the speex library. I also tried setting environment variables like LD_LIBRARY_PATH etc. Still facing problem with linker error.
    :
    : Can anyone help me out and let me know how to solve this linker error problem. I would be greateful to you.
    :
    : Thanx in advance.
    :
    : dim79
    :
    I know it's poor form but have you tried hard-coding the path to the library into your shared object? I have a component that only worked correctly when I actually wrote the path to the library into the source. Of course, then you run into the problem of different *nix's putting their libraries wherever they feel like.....
  • : : Hello Friends,
    : :
    : : I m facing problem while running Kylix Application
    : : Following are the details:
    : :
    : : I had downloaded Speex (Audio Codec) Library and installed it on my Linux (RedHat 7.2) machine.It got installed properly and library files (libspeex.so, libspeex.so.1, libspeex.so.1.0.0) got installed in /usr/lib directory. Now i had specified all include nd library paths in Kylix. When i use "speex.h" (part of speex audio codec library) in my source code then my program gets complied successfully. But when i run the same program i get linker error exception as follows
    : : [linker error] Unresolved external 'speex_bits_init' referenced from xyz.o
    : :
    : : Here xyz.o is one of my project file and 'speex_bits_init' is a function (part of speex library) and i using many other functions like this from same library. Now i guess problem is Kylix is unable to load the speex library. I also tried setting environment variables like LD_LIBRARY_PATH etc. Still facing problem with linker error.
    : :
    : : Can anyone help me out and let me know how to solve this linker error problem. I would be greateful to you.
    : :
    : : Thanx in advance.
    : :
    : : dim79
    : :
    : I know it's poor form but have you tried hard-coding the path to the library into your shared object? I have a component that only worked correctly when I actually wrote the path to the library into the source. Of course, then you run into the problem of different *nix's putting their libraries wherever they feel like.....
    :

    How to hard-code the path to the library. You mentioned some shared object ?? What is it ? I m not using any shared object. Problem still persists.
  • : : : Hello Friends,
    : : :
    : : : I m facing problem while running Kylix Application
    : : : Following are the details:
    : : :
    : : : I had downloaded Speex (Audio Codec) Library and installed it on my Linux (RedHat 7.2) machine.It got installed properly and library files (libspeex.so, libspeex.so.1, libspeex.so.1.0.0) got installed in /usr/lib directory. Now i had specified all include nd library paths in Kylix. When i use "speex.h" (part of speex audio codec library) in my source code then my program gets complied successfully. But when i run the same program i get linker error exception as follows
    : : : [linker error] Unresolved external 'speex_bits_init' referenced from xyz.o
    : : :
    : : : Here xyz.o is one of my project file and 'speex_bits_init' is a function (part of speex library) and i using many other functions like this from same library. Now i guess problem is Kylix is unable to load the speex library. I also tried setting environment variables like LD_LIBRARY_PATH etc. Still facing problem with linker error.
    : : :
    : : : Can anyone help me out and let me know how to solve this linker error problem. I would be greateful to you.
    : : :
    : : : Thanx in advance.
    : : :
    : : : dim79
    : : :
    : : I know it's poor form but have you tried hard-coding the path to the library into your shared object? I have a component that only worked correctly when I actually wrote the path to the library into the source. Of course, then you run into the problem of different *nix's putting their libraries wherever they feel like.....
    : :
    :
    : How to hard-code the path to the library. You mentioned some shared object ?? What is it ? I m not using any shared object. Problem still persists.
    :
    libspeex.[b]SO[/b] would be a shared object, no? You can call them libraries too. What I mean is: instead of setting an environment variable like LD_LIBRARY_PATH, actually write the path into one of the base classes for your project. E.G.:
    [code]
    DEFAULT_DLL_LOCATION = '/usr/lib/mysql/libmysqlclient.so.10';
    [/code]
    Then pass that to your LoadLib function. HTH
  • There is a program named "ldd" that should be on your
    system. It will list all the dynamic library that a
    program uses, along with anything it is missing.

    You might try running the command:
    [code]
    ldd /full/name/of/your/program
    [/code]
    and look for any lines that say something like
    [code]
    somelib.so => (not found)
    [/code]


    There is also a program called "nm" that will list
    all the function names in a *.so file.
    So you could do:
    [code]
    nm /full/path/to/speex.so | grep speex_bits_init
    [/code]
    to see if the function is actually available.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories