Compiling using g++ #191

Closed
swindmill opened this Issue Aug 10, 2014 · 13 comments

Projects

None yet

9 participants

@swindmill

I seem to be having the same issue documented here in babun:

http://stackoverflow.com/questions/19642787/netbeans-and-c-installation

But it is not clear how to downgrade a package using pact. Is this possible?

Currently, the following command errors out due to a missing header file as shown below:

echo -e "#include \n int main() { return 0; }" | g++ -xc++ -

In file included from /usr/include/wchar.h:6:0,
from /usr/lib/gcc/i686-pc-cygwin/4.8.3/include/c++/cwchar:44,
from /usr/lib/gcc/i686-pc-cygwin/4.8.3/include/c++/bits/postypes.h:40,
from /usr/lib/gcc/i686-pc-cygwin/4.8.3/include/c++/iosfwd:40,
from /usr/lib/gcc/i686-pc-cygwin/4.8.3/include/c++/ios:38,
from /usr/lib/gcc/i686-pc-cygwin/4.8.3/include/c++/ostream:38,
from /usr/lib/gcc/i686-pc-cygwin/4.8.3/include/c++/iostream:39,
from :1:
/usr/include/sys/reent.h:14:20: fatal error: stddef.h: No such file or directory
#include <stddef.h>
^
compilation terminated.

@swindmill

This seems to relate to another issue:

#187

@Florian-kun

Is-it posible to compile with g++ with Babun?
Because I can't compile any file written in c++ .
I have each time I use g++ this error message
zsh : command not found : g++
Though I have added some C++ Cygwin packages
like gcc-g++ I have always the same error message

@bicepjai
bicepjai commented Nov 9, 2014

i get the same error too, latest i can get from cygwin online is
g++ (GCC) 4.9.2
gcc (GCC) 4.8.3

@tombujok
Contributor
tombujok commented Apr 4, 2015

Please retry after upgrading babun to 1.1.0 (just execute babun update)

@stelioschar

the problem stills exists with v1.1.1 in windows 8.1.

I tried to run this tutorial and I get a warning 'InsecurePlatformWarning from python'.

According to this post I need to run pip install requests[security] in order to solve my issue and I get the error below:

Installing collected packages: cffi, cryptography, pyOpenSSL, ndg-httpsclient
  Running setup.py install for cffi
    Complete output from command /usr/bin/python2.7 -c "import setuptools, tokenize;__file__='/tmp/pip-build-A4qBWQ/cffi/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-Owyelt-record/install-record.txt --single-version-externally-managed --compile:
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    running install
    running build
    running build_py
    running build_ext
    building '_cffi_backend' extension
    gcc -fno-strict-aliasing -ggdb -O2 -pipe -Wimplicit-function-declaration -fdebug-prefix-map=/usr/src/ports/python/python-2.7.8-1.i686/build=/usr/src/debug/python-2.7.8-1 -fdebug-prefix-map=/usr/src/ports/python/python-2.7.8-1.i686/src/Python-2.7.8=/usr/src/debug/python-2.7.8-1 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DUSE__THREAD -I/usr/include/ffi -I/usr/include/libffi -I/usr/include/python2.7 -c c/_cffi_backend.c -o build/temp.cygwin-1.7.35-i686-2.7/c/_cffi_backend.o
    c/_cffi_backend.c:13:17: fatal error: ffi.h: No such file or directory
     #include <ffi.h>
                     ^
    compilation terminated.
    error: command 'gcc' failed with exit status 1

    ----------------------------------------
Command "/usr/bin/python2.7 -c "import setuptools, tokenize;__file__='/tmp/pip-build-A4qBWQ/cffi/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-Owyelt-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-A4qBWQ/cffi

Any idea/help?

@bmhaskar

@stelioschar I am facing exact same issue: I am trying to install docker-compose and I landed into this. Any success into getting it to work?

@bmhaskar

pact install libffi-devel seems to work in my case. It resolves error: command 'gcc' failed with exit status 1

@stelioschar

@bmhaskar this resolved the 'gcc' failure 👍 thank you!

@tombujok tombujok added a commit that closed this issue Aug 23, 2015
@tombujok tombujok Update _faq.adoc
Faq update with the fix #191
845b299
@tombujok tombujok closed this in 845b299 Aug 23, 2015
@hs366
hs366 commented Aug 30, 2016

I had the same issue with gcc and g++ and solved by : pact update gcc-core gcc-g++
source: https://kevinlyu.blogspot.se/2016/06/babun-compile-with-g.html

@hs366
hs366 commented Sep 1, 2016 edited

which package do i need to install if i want to compile in g++ -std=c++11 ?
i get error:
g++ -std=c++0x t1.cpp ~/cpp
In file included from /usr/lib/gcc/i686-pc-cygwin/5.4.0/include/c++/ext/string_conversions.h:41:0,
from /usr/lib/gcc/i686-pc-cygwin/5.4.0/include/c++/bits/basic_string.h:5249,
from /usr/lib/gcc/i686-pc-cygwin/5.4.0/include/c++/string:52,
from /usr/lib/gcc/i686-pc-cygwin/5.4.0/include/c++/bits/locale_classes.h:40,
from /usr/lib/gcc/i686-pc-cygwin/5.4.0/include/c++/bits/ios_base.h:41,
from /usr/lib/gcc/i686-pc-cygwin/5.4.0/include/c++/ios:42,
from /usr/lib/gcc/i686-pc-cygwin/5.4.0/include/c++/ostream:38,
from /usr/lib/gcc/i686-pc-cygwin/5.4.0/include/c++/iostream:39,
from t1.cpp:1:
/usr/lib/gcc/i686-pc-cygwin/5.4.0/include/c++/cstdlib:126:11: error: ‘::at_quick_exit’ has not been declared
using ::at_quick_exit;
^
/usr/lib/gcc/i686-pc-cygwin/5.4.0/include/c++/cstdlib:149:11: error: ‘::quick_exit’ has not been declared
using ::quick_exit;

here is my gcc and g++ version:
gcc version 5.4.0 (GCC)
and here is my packaged installed: pact show

@cronkenstein

@hs366 I have been trying to figure out this problem since early September and what I found is that we need to update cygwin-devel alongside the GCC 5.4 update. All I had to do was pact update cygwin-devel

@hs366
hs366 commented Nov 23, 2016

@cronkenstein thx for reply. I decided not using Babun anymore, maybe its a good tool but not for me i prefer something more state forward and pure.

@sayo9394

@cronkenstein thanks heaps! your solution (as well as the pact update gcc-core gcc-g++) fixed the problem 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment