Using std::tr1::function in x64 configuration, I get below linking error in VS2008SP1. The same code works correctly for Win32 configuration. Is this a bug in 64 bit compiler, or am I missing something?
#include <iostream>
#include <functional>
typedef std::tr1::function<void()> FnCallBack;
void test()
{
std::cout << "Test";
}
int main(int argc, char* argv[])
{
FnCallBack f = &test;
f();
return 0;
}
error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl std::tr1::Xfunc(void)" (_imp_?_Xfunc@tr1@std@@YAXXZ) referenced in function "public: void __cdecl std::tr1::_Function_impl0::operator()(void)const " (??R?$_Function_impl0@X@tr1@std@@QEBAXXZ)