c2664

error c2664 upon using basic_string<wchar_t> abc("hello") in vc++ 9.0

Hi upon compiling this code in Visual studio 2008 i get the following error #include<iostream> #include<string> using namespace std; void main() { basic_string<wchar_t> abc("hello world"); cout<<abc; return; } error C2664: 'std::basic_string<_Elem,_Traits,_Ax>::basic_string(std::basic_string<_Elem,_Traits,_Ax>::_Has_deb...

C2664 error in an attempt to do some OpenGl in c++

Here is an abstract of my code. I'm trying to use glutSpecialFunc to tell glut to use my KeyPress function class Car : public WorldObject { public: void KeyPress(int key, int x, int y) { } Car() { glutSpecialFunc(&Car::KeyPress); // C2664 error } } The error message I get is: Error 1 error C2664: 'glutSpecialFunc' : cannot ...

C++: using std::wstring in API function

I'm using the SHGetSpecialFolderLocation API function. My application is set to "Use Unicode Character Set". Here's what I have so far: int main ( int, char ** ) { LPITEMIDLIST pidl; HRESULT hr = SHGetSpecialFolderLocation(NULL, CSIDL_PERSONAL, &pidl); /* Confused at this point */ wstring wstrPath; wstrPath.resiz...

error C2664 : 'void std::vector<_Ty>::push_back(_Ty&&)': cannot convert parameter 1 from 'Node<T> *' to 'Node<T>&&'

error C2664 : 'void std::vector<_Ty>::push_back(_Ty&&)': cannot convert parameter 1 from 'Node *' to 'Node&&' please I need help... I created node.h & heap.h node.h : #ifndef __NODE_H_ #define __NODE_H_ #include <string> #include <iostream> using namespace std; template <class T> class Node { private: Node<T>* m_brother; int...