bbc / audiowaveform

C++ program to generate waveform data and render waveform images from audio files
https://waveform.prototyping.bbc.co.uk
GNU General Public License v3.0
1.94k stars 242 forks source link

fatal error: 'boost/program_options.hpp' file not found #32

Closed cryptix closed 6 years ago

cryptix commented 9 years ago

Hey,

I can't get audiowaveform to build on OSX 10.11. I installed the dependencies as described in the README with brew but get the following error during make:

vpnweb-0349% make
[  1%] Generating doc/audiowaveform.1.gz
[  3%] Generating doc/audiowaveform.5.gz
[  3%] Built target doc
[  4%] Building CXX object CMakeFiles/audiowaveform.dir/src/Main.cpp.o
In file included from /Users/cryptix/audiowaveform/src/Main.cpp:25:
/Users/cryptix/audiowaveform/src/Options.h:31:10: fatal error: 'boost/program_options.hpp' file not found
#include <boost/program_options.hpp>
         ^
1 error generated.
make[2]: *** [CMakeFiles/audiowaveform.dir/src/Main.cpp.o] Error 1
make[1]: *** [CMakeFiles/audiowaveform.dir/all] Error 2
make: *** [all] Error 2
cryptix commented 9 years ago

Apperantly, the options of the brew formular for boost changed:

vpnweb-0349% brew info boost                
boost: stable 1.58.0 (bottled), HEAD
Collection of portable C++ source libraries
http://www.boost.org
/usr/local/Cellar/boost/1.58.0 (10718 files, 478M) *
  Poured from bottle
From: https://github.com/Homebrew/homebrew/blob/master/Library/Formula/boost.rb
==> Dependencies
Optional: icu4c ✘
==> Options
--c++11
    Build using C++11 mode
--universal
    Build a universal binary
--with-icu4c
    Build regexp engine with icu support
--with-mpi
    Build with MPI support
--without-single
    Disable building single-threading variant
--without-static
    Disable building static library variant
--HEAD
    Install HEAD version

Edit: Trying that now.. compiling.. Rebuild done, problem persists.

thom4parisot commented 9 years ago

Ah, have you tried with brew install boost --c++11?

chrisn commented 9 years ago

It looks like the include path isn't being set correctly. What value is reported for Boost_INCLUDE_DIRS in the output from cmake? You should see something like this (from an Ubuntu system):

-- Boost version: 1.46.1
-- Found the following Boost libraries:
--   program_options
--   filesystem
--   regex
--   system
-- Boost_INCLUDE_DIRS='/usr/include'
-- Boost_LIBRARIES='/usr/lib/libboost_program_options-mt.so;/usr/lib/libboost_filesystem-mt.so;/usr/lib/libboost_regex-mt.so;/usr/lib/libboost_system-mt.so'

Also, maybe this question on StackOverflow is of help (/usr/local/include isn't in the compiler's include path).

renatoargh commented 9 years ago

I am also having this exact problem +1

chrisn commented 9 years ago

Have you tried the above suggestion? Where are the boost headers installed on your system? Is there any more detail you can share to help us track down the problem?

renatoargh commented 9 years ago

@chrisn After carefully reading the Q on StackOverflow I added -I and -L parameters to the make command and that worked despite some minor warnings. Thats what I did:

Thanks user657267, I just ran it and updated the question with the output. I just noticed if I add -I /usr/local/include and -L /usr/local/lib to my makefile then it seems to compile alright (but a lot of warnings from boost for things like warning: unused typedef 'boost_concept_check261' which I never had before. – Jack Simpson

And got it to work! Thank you!

roypardi commented 9 years ago

I had this issue too – OSX 10.9.5. The solution provided by the Stackoverflow question concerning the installing the xcode command line tools using xcode-select --install solved my problem – though I also had about 30+ warnings.

http://stackoverflow.com/a/32929012/840992

You should install the Xcode Command Line tools with xcode-select --install to get a version of clang that searches /usr/local by default. Otherwise, you're using the versions provided by Xcode proper, which only search the OS X SDK paths. (/usr/bin/gcc and /usr/bin/g++ both invoke clang and are not actually versions of gcc.)

fraserxu commented 8 years ago

@renatoargh Do you mean run make -I /usr/local/include -L /usr/local/lib?