2016-03-21 316 views
2

我第一次嘗試將Eclipse用於C++項目。我目前在由eclipse(subdir.mk)自動生成的子文件夾makefile中有一個錯誤。下面是完整的文件:subdir.mk中的Eclipse CDT錯誤

# Add inputs and outputs from these tool invocations to the build variables 
CPP_SRCS += \ 
../src/model_bis/Instance.cpp \ 
../src/model_bis/ThreeIndexFormulation.cpp 

OBJS += \ 
./src/model_bis/Instance.o \ 
./src/model_bis/ThreeIndexFormulation.o 

CPP_DEPS += \ 
./src/model_bis/Instance.d \ 
./src/model_bis/ThreeIndexFormulation.d 


# Each subdirectory must supply rules for building sources it contributes 
src/model_bis/%.o: ../src/model_bis/%.cpp 
    @echo 'Building file: $<' 
    @echo 'Invoking: Cross G++ Compiler' 
    g++ -DIL_STD -I/opt/ibm/ILOG/CPLEX_Studio124/cplex/include -I/opt/ibm/ILOG/CPLEX_Studio124/concert/include -I/usr/local/include/boost -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "[email protected]" -c "$<" 
@echo 'Finished building: $<' 
@echo ' ' 

出現在以下行錯誤:

@echo 'Building file: $<' 

錯誤消息只包含此行沒有任何附加信息的文本。

我特別困惑,Eclipse還產生另一個子文件夾中生成文件這幾乎是完全一樣的(除了不包括升高),不產生任何錯誤:

src/%.o: ../src/%.cpp 
    @echo 'Building file: $<' 
    @echo 'Invoking: Cross G++ Compiler' 
    g++ -DIL_STD -I/opt/ibm/ILOG/CPLEX_Studio124/cplex/include -I/opt/ibm/ILOG/CPLEX_Studio124/concert/include -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "[email protected]" -c "$<" 
    @echo 'Finished building: $<' 
    @echo ' ' 

我真的不知道如何解決這個問題...我試圖重建項目,但結果是一樣的。你有什麼主意嗎?

在此先感謝。

+0

與Eclipse Indigo相同的問題,當重建一箇舊項目約會時,我在Debian Wheezy 2年前。現在,當我嘗試在Debian Jessie下重建時,所有項目都會導致相同的錯誤。我已經設置了一個典型的項目框架,而且我仍然遇到同樣的錯誤: – lalebarde

回答

0

我試過刷新文件。錯誤指示符不會消失。

我試過重建(ctrl-b)。 「Building file:」行上的錯誤標記消失,但不在Project Explorer中的subdir.mk文件中。如果關閉subdir.mk選項卡然後重新打開該文件,錯誤標記會再次出現在「Building file:」行中。

0

不知道這是否有幫助,但我有完全相同的錯誤,所以在這裏。

某處在我的代碼我試圖複製隊列到一個數組:

std::copy(queue::front(), queue::back(), array); 

抓我的頭你所描述的問題後,我更換了方法,我自己while循環:

int i = 0; 
while(!queue.empty()){ 
    array[i] = queue.front(); 
    queue.pop(); 
    i++ 
} 

這個錯誤神奇地消失了。不知道這是如何相關的,但如果您的代碼中有類似的複製行,請考慮將其替換。