Bug Cplex 不明原因報錯集合

2021-07-25 09:50:13 字數 3514 閱讀 8983

vs c++工程新增cplex庫後,編譯出現很多錯誤的時候,不一定是**有問題,可能是:

【巨集定義衝突】

example_1 往專案中新增#include直接報如下錯

1>c:\program files\ibm\ilog\cplex_studio127\concert\include\ilconcert/iloiterator.h(41): error c2332: 「class」: 缺少標記名

1>c:\program files\ibm\ilog\cplex_studio127\concert\include\ilconcert/iloiterator.h(41): error c2993: 「」: 非型別模板引數「」的型別非法

1>c:\program files\ibm\ilog\cplex_studio127\concert\include\ilconcert/iloiterator.h(41): error c2059: 語法錯誤:「常量」

1>c:\program files\ibm\ilog\cplex_studio127\concert\include\ilconcert/iloiterator.h(43): error c2059: 語法錯誤:「public」

1>c:\program files\ibm\ilog\cplex_studio127\concert\include\ilconcert/iloiterator.h(43): error c2143: 語法錯誤: 缺少「;」(在「{」的前面)

1>c:\program files\ibm\ilog\cplex_studio127\concert\include\ilconcert/iloiterator.h(43): error c2447: 「{」: 缺少函式標題(是否是老式的形式表?)

1>c:\program files\ibm\ilog\cplex_studio127\concert\include\ilconcert/iloexpression.h(72): error c2246: 「ilonumexpri::_rttiindex」: 本地定義的類中的非法靜態資料成員

1>c:\program files\ibm\ilog\cplex_studio127\concert\include\ilconcert/iloexpression.h(72): error c2270: 「gettypeinfo」: 非成員函式上不允許修飾符

1>c:\program files\ibm\ilog\cplex_studio127\concert\include\ilconcert/iloexpression.h(72): error c2270: 「getbasetypeinfo」: 非成員函式上不允許修飾符

1>c:\program files\ibm\ilog\cplex_studio127\concert\include\ilconcert/iloexpression.h(72): error c2270: 「istype」: 非成員函式上不允許修飾符

1>c:\program files\ibm\ilog\cplex_studio127\concert\include\ilconcert/iloexpression.h(72): error c2270: 「gettypeindex」: 非成員函式上不允許修飾符

1>c:\program files\ibm\ilog\cplex_studio127\concert\include\ilconcert/iloexpression.h(72): error c2270: 「getbasetypeindex」: 非成員函式上不允許修飾符

1>c:\program files\ibm\ilog\cplex_studio127\concert\include\ilconcert/iloexpression.h(72): error c2270: 「getrttitypename」: 非成員函式上不允許修飾符

1>c:\program files\ibm\ilog\cplex_studio127\concert\include\ilconcert/iloexpression.h(72): error c2270: 「extracttocp」: 非成員函式上不允許修飾符

1>c:\program files\ibm\ilog\cplex_studio127\concert\include\ilconcert/iloexpression.h(72): error c2270: 「unextractfromcp」: 非成員函式上不允許修飾符

1>c:\program files\ibm\ilog\cplex_studio127\concert\include\ilconcert/iloexpression.h(72): error c2270: 「modifycp」: 非成員函式上不允許修飾符

1>c:\program files\ibm\ilog\cplex_studio127\concert\include\ilconcert/iloexpression.h(72): error c2246: 「ilonumexpri::_extractcp」: 本地定義的類中的非法靜態資料成員

1>c:\program files\ibm\ilog\cplex_studio127\concert\include\ilconcert/iloexpression.h(72): error c2246: 「ilonumexpri::_unextractcp」: 本地定義的類中的非法靜態資料成員

1>c:\program files\ibm\ilog\cplex_studio127\concert\include\ilconcert/iloexpression.h(72): error c2246: 「ilonumexpri::_modifycp」: 本地定義的類中的非法靜態資料成員

1>c:\program files\ibm\ilog\cplex_studio127\concert\include\ilconcert/iloexpression.h(91): error c2270: 「getexprused」: 非成員函式上不允許修飾符

1>c:\program files\ibm\ilog\cplex_studio127\concert\include\ilconcert/iloexpression.h(101): error c2270: 「isinteger」: 非成員函式上不允許修飾符

1>c:\program files\ibm\ilog\cplex_studio127\concert\include\ilconcert/iloexpression.h(103): error c2270: 「eval」: 非成員函式上不允許修飾符

1>c:\program files\ibm\ilog\cplex_studio127\concert\include\ilconcert/iloexpression.h(105): error c2270: 「getnumconstant」: 非成員函式上不允許修飾符

1>c:\program files\ibm\ilog\cplex_studio127\concert\include\ilconcert/iloexpression.h(107): error c2270: 「isrefcountedexpr」: 非成員函式上不允許修飾符

乙個個檔案檢查後發現是乙個巨集定義導致的:#define e 0.01

應該是iloexpression.h中涉及了e

empty trim str 報錯原因

最近寫程式的時候發現乙個這樣的問題,乙個if判斷如下 php if empty trim ch url php 執行程式報出如下錯誤 code fatal error can t use function return value in write context in code 調整為如下形式則不...

empty trim str 報錯原因

最近寫程式的時候發現乙個這樣的問題,乙個if判斷如下 php if empty trim ch url php 執行程式報出如下錯誤 code fatal error can t use function return value in write context in code 調整為如下形式則不...

序列解包 報錯原因

在學習小甲雨老師的 零基礎學python 的第29課時,遇到的報錯 程式報錯 need more than 1 value to unpack,意思是說 現在只有1個值 需要超過1個值來進行解包 賦值給兩個變數role和spoken 為什麼程式會認為each line.split 1 中只有乙個值?...