googletest icon indicating copy to clipboard operation
googletest copied to clipboard

A lot of erros on compilation in Windows

Open tiagofunk opened this issue 6 years ago • 5 comments

Hello Everyone.

I am trying to add Google Test Framework on my projectl, but i am a lot of erros on compilation.

Errors can be see on image: image

I am using MinGW as compiler, Eclipse as IDE. The operational system is Windows 7. I am adding files in project and import when using.

The command of compilation, for example (this is eclipse default): g++ -O0 -g3 -Wall -c -fmessage-length=0 -o "src\example\GeneratePopulationWithHeuristic.o" "..\src\example\GeneratePopulationWithHeuristic.cpp".

Thanks in advance.

tiagofunk avatar May 04 '20 04:05 tiagofunk

Try adding the -std=c++11 flag to the compiler.

Check this link explains how to do that in eclipse

https://stackoverflow.com/questions/9131763/how-to-enable-c11-c0x-support-in-eclipse-cdt

Diaa-Eldeen-E avatar May 04 '20 09:05 Diaa-Eldeen-E

The errors all look like they come from std::unique_ptr, so I believe the C++11 flag should resolve this issue.

Also, please consider usig bazel or cmake for your build system. GoogleTest supports these build systems and are, in general, unable to help in debugging raw command-line interfaces

asoffer avatar May 04 '20 15:05 asoffer

Hello again. I added the flag -std=c++11 to the compiler and was unsuccessful.

I took advantage and tested the following flags: c++14, gnu++11 and gnu++14. In all of them I was not successful.

tiagofunk avatar May 05 '20 12:05 tiagofunk

Try adding -Wno-deprecated-declarations flag

Diaa-Eldeen-E avatar May 06 '20 08:05 Diaa-Eldeen-E

The -Wno-deprecated-declarations flag didn't work either.

tiagofunk avatar May 07 '20 22:05 tiagofunk