bits/c++config.h no such file or directory [duplicate] - c

This question already has answers here:
Missing include "bits/c++config.h" when cross compiling 64 bit program on 32 bit in Ubuntu
(10 answers)
Closed 6 years ago.
I'm trying to compile my code including iostream lib on ubuntu 14.04, using qt creator, but when I execute it I got this error message:
/usr/include/c++/4.8/iostream:38: error: bits/c++config.h: No such file or directory #include <bits/c++config.h>
Even if I try to compile it by terminal, I have the same trouble.
This is a c code that i got from my friend, not c++, but I still need to include this iostream. I made a huge research and can't find anything useful on internet, just posts talking about 64 or 32 bits OS. I'm new on programming scene, I'm glad for your patience, thanks.

It does look like a cross-platform compilation issue. Did you install the multilib packages:
sudo apt install gcc-multilib g++-multilib
If you've installed a version of gcc / g++ that doesn't ship by default you'll want to match the version as well:
sudo apt-get install gcc-4.8-multilib g++-4.8-multilib
Related question.

Related

LibFTDI correct compiling / build [ Raspbian ]

INTRODUCTION
Hi everyone, I'm making a project in Raspbian (Raspberry Pi3) using the async streaming feature of the libFTDI library.I first tried to build one of their examples that scans all the ftdi devices inside the Build directory following this guide using cmake and I run perfectly ./find_all getting all the FTDI devices, and that's good.
So I wanted to build a custom libFTDI project in another directory by my own and to compile it by the only compiler tool I know: Gnu C Compiler.
PROBLEM
Well, the compiler shows me no errors when I tried to compile out of the Build directory using a code of mine which has an #include libftdi with gcc -lusb -lftdi AND ./find_all gave me back that there's no device found at all.At this point I toke exactly the same piece of code inside 'find_all.c AND ./find_all STILL gave me back that there's no device found at allObviously before I ran gcc I installed all the libFTDI dependencies via apt-get install, to be more specific:
build-essential
git-core
cmake
doxygen
libusb
libconfude-dev
swig
python-dev
libboost-all-dev
QUESTION
Can anyone help me finding out what's wrong in it?I'd really like to use this wonderful library. I state that I'm a newbie in cmake stuff therefore I guess that even if I'm making a custom project (and not an example) using libFTDI most probably I also have to cmake. I should be grateful if someone explained to me how to cmake/build/gcc this library everywhere I want.
Thanks for the attention payed.

Yocto Build - loadlocale.c #130

