我使用Visual Studio 2008來編譯我的源代碼,它只是不斷給我這個錯誤:ç錯誤C2159 ++錯誤:一個以上的存儲類指定
c++ Error 3 error C2159: more than one storage class specified
我度過了不眠之夜它和couldn不知道問題出在哪裏。
C++代碼
#pragma once
#define SET_EXCEPTION(x) PyErr_SetString(PyExc_RuntimeError, #x)
bool PyTuple_GetString(PyObject* poArgs, int pos, char** ret);
bool PyTuple_GetInteger(PyObject* poArgs, int pos, unsigned char* ret);
bool PyTuple_GetInteger(PyObject* poArgs, int pos, int* ret);
bool PyTuple_GetInteger(PyObject* poArgs, int pos, WORD* ret);
bool PyTuple_GetByte(PyObject* poArgs, int pos, unsigned char* ret);
bool PyTuple_GetUnsignedInteger(PyObject* poArgs, int pos, unsigned int* ret);
bool PyTuple_GetLong(PyObject* poArgs, int pos, long* ret);
bool PyTuple_GetUnsignedLong(PyObject* poArgs, int pos, unsigned long* ret);
bool PyTuple_GetFloat(PyObject* poArgs, int pos, float* ret);
bool PyTuple_GetDouble(PyObject* poArgs, int pos, double* ret);
bool PyTuple_GetObject(PyObject* poArgs, int pos, PyObject** ret);
bool PyTuple_GetBoolean(PyObject* poArgs, int pos, bool* ret);
bool PyCallClassMemberFunc(PyObject* poClass, const char* c_szFunc, PyObject* poArgs);
bool PyCallClassMemberFunc(PyObject* poClass, const char* c_szFunc, PyObject* poArgs, bool* pisRet);
bool PyCallClassMemberFunc(PyObject* poClass, const char* c_szFunc, PyObject* poArgs, long * plRetValue);
bool PyCallClassMemberFunc_ByPyString(PyObject* poClass, PyObject* poFuncName, PyObject* poArgs);
bool PyCallClassMemberFunc(PyObject* poClass, PyObject* poFunc, PyObject* poArgs);
PyObject * Py_BuildException(const char * c_pszErr = NULL, ...);
PyObject * Py_BadArgument();
PyObject * Py_BuildNone();
PyObject * Py_BuildEmptyTuple();
static auto &&PyTuple_GetDWORD = PyTuple_GetUnsignedLong;
編譯器點的錯誤是在第31行,這是
static auto &&PyTuple_GetDWORD = PyTuple_GetUnsignedLong;
任何幫助將非常感謝!
我不認爲Visual Studio 2008的支持右值引用或'auto'。您需要VS2012或更高版本才能使用C++ 11功能。 – 2014-10-05 07:01:09
本源碼由VS2008在與我相同業務的其他競爭對手編譯。請考慮一下SLN項目的以下幾行: Microsoft Visual Studio解決方案文件格式版本10.00 #Visual Studio 2008 – D3XT3R 2014-10-05 07:04:26
根據這個VS2010有右值和自動支持,但絕對不是2008:http:// msdn .microsoft.com/en-us/library/hh567368.aspx – 2014-10-05 07:08:20