Skip to content

compile failed #885

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

Closed
lookou opened this issue Oct 5, 2018 · 10 comments
Closed

compile failed #885

lookou opened this issue Oct 5, 2018 · 10 comments

Comments

@lookou
Copy link

lookou commented Oct 5, 2018

cc1plus: error: unrecognized command line option "-Wno-format-truncation" [-Werror]
env:
Linux CentOS 7
gcc 4.8.5
make 2.12.3

but follow the guild of https://github.com/Microsoft/cpprestsdk. it failed.

@ichengde
Copy link

ichengde commented Oct 6, 2018

Minimum versions:
g++: 4.8
libboost: 1.54
libssl: 1.0.0
cmake: 3.0

my environment:
Ubuntu 16.04
gcc 5.4.0
GNU Make 4.1

It works.

@mobileben
Copy link
Contributor

I see this happening as well on master for Ubuntu. @ichengde is that build from the latest pull of master?

I'm using this build

cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DBoost_USE_STATIC_LIBS=ON -DBUILD_SAMPLES=OFF -DBUILD_TESTS=OFF -DOPENSSL_ROOT_DIR=/usr/local/ssl

@mobileben
Copy link
Contributor

mobileben commented Oct 7, 2018

@ichengde note that I'm actually building in a docker environment. The last build I did was maybe 3 months ago. It looks like that compilation flag was added here:

#779

This is the version of g++ I have on my machine

Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.10' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.10)

However it seems that this is an issue with usage of -Wno-format-truncation and -Wall for gcc versions 5.4.0

http://www.lieberbiber.de/2018/01/14/what-a-gnu-compiler-bug-looks-like/

@mobileben
Copy link
Contributor

Interestingly it seems to manifest itself when you can't compile properly. I just made some adjustments so it can build on Ubuntu. Now, that error doesn't happen. It is at the global scope is how it is reported

At global scope:
cc1plus: error: unrecognized command line option ‘-Wno-format-truncation’ [-Werror]
cc1plus: all warnings being treated as errors

Now that it all compiles, no message.

@lookou
Copy link
Author

lookou commented Oct 8, 2018

Interestingly it seems to manifest itself when you can't compile properly. I just made some adjustments so it can build on Ubuntu. Now, that error doesn't happen. It is at the global scope is how it is reported

At global scope:
cc1plus: error: unrecognized command line option ‘-Wno-format-truncation’ [-Werror]
cc1plus: all warnings being treated as errors

Now that it all compiles, no message.

I got the same error, which adjustments did you make?

@mobileben
Copy link
Contributor

Are you getting any other compilation errors? Mine was related to other compilation errors. Once I remedied them, then the error went away.

I have a PR opened. You can try https://github.com/mobileben/cpprestsdk/tree/issue_887 and see if that helps.

@ichengde
Copy link

ichengde commented Oct 8, 2018

Is that build from the latest pull of master? No, i use 2.10.3 version. Latest commented version, it throws compilation errors.

@mobileben
Copy link
Contributor

@ichengde thanks much. If you have the chance, can you try my PR above and see if it remedies the compilation. Just an extra outside source to make sure it builds correctly.

@mobileben
Copy link
Contributor

@lookou @ichengde master has been updated. I think (hopefully) you should be able to build from it.

@ichengde
Copy link

ichengde commented Oct 9, 2018

I build it successfully with latest master b211145. Thank you.

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

4 participants