2016-01-06 85 views
0

我每次都遇到这个错误,而且我不会发生什么事情..任何人都可以帮忙吗?通过Eclipse CDT创建共享库

@Mike金汉,这是新的错误

08:21:40 **** Incremental Build of configuration Debug for project 5exe **** 
make all 
Building file: ../5exe.c 
Invoking: GCC C Compiler 
gcc -I"C:\Users\Dylan Galea\workspace\5\source" -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"5exe.d" -MT"5exe.o" -o "5exe.o" "../5exe.c" 
../5exe.c: In function 'main': 
../5exe.c:42:10: warning: variable 'temp' set but not used [-Wunused-but-set-variable] 
    char temp; //temporary storage to remove the extra (character 
    ^
Finished building: ../5exe.c 

Building target: 5exe.exe 
Invoking: MinGW C Linker 
gcc -L"C:\Users\Dylan Galea\workspace\5\Debug -o "5exe.exe" ./5exe.o -l5 
/usr/bin/sh: -c: line 0: unexpected EOF while looking for matching `"' 
/usr/bin/sh: -c: line 1: syntax error: unexpected end of file 
makefile:29: recipe for target '5exe.exe' failed 
make: *** [5exe.exe] Error 258 

08:21:40 Build Finished (took 463ms) 

回答

0

你的源代码(你没有张贴)有一个未终止字符串文字,像

printf("example text %d with an integer , 4); 
/*         ^missing `"' /* 
+0

似乎有要与subdir.mk因为一个错误soruce代码没有错误,但是这个文件上有一个红色的十字架@iharob –

+0

我认为eclipse正在讲述这个,请发布文件。 –

+0

我如何发布文件,因为我是新手? –

0

反斜杠( '\')是shell的转义字符(/usr/bin/sh)。因此,在这一行:

gcc -I"C:\Users\Dylan Galea\workspace\5\source\" -O0 -g3 -Wall -c -fmessage- length=0 -MMD -MP -MF"5exe.d" -MT"5exe.o" -o "5exe.o" "../5exe.c" 

遵循source逃逸以下",字符串 "C:\Users\Dylan Galea\workspace\5\source\"被解析为具有不平衡报价反斜杠“\”。

执行下列操作之一:

逃离反斜杠: -

-I"C:\\Users\\Dylan Galea\\workspace\\5\\source\\" 

替换他们用斜杠:

-I"C:/Users/Dylan Galea/workspace/5/source/" 
+0

我删除了额外的\这是导致“被转义,它的工作,但它不是给了我另一个错误.. –

+0

@DylanGalea新的”错误“是(如你所见)只是一个编译器警告你的程序包含一个未使用的局部变量,忽略警告或删除变量,这与最初发布的问题没有任何关系,你说我的答案已经解决,你不能回收一个SO问题来构成一个开放式的问题。一个新问题,请提出一个新问题,请参阅SO上的[如何接受答案](http://stackoverflow.com/help/accepted-answer)。 –