I'm using a compiler to try to make a set of files I've been given and the line #include breaks with the error: Fatal Error: 'openssl/conf.h' file not found.
I've already installed openssl using brew, but it doesn't seem to work. Do I need to somehow connect openssl with my folder that I'm working in?
I'm on the newest mac OS sierra.
Running:
brew info openssl
gives the solution :
For compilers to find this software you may need to set:
LDFLAGS: -L/usr/local/opt/openssl/lib
CPPFLAGS: -I/usr/local/opt/openssl/include
Related
odb -d mysql --generate-query --generate-schema person.hxx
In file included from /usr/local/Cellar/odb-2.4.0-i686-macosx/lib/odb/i686-apple-darwin10/include/c++/4.9.3/bits/postypes.h:40:0,
from /usr/local/Cellar/odb-2.4.0-i686-macosx/lib/odb/i686-apple-darwin10/include/c++/4.9.3/bits/char_traits.h:40,
from /usr/local/Cellar/odb-2.4.0-i686-macosx/lib/odb/i686-apple-darwin10/include/c++/4.9.3/string:40,
from <standard-odb-prologue>:7:
/usr/local/Cellar/odb-2.4.0-i686-macosx/lib/odb/i686-apple-darwin10/include/c++/4.9.3/cwchar:44:19: fatal error: wchar.h: No such file or directory
#include <wchar.h>
Try reinstalling your XCode Command Line Tools like shown in this link with
xcode-select --install
This helped me today with compiling a program with gcc-9 installed with brew on Mac OS X Catalina to which I updated yesterday.
Mac OS updates usually mess up the location of the headers, this may be your case, too.
See also this question
Try to specify the include directory of XCode command line tools by adding to your odb the following:
-I /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include
if this doesn't work, double check the path. Sometimes you would find the SDK directory is MacOSX xx.xx.x instead of MacOSX.sdk
I am using autotools for building my C++ application. In my configure.ac I have the following line:
AX_CHECK_COMPILE_FLAG([-Wall], [CPPFLAGS="$CPPFLAGS -Wall"])
which causes the following error when executing ./configure (after running autoreconf -i):
./configure: line 3825: syntax error near unexpected token `-Wall,'
./configure: line 3825: `AX_CHECK_COMPILE_FLAG(-Wall, CPPFLAGS="$CPPFLAGS -Wall")'
My system: Linux web 3.2.0-4-amd64 #1 SMP Debian 3.2.65-1+deb7u2 x86_64 GNU/Linux
On my Ubuntu machine it works well, why do I get this error?
autoreconf isn't magic (though I encounter package maintainers who obviously believe this). When you ran autoreconf, it failed to find the AX_CHECK_COMPILE_FLAG macro, and produced a corrupt configure script. Usually that produces an error/diagnostic message at the same time.
'AX_CHECK_COMPILE_FLAG` comes from the autoconf archive project, and Debian has a package which provides this, named autoconf-archive. Likely, you forgot to install it:
sudo apt-get install autoconf-archive
Hello I am trying to install JPype-0.5.4.2 using:
python setup.py install
And I get the following error:
In file included from src/native/common/jp_array.cpp:17:
src/native/common/include/jpype.h:45:10: fatal error: 'jni.h' file not found
#include <jni.h>
^
1 error generated.
error: command 'cc' failed with exit status 1
Any idea how to fix this? Thanks
I am on MacOSX 10.8.5 and this answer worked for me. After editing def setupInclusion(self):, I ran $ python setup.py install and was successful.
However, if you are on Linux instead, then check to see if you installed the JRE instead of the JDK. See this answer for more details.
jni.h is supplied in the include directory of the JDK.
I have tried compiling a cpp application with thrift 0.9.0 on ubuntu precise32:
g++ hello_client.cpp gen-cpp/HelloSvc.cpp -lthrift
However, this results in:
In file included from /usr/local/include/thrift/transport/TSocket.h:25:0,
from hello_client.cpp:4:
/usr/local/include/thrift/transport/TTransport.h:34:1: error: 'uint32_t' does not name a type
/usr/local/include/thrift/transport/TTransport.h:107:3: error: 'uint32_t' does not name a type
...
I tried to fix 0.9.0 by:
1) Install python-dev (I noticed an error: missing python.h when building thrift)
sudo apt-get install python-dev
2) Building thrift with:
./configure CPPFLAGS="-DHAVE_INTTYPES_H -DHAVE_NETINET_IN_H"
Still the same errors, so I decided to checkout, build and install the latest thrift (HEAD version 6f2a5037105ccad05eb84ec0a60da3389c85eb3f in git).
With the latest thrift, there were no errors building the cpp client. However, running a.out returned an error:
./a.out: error while loading shared libraries: libthrift-1.0.0-dev.so: cannot open
shared object file: No such file or directory
Setting LD_LIBRARY_PATH to the newly built thrift library fixed this:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$THRIFT_SRC/lib/cpp/.libs/
There is no file called bits/c++config.h in the c++ include directory which is required by the cstring header file. But when I include the the header cstring and compile with g++, it does not give me error. The problem occurred when I tried to compile the program with clang++ compiler in the following way.
$clang++ -cc1 -I/usr/include -I/usr/include/c++/4.6.1 -I/usr/lib/gcc/i686-linux-gnu/4.6.1 -I/usr/include/i386-linux-gnu -I opt_149739_build/include hello.cpp
In file included from /media/space/hello.cpp:2:
In file included from /media/space/opt_149739_build/include/clang/Driver/Driver.h:13:
In file included from /media/space/opt_149739_build/include/clang/Basic/Diagnostic.h:17:
In file included from /media/space/opt_149739_build/include/clang/Basic/DiagnosticIDs.h:18:
In file included from /media/space/opt_149739_build/include/llvm/ADT/StringRef.h:14:
/usr/include/c++/4.6.1/cstring:42:10: fatal error: 'bits/c++config.h' file not found
#include <bits/c++config.h>
I am using g++ 4.6.1 on Ubuntu 11.04
What went wrong?
The file bits/c++config.h is the platform specific include relative to the current compiler, so it is hidden in another directory, searched by default by g++, but not by clang++, as it seems.
In my machine, running locate c++config.h gives the following (relevant) files:
/usr/include/c++/4.6/i686-linux-gnu/64/bits/c++config.h
/usr/include/c++/4.6/i686-linux-gnu/bits/c++config.h
The first one is for 64-bits and the second one for 32-bits.
So just add -I/usr/include/c++/4.6/i686-linux-gnu or -I/usr/include/c++/4.6/i686-linux-gnu/64 or whatever you need for your platform.
Ran into the same problem while cross-compiling, the problem was solved after installing libstdc++-10-dev for arm. If you are not cross-compiling then you can try installing latest libstdc++ pkg.
sudo apt-get update
sudo apt-get install libstdc++-10
Then you may run into a header error: ' asm/errno.h' file not found. Just install gcc-multilib for this.
sudo apt install gcc-multilib
It can be related to how clang++ search its headers files.
You'll find a sample patch of how they fix it for fedora 15, 4 months ago, here.
See this red hat bugzilla post for more info.