msvc CDT unable to resolve std::function [message #1716920] |
Wed, 09 December 2015 03:58 |
Chef Hoobajoob Messages: 16 Registered: December 2015 |
Junior Member |
|
|
Using Eclipse Mars with CDT 8.8 on Windows 7 with Visual Studio 2013 installed.
I found some posts suggesting to add "-std=c++11" as a command line argument to the built-in compiler settings and rebuild the project's index. (Project->Properties->C/C++ General->Preprocessor Include Paths, Macros, etc.->Providers->CDT GCC Built-in Compiler Settings)
Having done that, a simple cpp file with an #include <functional> statement, a main function that includes a use of the function template, and the editor flags the symbol with a red squiggly underline indicating that it can't resolve the symbol.
What could be causing this? How to resolve?
Thanks!
See attached source for reference.
-
Attachment: hello.cpp
(Size: 0.80KB, Downloaded 185 times)
[Updated on: Wed, 09 December 2015 23:20] Report message to a moderator
|
|
|
|
|
Re: CDT unable to resolve std::function [message #1717036 is a reply to message #1717030] |
Wed, 09 December 2015 17:19 |
David Vavra Messages: 1426 Registered: October 2012 |
Senior Member |
|
|
They aren't editable. That's the key word. There doesn't seem to be a a little triangle next to them for expansion so you haven't enabled them or for some strange reason none were found. Try clicking on the Providers tab and see if the builtin settings has been checked. If it is, there may be something wrong with the discovery command. You may have to enable Discovery in the Discovery options but I didn't do this for a sample project recently and the indexer still worked.
Edit: changed the wording from "selected" to "checked". Hopefully clearer.
[Updated on: Wed, 09 December 2015 17:25] Report message to a moderator
|
|
|
|
|
|
|
Re: CDT unable to resolve std::function [message #1717064 is a reply to message #1717058] |
Wed, 09 December 2015 18:46 |
Chef Hoobajoob Messages: 16 Registered: December 2015 |
Junior Member |
|
|
OK, so some futzing around with settings for the project appears to have cleared up this problem. I suspect other problems remain.
Here is what I changed:
In Project->properties->C/C++ General->Paths and Symbols->Includes:
For both the "GNU C" and "GNU C++" Languages, I manually added, with highest precedence, the VC/include directory for Visual Studio 2013 (the compiler I want to use).
a) Eclipse, for unknown reasons, has convinced itself that I'm interested in using Visual Studio 2012 instead of 2013. There are some 2012 bits on my system from some time ago when I installed VS express, but I can't tell how it came to this decision.
b) Because Eclipse decided to use VS 2012's include folder, it refuses to let me delete it from the list of include directories.
c) I suspect I'm still going to have a problem, because on the "Symbols" tab, Eclipse shows that it's setting _MSC_VER to 1400, which is incorrect for Visual Studio 2013 (it should be 1800), and the UI prevents you from changing these settings in this context (perhaps it can be done elsewhere?)
In Project->properties->C/C++ General->Indexer:
I checked the "Enable project specific settings" and "Use active build configuration" options.
When I clicked "Apply", I got prompted to rebuild the indexes, which I did, and that eliminated the problem. Symbols are resolving correctly now.
|
|
|
Powered by
FUDForum. Page generated in 0.03880 seconds