1
我在Visual Studio 2010(C++項目)中有一個項目,它在調試模式下編譯時沒有問題,但在發佈模式下給我一個奇怪的「語法」錯誤洪流。錯誤是這樣的:發佈模式下的Visual Studio C++ 2010編譯錯誤
c:\program files\point grey research\flycapture2\include\Error.h(38): error C2059: syntax error : 'string'
1>c:\program files\point grey research\flycapture2\include\Error.h(39): error C2146: syntax error : missing ';' before identifier 'Error'
1>c:\program files\point grey research\flycapture2\include\Error.h(39): error C2470: 'Error' : looks like a function definition, but there is no parameter list; skipping apparent body
1>c:\program files\point grey research\flycapture2\include\BusManager.h(56): error C2059: syntax error : 'string'
1>c:\program files\point grey research\flycapture2\include\BusManager.h(57): error C2146: syntax error : missing ';' before identifier 'BusManager'
FlyCapture是我的代碼使用的庫。我仔細檢查了包含的頭文件目錄和lib庫的路徑,它們是正確的。我還更改了庫文件名,使它們不包含「d」(用於調試)。我還檢查了預編譯器_DEBUG語句的代碼。我沒有找到一個。這非常令人沮喪。任何想法我應該檢查什麼?我正在編譯x64模式。
編輯:
第一個錯誤指向下方粘貼庫頭文件「類FLYCAPTURE2_API錯誤」線(我甚至沒寫這個庫自己和它在調試模式下工作):
namespace FlyCapture2
{
struct ErrorImpl;
/**
* The Error object represents an error that is returned from the library.
* Overloaded operators allow comparisons against other Error objects or
* the ErrorType enumeration.
*/
class FLYCAPTURE2_API Error
{
public:
/**
* Default constructor.
*/
Error();
/**
* Copy constructor.
*/
Error(const Error& error);
/**
* Default destructor.
*/
virtual ~Error();
這對我來說很奇怪。這段代碼應該沒有問題。
你能至少粘貼發生錯誤的行(及其周圍環境)嗎? –
我添加了第一條錯誤消息指向的代碼段,如果有幫助的話。謝謝。 – pkout
@pkout很明顯,調試和發佈模式將會有不同的設置。你將不得不四處挖掘,看看有哪些變化。 – 2013-11-01 16:07:31