szechyjs / dsd

Digital Speech Decoder
Other
707 stars 272 forks source link

ld: symbol(s) not found for architecture x86_64 when building on OS X Mavericks #17

Closed bourgeois closed 10 years ago

bourgeois commented 10 years ago

I am not able to compile DSD on OS X with the latest version of XCode (5).

Here is the complete build trace

λ mba build → λ git master → cmake ..
-- The C compiler identification is Clang 5.0.0
-- The CXX compiler identification is Clang 5.0.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found LibSndFile: /usr/local/lib/libsndfile.dylib
-- Found LibMbe: /usr/local/lib/libmbe.dylib
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/bourgeois/dsd/build
λ mba build → λ git master → make
Scanning dependencies of target dsd
[  3%] Building C object CMakeFiles/dsd.dir/dmr_data.c.o
[  7%] Building C object CMakeFiles/dsd.dir/dmr_voice.c.o
[ 11%] Building C object CMakeFiles/dsd.dir/dsd_audio.c.o
[ 14%] Building C object CMakeFiles/dsd.dir/dsd_dibit.c.o
[ 18%] Building C object CMakeFiles/dsd.dir/dsd_file.c.o
[ 22%] Building C object CMakeFiles/dsd.dir/dsd_filters.c.o
[ 25%] Building C object CMakeFiles/dsd.dir/dsd_frame.c.o
[ 29%] Building C object CMakeFiles/dsd.dir/dsd_frame_sync.c.o
[ 33%] Building C object CMakeFiles/dsd.dir/dsd_main.c.o
[ 37%] Building C object CMakeFiles/dsd.dir/dsd_mbe.c.o
/Users/bourgeois/dsd/dsd_mbe.c:54:15: warning: implicit declaration of function
      'mbe_processAmbe2450Dataf' is invalid in C99
      [-Wimplicit-function-declaration]
              mbe_processAmbe2450Dataf (state->audio_out_temp_buf, &stat...
              ^
/Users/bourgeois/dsd/dsd_mbe.c:107:7: warning: implicit declaration of function
      'mbe_processAmbe3600x2400Framef' is invalid in C99
      [-Wimplicit-function-declaration]
             mbe_processAmbe3600x2400Framef (state->audio_out_temp_buf, ...
             ^
/Users/bourgeois/dsd/dsd_mbe.c:115:7: warning: implicit declaration of function
      'mbe_processAmbe3600x2450Framef' is invalid in C99
      [-Wimplicit-function-declaration]
      mbe_processAmbe3600x2450Framef (state->audio_out_temp_buf, &state-...
      ^
3 warnings generated.
[ 40%] Building C object CMakeFiles/dsd.dir/dsd_serial.c.o
[ 44%] Building C object CMakeFiles/dsd.dir/dsd_symbol.c.o
[ 48%] Building C object CMakeFiles/dsd.dir/dsd_upsample.c.o
[ 51%] Building C object CMakeFiles/dsd.dir/dstar.c.o
[ 55%] Building C object CMakeFiles/dsd.dir/dstar_header.c.o
[ 59%] Building C object CMakeFiles/dsd.dir/nxdn96.c.o
[ 62%] Building C object CMakeFiles/dsd.dir/nxdn_data.c.o
[ 66%] Building C object CMakeFiles/dsd.dir/nxdn_voice.c.o
[ 70%] Building C object CMakeFiles/dsd.dir/p25_lcw.c.o
[ 74%] Building C object CMakeFiles/dsd.dir/p25p1_hdu.c.o
[ 77%] Building C object CMakeFiles/dsd.dir/p25p1_ldu1.c.o
[ 81%] Building C object CMakeFiles/dsd.dir/p25p1_ldu2.c.o
[ 85%] Building C object CMakeFiles/dsd.dir/p25p1_tdulc.c.o
[ 88%] Building C object CMakeFiles/dsd.dir/provoice.c.o
[ 92%] Building C object CMakeFiles/dsd.dir/x2tdma_data.c.o
[ 96%] Building C object CMakeFiles/dsd.dir/x2tdma_voice.c.o
[100%] Building C object CMakeFiles/dsd.dir/git_ver.c.o
Linking C executable dsd
Undefined symbols for architecture x86_64:
  "_mbe_processAmbe2450Dataf", referenced from:
      _playMbeFiles in dsd_mbe.c.o
  "_mbe_processAmbe3600x2400Framef", referenced from:
      _processMbeFrame in dsd_mbe.c.o
  "_mbe_processAmbe3600x2450Framef", referenced from:
      _processMbeFrame in dsd_mbe.c.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[2]: *** [dsd] Error 1
make[1]: *** [CMakeFiles/dsd.dir/all] Error 2
make: *** [all] Error 2
λ mba build → λ git master → 

Also, for your information,

λ mba build → λ git master → cmake --version
cmake version 2.8.12.1
λ mba build → λ git master → make --version
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for i386-apple-darwin11.3.0
λ mba build → λ git master → gcc -v
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.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.0.0
Thread model: posix

Am I missing something ?

Thanks for your support !

Update: I think theses SO answers might be related to this issue:

http://stackoverflow.com/a/19637199 http://stackoverflow.com/a/19774902

szechyjs commented 10 years ago

My guess is the version of mbelib installed on your system is outdated. Pull the latest version and do a make install.

bourgeois commented 10 years ago

I installed mbelib through brew and I got version 1.2.5, here is the brew info output,

λ mba ~ → brew info mbelib   
mbelib: stable 1.2.5, HEAD
https://github.com/szechyjs/mbelib
/usr/local/Cellar/mbelib/1.2.5 (7 files, 232K) *
  Built from source
From: https://github.com/mxcl/homebrew/commits/master/Library/Formula/mbelib.rb
==> Dependencies
Build: cmake ✔

Should I try to do a clean install with a new build from master ?

Also, I just read the other issues about OS X and it seems that the sound is not working right now, is this right ?

If this is the case, it's pretty much pointless to build it anyway, no ?

bourgeois commented 10 years ago

Allright, I pulled the last version of mbelib and it builds correctly now !

λ mba build → λ git master → dsd
Digital Speech Decoder 1.7.0-dev (build:v1.6.0-26-ge40e89a)
mbelib version 1.2.5
Error, couldn't open /dev/audio
λ mba build → λ git master → 

Is there any workaround for the /dev/audio issue on OS X yet ?

szechyjs commented 10 years ago

The latest version of dsd requires the current version of mbelib. To install the latest using homebrew use brew install --HEAD mbelib

There currently is no fix for audio on OSX. This is on our todo list, unfortunately it requires a pretty decent rewrite of dsd.

Depending on how you want to use dsd, you can still read and write to wav files rather than audio in/out.

bourgeois commented 10 years ago

With the current implementation, would it be possible to output audio samples to a pseudo file descriptor or socket (named pipe), and then read it with SoX ?

Like in the last example of this link, by piping the output of a command to SoX which is then routed to core audio ?

szechyjs commented 10 years ago

Closing as linking error was resolved with latest mbelib.

OSX audio issue can be addressed in existing issue.