In this article, I would like to document the problems encountered when upgrading from IBM XLC 10.1 to XLC 17.1 (IBM Open XL C/C++ for AIX 17.1.0) and how to fix the following 12 errors.If you’ve encountered any other errors, feel free to share your comments with or without a solution.
1. Change cc to ibm-clang
First you need to change all the related cc
to ibm-clang
in the the global Makefile. for example:
- CC=cc
- CXX=xlC_r
- XCC=xlC_r
- MAKE_SHARED=xlC_r
+ CC=ibm-clang
+ CXX=ibm-clang_r
+ XCC=ibm-clang_r
+ MAKE_SHARED=ibm-clang_r
And check following link of Mapping of options to map new Clang options if any.
2. error: unknown argument: ‘-qmakedep=gcc’
- GEN_DEPENDENTS_OPTIONS=-qmakedep=gcc -E -MF $@.1 > /dev/null
+ GEN_DEPENDENTS_OPTIONS= -E -MF $@.1 > /dev/null
3. should not return a value [-Wreturn-type]
4. error: non-void function ‘main’ should return a value [-Wreturn-type]
5. error: unsupported option ‘-G’ for target ‘powerpc64-ibm-aix7.3.0.0’
- LIB_101_FLAGS := -G
+ LIB_101_FLAGS := -shared -Wl,-G
6. Undefined symbol (libxxxx.so)
- LIB_10_FLAGS := -bexport:$(SRC)/makefiles/xxxx.def
+ LIB_10_FLAGS := -lstdc++ -lm -bexport:$(SRC)/makefiles/xxxx.def
7. unsupported option -qlongdouble
- drv_connect.c.CC_OPTIONS=$(CFLAGS) -qlongdouble -brtl
+ drv_loadfunc.c.CC_OPTIONS=$(CFLAGS) $(IDIR) -brtl
8. Undefined symbol: ._Z8u9_closei
- extern int u9_close(int fd) ;
+ extern "C" int u9_close(int fd) ;
9. ERROR: Undefined symbol: .pow
- CXXLIBES = -lpthread -lC -lstdc++
+ CXXLIBES = -lpthread -lC -lstdc++ -lm
10. ‘main’ (argument array) must be of type ‘char **’
- d_char *argv[];
+ char *argv[];
11. first parameter of ‘main’ (argument count) must be of type ‘int’
- int main(char *argc, char *argv[])
+ int main(int argc, char *argv[])
12. ERROR: Undefined symbol: ._ZdaPv
- LIB_3_LIBS := -lverse -llog_nosig
+ LIB_3_LIBS := -lverse -llog_nosig -lstdc++
声明: 本网站刊载的所有内容,包括文字、图片、音频、视频、软件、程序、以及网页版式设计等如无特殊说明或标注,均在网上搜集。仅供访问者个人学习、研究或欣赏,禁止商业性或盈利性用途,访问者应遵守著作权法的规定,在使用时征得本站和原著作权人的同意并支付许可使用费。本网站刊登内容,如有侵权请权利人予以告知,本站将立即予以删除。