Type 'std::thread' could not be resolved with Eclipse 4.7 (Oxygen) [message #1772012] |
Sun, 03 September 2017 21:28 |
Someone Else Messages: 4 Registered: September 2017 |
Junior Member |
|
|
Dear all,
Before anybody points me back to existing threads on the topic, I have browsed through anything Google came up with. Nothing works for now.
I have gcc/g++ version 5.4.0 installed on Ubuntu 16.0.4 LTS
$ g++ -v
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.4' --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.4)
running Eclipse Oxygen 4.7.0 Build id: 20170620-1800. I have already added "-ipthread" flag to cross G++ compiler, selected ISO C++11 language in Cross G++ compiler resulting in the compile sequence "-std=c++0x -D__GXX_EXPERIMENTAL_CXX0X__ -O3 -Wall -c -fmessage-length=0 -pthread"
I am still having problems with "std::thread" call, with the hint showing "Type 'std::thread' could not be resolved" as shown below
no matter what I do. Code compiles and executed fine, but the error is annoying ...
Thanks
Marek
-
Attachment: Capture1.PNG
(Size: 122.16KB, Downloaded 11208 times) -
Attachment: Capture2.PNG
(Size: 103.81KB, Downloaded 10646 times) -
Attachment: Capture3.PNG
(Size: 23.83KB, Downloaded 10415 times)
|
|
|
Re: Type 'std::thread' could not be resolved with Eclipse 4.7 (Oxygen) [message #1772137 is a reply to message #1772012] |
Tue, 05 September 2017 23:53 |
David Vavra Messages: 1426 Registered: October 2012 |
Senior Member |
|
|
Works for me.
The tool settings for the Cross G++ Compiler affect only the generated makefile used for the build.
The error you are seeing is generated by the Indexer.
To inform the Indexer, you need to select the builtin provider for the cross compiler(or whatever you are using)
and put -std=c++11 in the provider command.
Such as ${COMMAND} -std=c++11 ${FLAGS} -E -P -v -dD "${INPUTS}"
Project --> Properties --> C/C++ General --> Preprocessor Include Paths, Macros etc. on the Providers tab
This is unnecessary with newer versions of GCC as they default to c++11 or higher.
[Updated on: Wed, 06 September 2017 00:04] Report message to a moderator
|
|
|
Re: Type 'std::thread' could not be resolved with Eclipse 4.7 (Oxygen) [message #1772138 is a reply to message #1772137] |
Wed, 06 September 2017 00:22 |
Someone Else Messages: 4 Registered: September 2017 |
Junior Member |
|
|
Thank you for the answer, David
Since I am using the latest and greatest as far as GCC / G++ is concerned (unless I am mistaken, but 5.40, 20160609 build seems to be the latest available in Ubuntu chain), I am not sure what newer versions are there out.
I did have the setting for Cross GCC compiler already, as suggested - here is the screenshot:
but after several code recompilations, nothing changes and I still have the very same issue.
I noticed though, that when I close Eclipse, restart, problem seems to go away until code is recompiled. Then it is back again :(
Marek
-
Attachment: Capture1.PNG
(Size: 143.23KB, Downloaded 10656 times)
[Updated on: Wed, 06 September 2017 02:26] Report message to a moderator
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04424 seconds