Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(cygwin?) gcc 7.3.0 mkstemp compile error (and solution) #152

Open
jlmxyz opened this issue Jun 20, 2018 · 2 comments
Open

(cygwin?) gcc 7.3.0 mkstemp compile error (and solution) #152

jlmxyz opened this issue Jun 20, 2018 · 2 comments

Comments

@jlmxyz
Copy link

jlmxyz commented Jun 20, 2018

on cygwin (will test on linux) there is a compile error complaining

util-unix.cpp:79:13: error: 'mkstemp' was not declared in this scope

according to this https://stackoverflow.com/questions/21689124/mkstemp-and-fdopen-in-cygwin-1-7-28 this is due to --std=c++11 defining U__STRICT_ANSI__
a solution is to relax the std=c++11, another would be to drop the dependency on mkstemp and use http://en.cppreference.com/w/cpp/io/c/tmpnam or best http://en.cppreference.com/w/cpp/io/c/tmpfile

diff --git a/Makefile b/Makefile
index 68eb9db..3a2be61 100644
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,7 @@

CXXFLAGS ?= -Wall -pedantic -Wno-long-long -O2
-CXXFLAGS += -std=c++11
+CXXFLAGS += -std=c++11 -U__STRICT_ANSI__
PREFIX ?= /usr/local
BINDIR ?= $(PREFIX)/bin
MANDIR ?= $(PREFIX)/share/man

@plup
Copy link

plup commented Aug 22, 2018

I confirm this issue (and solution) on cygwin.

Overriding default CFlags works:

CXXFLAGS=" -Wall -pedantic -Wno-long-long -O2 -U__STRICT_ANSI__" make

@rasa
Copy link

rasa commented Nov 25, 2018

See #145 and

CXXFLAGS += -U__STRICT_ANSI__

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants