当前位置: 技术问答>linux和unix
makefile 编译不过!
来源: 互联网 发布时间:2016-11-19
本文导语: 找了个网上的代码,需要写makefile,照着作者的写完 make时,缺报出错误!错误的意思没看懂!求请教! 错误: gcc -Wall -g -pthread -I/usr/local/Aria/include -L/usr/local/Aria/lib -lAria -lArNetworking -lAriaJava -lArNetworkingJava -o...
找了个网上的代码,需要写makefile,照着作者的写完 make时,缺报出错误!错误的意思没看懂!求请教!
错误:
gcc -Wall -g -pthread -I/usr/local/Aria/include -L/usr/local/Aria/lib -lAria -lArNetworking -lAriaJava -lArNetworkingJava -o Goto gotoActionExample.cpp
/usr/bin/ld: /tmp/ccvCsmcb.o: undefined reference to symbol 'operator delete(void*)@@GLIBCXX_3.4'
/usr/bin/ld: note: 'operator delete(void*)@@GLIBCXX_3.4' is defined in DSO /usr/lib/libstdc++.so.6 so try adding it to the linker command line
/usr/lib/libstdc++.so.6: could not read symbols: Invalid operation
collect2: ld 返回 1
make: *** [Goto] 错误 1
makefile:
1 SOURCE=gotoActionExample.cpp
2 OBJECTS=$(SOURCE:%.c=%.o)
3 TARGET = Goto
4 OPTION=-Wall -g -pthread
5 INCLUDEPATH= -I/usr/local/Aria/include
6 LIBPATH=-L/usr/local/Aria/lib
7 LIBS=-lAria -lArNetworking -lAriaJava -lArNetworkingJava
8 CC=gcc
9
10 $(TARGET):$(OBJECTS)
11 $(CC) $(OPTION) $(INCLUDEPATH) $(LIBPATH) $(LIBS) -o $(TARGET) $(OBJECTS)
12 clean:
13 -rm -f $(TARGET) *.o*~
请问 libstdc++.so.6 是什么文件阿!怎么找不到阿!上面提示的错误又是什么意思?怎么改正!?
错误:
gcc -Wall -g -pthread -I/usr/local/Aria/include -L/usr/local/Aria/lib -lAria -lArNetworking -lAriaJava -lArNetworkingJava -o Goto gotoActionExample.cpp
/usr/bin/ld: /tmp/ccvCsmcb.o: undefined reference to symbol 'operator delete(void*)@@GLIBCXX_3.4'
/usr/bin/ld: note: 'operator delete(void*)@@GLIBCXX_3.4' is defined in DSO /usr/lib/libstdc++.so.6 so try adding it to the linker command line
/usr/lib/libstdc++.so.6: could not read symbols: Invalid operation
collect2: ld 返回 1
make: *** [Goto] 错误 1
makefile:
1 SOURCE=gotoActionExample.cpp
2 OBJECTS=$(SOURCE:%.c=%.o)
3 TARGET = Goto
4 OPTION=-Wall -g -pthread
5 INCLUDEPATH= -I/usr/local/Aria/include
6 LIBPATH=-L/usr/local/Aria/lib
7 LIBS=-lAria -lArNetworking -lAriaJava -lArNetworkingJava
8 CC=gcc
9
10 $(TARGET):$(OBJECTS)
11 $(CC) $(OPTION) $(INCLUDEPATH) $(LIBPATH) $(LIBS) -o $(TARGET) $(OBJECTS)
12 clean:
13 -rm -f $(TARGET) *.o*~
请问 libstdc++.so.6 是什么文件阿!怎么找不到阿!上面提示的错误又是什么意思?怎么改正!?
|
gcc 改成g++
|
8 CC=gcc
==>
8 CC=g++
==>
8 CC=g++