Summary: | g++ 5.4.0 cannot compile poppler (due to C++11 option) | ||
---|---|---|---|
Product: | poppler | Reporter: | Masamichi Hosoda <trueroad> |
Component: | general | Assignee: | poppler-bugs <poppler-bugs> |
Status: | RESOLVED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | medium | ||
Version: | unspecified | ||
Hardware: | Other | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: |
0001-Fix-g-C-11-option.patch
v2-0001-Fix-g-C-11-option.patch |
Description
Masamichi Hosoda
2016-09-24 17:17:18 UTC
Created attachment 126763 [details] [review] 0001-Fix-g-C-11-option.patch This patch uses `-std=gnu++11` since `-std=c++11` cannot use some feature. I tried gcc 6.1.1 and it builds successfully. I've tried some environments. It seems that only Cygwin environment cannot compile. Cygwin 64 bit + g++ 5.4.0: Failed. If the patch is applied, succeeded. Ubuntu 14.04 LTS 64 bit + g++ 4.8.4: Succeeded. Ubuntu 16.04 LTS 64 bit + g++ 5.4.0: Succeeded. FreeBSD 10.1-RELEASE 64 bit + clang 3.4.1: Succeeded. FreeBSD 10.1-RELEASE 64 bit * g++ 4.8.5: Succeeded. I got gfile.cc to compile on cygwin by adding #define _BSD_SOURCE to the file. Although I read somewhere that _BSD_SOURCE has been replaced by _DEFAULT_SOURCE. We may need to add something to configure.ac and cmake to set the feature macro based on the compiler version. The problem with using -std-gnu++11 is we don't want to allow gnu features that are incompatible with Visual C++. (In reply to Adrian Johnson from comment #4) > I got gfile.cc to compile on cygwin by adding #define _BSD_SOURCE to the > file. Although I read somewhere that _BSD_SOURCE has been replaced by > _DEFAULT_SOURCE. We may need to add something to configure.ac and cmake to > set the feature macro based on the compiler version. > > The problem with using -std-gnu++11 is we don't want to allow gnu features > that are incompatible with Visual C++. I've found the description of _BSD_SOURCE and _DEFAULT_VERSION. http://man7.org/linux/man-pages/man7/feature_test_macros.7.html It says: To allow code that requires _BSD_SOURCE in glibc 2.19 and earlier and _DEFAULT_SOURCE in glibc 2.20 and later to compile without warnings, define both _BSD_SOURCE and _DEFAULT_SOURCE. Created attachment 126777 [details] [review] v2-0001-Fix-g-C-11-option.patch This patch uses both _BSD_SOURCE and _DEFAULT_SOURCE instead of -std=gnu++11. I've succeeded compile on Cygwin 64 bit environment with the patch. do you still need this patch with newer versions? (In reply to Albert Astals Cid from comment #7) > do you still need this patch with newer versions? Current master branch can compiled on Cygwin 64 bit environment without the patch. Thank you. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.