最近使用 fluent14.0 udf的时候编译总是出现问题,经过在网上查找资料,自己摸索终于解决了。
第一个问题:编译的时候出现:
https://www.gofarlic.com\PROGRA~1\ANSYSI~1\v140\fluent\fluent14.0.0\cortex\src\cx.h(46) : error C2632: 'long' followed by 'long' is illegal
https://www.gofarlic.com\PROGRA~1\ANSYSI~1\v140\fluent\fluent14.0.0\src\storage.h(2794) : error C2010: '.' : unexpected in macro formal parameter list
https://www.gofarlic.com\PROGRA~1\ANSYSI~1\v140\fluent\fluent14.0.0\src\storage.h(2794) : error C2010: '.' : unexpected in macro formal parameter list
https://www.gofarlic.com\PROGRA~1\ANSYSI~1\v140\fluent\fluent14.0.0\src\storage.h(2794) : error C2010: '.' : unexpected in macro formal parameter list
https://www.gofarlic.com\PROGRA~1\ANSYSI~1\v140\fluent\fluent14.0.0\src\storage.h(2799) : error C2010: '.' : unexpected in macro formal parameter list
https://www.gofarlic.com\PROGRA~1\ANSYSI~1\v140\fluent\fluent14.0.0\src\storage.h(2799) : error C2010: '.' : unexpected in macro formal parameter list
https://www.gofarlic.com\PROGRA~1\ANSYSI~1\v140\fluent\fluent14.0.0\src\storage.h(2799) : error C2010: '.' : unexpected in macro formal parameter list
解决办法:找到cx.h的46行删掉多余的long,同理改掉后面的问题。
第二个问题:编译的时候出现:
# Generating udf_names.c because of makefile huangdong.obj
udf_names.c
udf_names.c(7) : error C2059: syntax error : '}'
udf_names.c(8) : warning C4034: sizeof returns 0
Done.
解决办法:在c++中输入宏命令的时候前面不能有空格。
哪位兄弟在使用中出现了问题,可以拿出来讨论下。