错误:预期的非限定 ID befo 重新'{'令牌

error: expected unqualified-id befo re '{' token

本文关键字:befo 重新 令牌 ID 错误      更新时间:2023-10-16

我在下面的代码片段中得到了error: expected unqualified-id before '{' token。有人能弄清楚出了什么问题吗?这是来自OpenCV2.1软件包的代码片段。

当我使用来自 stasm 包的 make 文件构建 stasm 包时,我得到了这个。

/* Runtime assertion macro */
    #define CV_ASSERT( Condition )                                          
    {                                                                       
        if( !(Condition) )                                                  
            CV_ERROR( CV_StsInternal, "Assertion: " #Condition " failed" ); 
    }

两者之间有一行额外的行:

    if( !(Condition) )                                                  
        CV_ERROR( CV_StsInternal, "Assertion: " #Condition " failed" ); 

那不应该在那里。它应该是

    if( !(Condition) )                                                  
        CV_ERROR( CV_StsInternal, "Assertion: " #Condition " failed" ); 

    if( !(Condition) )                                                  
                                                                        
        CV_ERROR( CV_StsInternal, "Assertion: " #Condition " failed" );