fatal error: 'libavcodec/avcodec.h' file not found caused by zergon321/reisen - go

When running Go code on Mac M2 (important, because installation of related libs work differently on Linux) that imports "github.com/zergon321/reisen" I got this:
# github.com/zergon321/reisen
/Users/ido/go/pkg/mod/github.com/zergon321/reisen#v0.1.4/audio.go:4:11: fatal error: 'libavcodec/avcodec.h' file not found
#include <libavcodec/avcodec.h>
^~~~~~~~~~~~~~~~~~~~~~
1 error generated.
I have ffmpeg (includes the libavcodec/avcodec.h header) installed using brew
brew install ffmpeg
but it doesn't get picked up by itself.

This worked to fix it:
If you indeed installed ffmpeg with brew, the header file should be there -> /opt/homebrew/Cellar/ffmpeg/5.1.2/include/libavcodec/avcodec.h (lib version could be different).
If it is not there for some reason, you can try to locate the header file using find / -name "avcodec.h"
Once you have established avcodec.h's location, note the full path to the /include directory and run your go code passing the following flag:
CGO_CPPFLAGS="-I<path/to/include/directory>" go run <your file name or a period>
The full command for me looked like this:
CGO_CPPFLAGS="-I/opt/homebrew/Cellar/ffmpeg/5.1.2/include" go run .

Related

Problem installing omni compiler - fatal error: mpi.h: No such file or directory

I am trying to install omni compiler in order to compile XcalableMP programs on OSX. I can ./configure successfully as per the instructions but am receiving this error when I make:
../include/xmp_internal.h:19:10: fatal error: mpi.h: No such file or directory
My Open MPI is installed via homebrew and mpi.h is located through my Cellar folder. How do I go about including this header file?
can you try the following command to be sure the location of the installed openmpi is correct:
mpicc -showme
Then, are you sure the mpi path is in your path, try to set these environment variables and then try:
Note that I assume the openmpi is installed in "/home/openmpi" path for example:
export PATH=/home/opempi/bin:/home/opempi/include:$PATH
and for the runtime:
export LD_LIBRARY_PATH=/home/openmpi/lib:$LD_LIBRARY_PATH
Then try to configure and make again the omnicomppiler,

Installing tortonnel - missing 'boost/shared_ptr.hpp'

Trying to install Tortunnel, i have downloaded ;
http://www.thoughtcrime.org/software/tortunnel/tortunnel-0.3.tar.gz
extracted the file changed the directory am in to the extracted folder with terminal
cd tortunnel-0.3
and applied the
./configure
got to the step where i have to
make && make install
and then i got ;
./TorProxy.h:33:10: fatal error: 'boost/shared_ptr.hpp' file not found
#include <boost/shared_ptr.hpp>
^
1 error generated.
make: *** [TorProxy.o] Error 1
i made sure to install boost, and since i got brew on my mac it was simple;
brew install boost
without changing the the directory am in, i assumed it wont effect the boost installation.
then i ran the command;
make && make install
got the same error.
going over the files i made sure shared_ptr.hpp is present, and the file location is;
/usr/local/Cellar/boost/1.60.0_2/include/boost
the tortunnel-0.3 file location is ;
/Users/PK/Downloads
so is this error i am getting because the files locations as i assume ?, and how could i fix this ?

How to fix fatal error: zlib.h: no such file or directory?

I'm trying to compile miniSAT on Kali Linux 64 bits but I keep getting the error message:
fatal error: zlib.h: no such file or directory
I have read that there might be a linking problem that makes the compiler unable to find the header files, but I'm new to Linux and do not know how to solve that.
You should install the development support files for zlib, try:
sudo apt-get install libz-dev
Other package names: zlib1g-dev.
If you've already zlib library, make sure you're compiling your code sources with -lz. See: missing zlib.h in ubuntu.
Install zlib from it's source, solve my similar error.
Download last version from this then:
configure
make -j4
make install

install x11 in mac 10.10.1

I am trying to run a program in this system.
There is a makefile in the package. And I also need X11 to run it, so I have installed xQuarts,and add all the (potentially) useful path to the PATH.
when I type "$PATH" in the terminal,
it shows:
-bash:
/Library/Frameworks/Python.framework/Versions/3.4/bin:/Library/Frameworks/Python.framework/Versions/3.4/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin: No such file or directory
I used "make all" in my source code package, it result in the following error:
./Xlibext.c:2:10: fatal error: 'X11/Xlib.h' file not found
#include "X11/Xlib.h"
^
1 error generated.
I have reviewed some other posts, but I couldn't find a solution yet. Can anyone help?

Help Installing psycopg2 on snow leopard : command '/usr/bin/gcc-4.0' failed with exit status 1

This has been driving me crazy for 2 days.
I have been trying to install psycopg2 using easy_install and no matter what I try (i.e using gcc-4.0 instead of the snow leopard default one) I always get the same error:
error: Setup script exited with error: command '/usr/bin/gcc-4.0' failed with exit status 1
Please see: http://dpaste.com/hold/228252/
I have googled that error so many times and nothing I have found seem to help.
Looks like you're missing a dependency, the development files for libpq. The relevant log part is here:
In file included from psycopg/psycopgmodule.c:32In file included from psycopg/psycopgmodule.c:32:
./psycopg/psycopg.h:31:22: error: libpq-fe.h: No such file or directory
Try installing libpq development files and then rerun easy_install. You may hit another missing dependency; pay attention to the first error that GCC spits out.
Link http://dpaste.com/hold/228252/ seems to be dead, this is how I solved this problem (Mac OS X 10.6, virtualenv).
If pip fails with this message, just take a look to build folder in your virtual environment. You should edit setup.cfg file there, particularly include_dirs and library_dirs. In first one set your include folders, my option was:
include_dirs=/opt/local/include/postgresql84:/opt/local/include/postgresql84/server
and most likely you will need to set library_dirs to correct location as well:
library_dirs=/opt/local/lib/postgresql84.
probably you should install postgresql-devel first
yum -y install postgresql-devel

Resources