二级士官
UID2959265
U币1
G币245
技术0
主题2
精华0
阅读权限40
注册时间2017-9-21
最后登录2022-4-27
在线时间21 小时
二级士官
|
本人初学者,严格按照教程配置VC环境,为何敲完代码构建时报错。代码如下
#include <stdio.h>
#include <uf.h>
#include <uf_modl.h>
#include <uf_ui.h>
#define UF_CALL(X) (report( __FILE__, __LINE__, #X, (X)))
static int report( char *file, int line, char *call, int irc)
{
if (irc)
{
char messg[133];
printf("%s, line %d: %s\n", file, line, call);
(UF_get_fail_message(irc, messg)) ?
printf(" returned a %d\n", irc) :
printf(" returned error %d: %s\n", irc, messg);
}
return(irc);
}
static void do_ugopen_api(void)
{
UF_FEATURE_SIGN sign = UF_NULLSIGN;
UF_FEATURE_SIGN sign1 = UF_POSITIVE;
double block_orig[3] = {0.0,0.0,0.0};
double block_orig1[3] = {0.0,0.0,2.5};
char *block_len[3] = {"1","2","3"};
char *block_len1[3] = {"1", "1", "1"};
tag_t blk_obj;
tag_t blk1_obj;
UF_CALL(UF_MODL_create_block1(sign, block_orig, block_len, &blk_obj));
UF_CALL(UF_MODL_create_block1(sign1, block_orig1, block_len1, &blk1_obj));
}
/*ARGSUSED*/
void ufusr(char *param, int *retcode, int paramLen)
{
if (!UF_CALL(UF_initialize()))
{
do_ugopen_api();
UF_CALL(UF_terminate());
}
}
int ufusr_ask_unload(void)
{
return (UF_UNLOAD_IMMEDIATELY);
}
看网上说要加个头文件#include <stdafx>,实验发现没有用,错误显示为各种未声明变量。
|
|