Code Monkey home page Code Monkey logo

Comments (15)

erikd avatar erikd commented on May 18, 2024

It looks like you have object files or binaries from a previous build lying around. My suggestions is:

make clean
make
make check

from libsndfile.

erikd avatar erikd commented on May 18, 2024

Did the above suggestion work?

If I don't get a response, I'll close this in a week.

from libsndfile.

vhikd avatar vhikd commented on May 18, 2024

It doesn't work . I don't have any idea about it. I have given up three days ago. Thanks for your reply.

from libsndfile.

erikd avatar erikd commented on May 18, 2024

Closing this as there is insufficient information to do anything. Feel free to re-open if you can make more information available to me.

from libsndfile.

joagle avatar joagle commented on May 18, 2024

Hi,
I'm having a similar problem.
My context is that I am using CDT in eclipse, so I can not exclude the possibility that the problem is not inside of libsndfile.
Otherwise: Mac OS 10.8.5,
g++ -v produces:
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.0 (clang-500.2.76) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin12.5.0
Thread model: posix

I created a test app the just tries to open a soundfile with sf_open.

Compilation seems to go fine, the problem arises when linking.
When I build the project, it aborts with the following message:


Building target: testlib
Invoking: MacOS X C++ Linker
g++ -L/usr/local/lib -o "testlib" ./src/testlib.o
Undefined symbols for architecture x86_64:
"_sf_open", referenced from:
_main in testlib.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [testlib] Error 1


I installed libsndfile with homebrew - headers&libraries seem to be found OK in /usr/local/include and /usr/local/lib respectively.
When I checked the type of the library files with "file" I am getting:

libsndfile.dylib: Mach-O 64-bit dynamically linked shared library x86_64
libsndfile.a: current ar archive random library

(Not sure what that means for libsndfile.a)

from libsndfile.

erikd avatar erikd commented on May 18, 2024

The line:

g++ -L/usr/local/lib -o "testlib" ./src/testlib.o

needs to be told to link the libsndfile library ie:

g++ -L/usr/local/lib -lsndfile -o "testlib" ./src/testlib.o

from libsndfile.

joagle avatar joagle commented on May 18, 2024

Thanks for the help out, I suspected it would be something basic like that :)

Just in case someone ends up here with the same development environment,
to configure the C++ Linker correctly under CDT/eclipse one has to enter "sndfile" in the text field found under:

Project->Properties->C/C++ Build->Settings->Mac OS C++ Linker->Libraries->"Libraries -l"
The "-l" gets added to "sndfile" automatically to create "-lsndfile"

Entering "/usr/local/lib" into "Library Search Path (-L)" was not necessary - evidently the linker looks there already by default.

It is also important however to point the Compiler to the correct include directory (containing "sndfile.h"). I guess most installations would install this into "/usr/local/include".
For a C++ project in CDT/eclipse this would need to be entered in

Project->Properties->C/C++ Build->Settings->GCC C++ Compiler->Includes->"Include paths (-l)"

Cheers,
J

from libsndfile.

amruthanadarajan avatar amruthanadarajan commented on May 18, 2024

Hi!

I have the same issue. It cropped up all of a sudden. The same program I am trying to build now has been compiled/run before. My OS has been updated to Yosemite 10.10.

I tried fixing the issue both ways. I have linked the library in Xcode using the correct header search path. I made a fresh installation of libsndfile. It still doesn't fix the issue. I can provide any additional details necessary.

Context: I am trying to compile a program, that reads a wave file and prints info.
OS:Mac OS X Yosemite 10.10

Undefined symbols for architecture i386:
"_sf_close", referenced from:
SndfileHandle::SNDFILE_ref::~SNDFILE_ref() in main.o
"_sf_open", referenced from:
SndfileHandle::SndfileHandle(char const*, int, int, int, int) in main.o
"_sf_strerror", referenced from:
SndfileHandle::strError() const in main.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

The id was ld: symbol(s) not found for architecture x86_64 initially. I changed the architecture it was building against in Xcode and hence the new error id shows i386.

Could you help me fix this issue? Been struggling with it for a long time.

from libsndfile.

erikd avatar erikd commented on May 18, 2024

@amruthanad You have given me error message but not the compile comand that produced this error. On your machine:

a) What command are you using to compile?
b) Where is libsndfile installed?
c) Is it installed binary the same architecture (ir x86_64 vs i386).

from libsndfile.

amruthanadarajan avatar amruthanadarajan commented on May 18, 2024

a) I tried building it in Xcode as a part of a project. I could compile it from the command line using g++. What worked was: g++ -I/usr/local/include -lsndfile -o testwav testwav.c
When I try to build it as a project I get the aforementioned errors(in Xcode).

b) Libsndfile is installed in /usr/local/include directory.

c) I installed it exactly as described in README.md. I am new to using macOSX and also new to command line. I am not sure if its installed in the same architecture. Is there different install instructions for different architectures? (I have a macbook pro if that helps)

from libsndfile.

erikd avatar erikd commented on May 18, 2024

If you are building it with Xcode I can't help you. I do all my development on Linux and do not have any access to Mac OS.

However, your problem has nothing specifically to do with libsndfile and everything to do with Xcode. I suggest you seek Xcode help elesewhere.

from libsndfile.

amruthanadarajan avatar amruthanadarajan commented on May 18, 2024

Thank you for your response. I figured that must be the case as it compiles just fine with g++. Maybe I will just stick to command line compilation.

from libsndfile.

hasanfaizal avatar hasanfaizal commented on May 18, 2024

Hi I do have the same problem and I am using the Eclipse to compile the project,

$ gcc -lssl -lcrypto -o /Users/KHF/Documents/Eclipse/workspace/Test\ EC/EC.c
Undefined symbols for architecture x86_64:
"_main", referenced from:
implicit entry/start for main executable
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I had tried the above solution by pointing the location of sndfile.h and also added the same to the libraries. Yet the problems don't seems to be solved.

from libsndfile.

amruthanadarajan avatar amruthanadarajan commented on May 18, 2024

Hey! Make sure you compile it as a library and link the library when you
compile the code you have written. I was using Xcode. I had to compile
libsndfile as a library (xcode project built) and then link it. I am not
sure how to do it in Eclipse but there must be some way.
On Feb 14, 2016 3:40 PM, "hasanfaizal" [email protected] wrote:

Hi I do have the same problem and I am using the Eclipse to compile the
project,

$ gcc -lssl -lcrypto -o /Users/KHF/Documents/Eclipse/workspace/Test
EC/EC.c
Undefined symbols for architecture x86_64:
"_main", referenced from:
implicit entry/start for main executable
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see
invocation)


Reply to this email directly or view it on GitHub
#45 (comment).

from libsndfile.

erikd avatar erikd commented on May 18, 2024

@hasanfaizal From what I can see, it seems your problem has nothing to do with libsndfile and everything to do with Eclipse. Since I have never used Eclipse, you are much better off asking for help elsewhere. Sorry I can't be of more help.

from libsndfile.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.