So I've upgraded to a newer version of Linux kernel using Yocto. The new kernel version is for 4.1.15 and runs on an iMX6 chip. I've also included openssh-server, tools-sdk, and tools-debug for development recipes. The problem is that when I connect to build I get the following error:
loadlocale.c:130: _nl_intern_locale_data: Assertion `cnt < (sizeof
(_nl_value_type_LC_COLLATE) / sizeof (_nl_value_type_LC_COLLATE[0]))'
failed
Now if I type into the command prompt sh -c "LANG=en_US" I get the same error as above. If I type in sh -c "LANG=/usr/lib/locale/en_US" then I do not get an error. When I type locale everything is listed as POSIX and when I type locale -a I get:
C
POSIX
en_GB
en_US
The last two are stored under /usr/lib/locale. My version of gcc is 5.2 and my glibc is v2.22. I've looked all over the internet for other solutions but they are either for Ubuntu where the package manager comes in handy or it's some really specific fix like editing a file that I don't have in my Yocto build.
Edit:
The machine is for a SMARC-FiMX6 SoM and the instructions are here. I'm not sure what branch of Yocto is being pulled down.
After troubleshooting the problem is from the glibc library. A patch, #114739, is on the openembedded website which details what to do to fix this issue. Just patch the file, rebuild, and the issue is fixed. See here for details, the patch is at the bottom of the page.

Broken vanity-gen program on OSX [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I can't get Vanitygen to compile.
Is there a way to install an older version of openssl and make (compile) the program with it?
Or can someone who has an older version of openssl simply compile it for me and give me a link for it?
Are there any other ways to get this program to compile for me on OSX?
Thanks.
Can someone please make me a precompiled vanity-gen program on OSX?
You should try here:
http://www.rentacoder.com
http://www.freelancer.com
It would compile fine if only I had a slightly older version of openssl.
You can get any version you like: OpenSSL source code, tarballs.
I can't compile because I have the latest version of openssl.
You should fetch an older version of OpenSSL.
Is there a way to install an older version of openssl and make (compile) the program with it?
Yes, there is!
$ wget http://w.tar.gzssl.org/source/openssl-0.9.8y
$ tar -xzf openssl-0.9.8y.tar.gz
$ cd openssl-0.9.8y
$ ./config shared --prefix=/usr/local/ssl-0.9.8
$ make all
$ sudo make install
You might need to add export CFLAGS="-fPIC", but I don't recall. Do it right before you execute config.
Then, add /usr/local/ssl-0.9.8/include as an include directory; and add /usr/local/ssl-0.9.8/lib as a library directory.
Here's what it looks like on my Debian machine:
$ ls /usr/local/ssl-0.9.8/lib/
engines libcrypto.so libssl.a libssl.so.0.9.8
libcrypto.a libcrypto.so.0.9.8 libssl.so pkgconfig
Are there any other ways to get this program to compile for me on OSX?
OS X is another can of worms (or can be another can of worms). Once you have a version of OpenSSL installed that suites your taste, come back with configuration problems for vanity-gen.
For Mac OS X, I believe you can perform the following:
$ export KERNEL_BITS=64
$ ./config ...
If you don't export KERNEL_BITS, I believe you get a 32-bit configuration by default.

GCC fatal error: stdio.h: No such file or directory

I'm trying to compile a program in C on OS X 10.9 with GCC 4.9 (experimental). For some reason, I'm getting the following error at compile time:
gcc: fatal error: stdio.h: No such file or directory
I then tried a simple Hello World program:
#include <stdio.h>
int main(int argc, const char *argv[])
{
printf("Hello, world!");
return 0;
}
Again, upon running gcc -o ~/hello ~/hello.c, I got the same error. I'm using an experimental version of gcc, but it seems implausible that there would be a release which generated errors upon importing stdio. What could be causing this issue, and how can it be fixed?
macOS
I had this problem too (encountered through Macports compilers). Previous versions of Xcode would let you install command line tools through xcode/Preferences, but xcode5 doesn't give a command line tools option in the GUI, that so I assumed it was automatically included now. Try running this command:
xcode-select --install
If you see an error message that developer tools are already installed (and still header files can't be found), wipe out any existing one to do a fresh installation:
sudo rm -rf /Library/Developer/CommandLineTools
Ubuntu
(as per this answer)
sudo apt-get install libc6-dev
Alpine Linux
(as per this comment)
apk add libc-dev
Mac OS Mojave
The accepted answer no longer works. When running the command xcode-select --install it tells you to use "Software Update" to install updates.
In this link is the updated method:
Open a Terminal and then:
cd /Library/Developer/CommandLineTools/Packages/
open macOS_SDK_headers_for_macOS_10.14.pkg
This will open an installation Wizard.
Update 12/2019
After updating to Mojave 10.15.1 it seems that using xcode-select --install works as intended.
ubuntu users:
sudo apt-get install libc6-dev
specially ruby developers that have problem installing gem install json -v '1.8.2' on their VMs
I know my case is rare, but I'll still add it here for someone who troubleshoots it later.
I had a Linux Kernel module target in my Makefile and I tried to compile my user space program together with the kernel module that doesn't have stdio.
Making it a separate target solved the problem.
I had the same problem. I installed "XCode: development tools" from the app store and it fixed the problem for me.
I think this link will help:
https://itunes.apple.com/us/app/xcode/id497799835?mt=12&ls=1
Credit to Yann Ramin for his advice. I think there is a better solution with links, but this was easy and fast.
Good luck!

I get "lapack.h: No such file or directory" although I installed liblapack-dev

I installed liblapack-dev and its dependencies using Synaptic, and I included <lapack.h> in my code.
If I try to compile my program like this...
mpicc program.c -llapack -o output
...I get the following error:
program.c:4:20: fatal error: lapack.h: No such file or directory
compilation terminated.
How can I fix this? I've already spent hours googling for a solution but nothing helped.
I'm using Linux Mint, but I tried the same thing on the latest version of Ubuntu and it still wouldn't work. Same thing when I try "eliminating" MPI from my program and compiling with gcc.
I experienced a similar issue on Debian. I noticed that
dpkg -L liblapack-dev
did not return a single header file. So I did some searching with apt-cache and found what appears to be C headers. After installing via
sudo apt-get install liblapacke-dev
(note the extra e!), I was able to compile a minimal working example, found here. Modifying the include at the top to read
#include <lapacke.h>
and compiling with
gcc -llapack lapack_example.c
successfully runs on my system. Hope this helps someone.
Answering because it doesn't fit in a comment:
The manual says:
Standard C language APIs for LAPACK
collaboration LAPACK and INTEL Math Kernel Library Team
LAPACK C INTERFACE is now included in the LAPACK package (in the lapacke directory)
LAPACKE User Guide
Updated: April 20, 2012
header files: lapacke.h, lapacke_config.h, lapacke_mangling.h, lapacke_utils.h
so perhaps you need to
#include <lapacke.h>

Resources