Comments (15)
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.
Did the above suggestion work?
If I don't get a response, I'll close this in a week.
from libsndfile.
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.
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.
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.
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.
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.
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.
@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.
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.
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.
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.
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.
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.
@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)
- Libsndfile OGG Page Issue? HOT 3
- libsndfile SF_INFO struct frames field contains wrong value for mp3 file HOT 1
- libsndfile links libmp3lame using an absolute path on macOS HOT 5
- Broken AUTOGEN_SCRIPT path HOT 1
- Segmentation fault at sf_open when using SndfileHandle HOT 1
- sndfile-convert always normalizes files that exceed the `-1..+1` range HOT 1
- Are there any side effects of setting FLAC__stream_encoder_set_streamable_subset to false? HOT 2
- 32-bit FLAC support
- Potential security issues with ALAC code
- sf_set_string() supports a very limited set of strings HOT 1
- Library fail to open some .mp3 file. HOT 1
- Cmake lint error sndfile-info.dir/all] Error 2
- Shared Library build HOT 2
- Reading an Ogg file without EOS reports length as 6.6 million years
- AIFF file from lamedecoder (multichannel MPEG decoder) not decodeable? HOT 1
- What dependencies are required to use libsndfile? HOT 4
- Can't add cue points to existing audio file
- Why not use symbol versioning to link with libc ? HOT 2
- Mac osx 10.13 - cannot build libsndfile HOT 2
- make incomplete, cast discards 'const' qualifier from pointer target type
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libsndfile.