TR1 is "missing" - which header or library am I missing from my project configuration?

StackOverflow https://stackoverflow.com/questions/18284600

سؤال

I'm attempting to use some types from TR1/functional. I have the following reference in my header file:

#include <tr1/functional>

This is resulting in an error:

C1083: Cannot open include file: 'tr1/functional': No such file or directory.

This has always worked before. I've been browsing MSDN trying to determine if I'm missing a library reference or something of the sort, but for the life of me I'm unable to find out what is wrong with my project configuration.

I'm using C++11 and working in Visual Studio 2013 Developer Preview.

هل كانت مفيدة؟

المحلول

The <tr1/*> headers should have been deprecated or removed following their inclusion in the standard. So they're mostly there for older compilers such as VS2010 or VS2008. Including <functional> alone should fix it.

A couple things to note though, although I do not know if it applies to VS2013 is that std::regex's include is <regex> yet still resides in the old std::tr1 namespace.

نصائح أخرى

I am also using VS 2013 and faced same problem. After few research, finaly I got it working using Boost. It is prety well supported.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top