|
最近在学ug二次开发,想先编一个最简单的长方体遇到了困难,API,内部,C++,程序总是有一个错误,unexpected end of file while looking for precompiled header directive,环境配置完全按照书上说的设置,网上各种解决办法都试了还是不行,麻烦您给我指导下,究竟该怎么办,非常感谢啊,以下是我的程序:
' _7 A/ x# n2 i1 ` j$ Q0 ?/ V& R#include "stdafx.h"+ |% h( j+ O. W/ S
! O# ^6 r; a0 ?3 {! k! n7 I
#include "uf.h"
- F! i1 P8 d" |* s#include "uf_modl.h"( E) S$ q' u% `# s) e
#include "uf_ui.h"5 C4 `" k$ W1 N# q
#include "uf_UGopenint.h"
9 V$ r D% J9 d% `; P
0 B* ~ ~4 O& H7 F5 v x#define UF_CALL(X)(report(_ _FILE_ _,_ _LINE_ _,#X,(X)))
% W/ o( F; {/ {% P' e+ U0 nstatic int report (char *file,int line,char *call,int irc)* d! ^( s; N2 f2 Y
{
" e& X Z0 Y" b5 K" J2 y+ o- ^ if (irc)
- {0 i: N! j4 h) G/ n0 ` {char msg[133];) o( n' T# c; s; }2 T1 a4 t
printf ("%s,line%d:%s\n",file,line,call);
) e6 u3 l' E* O! Y (UF_get_fail_message(irc,msg))?/ k2 M$ a+ T! U& e, ~; X
printf("returned a %d\n",irc):
% l# U0 B' ~# M printf("returned error %d:%s\n",irc,msg);
1 |' y: y' ~' S# q }* \& E. I/ R. M+ h" l: Q: R2 \
return(irc);
. a4 ?" t1 }) S# S8 n( _$ W}9 B3 A2 t" S% f. ]6 H0 ?
" t& G3 _4 y* B7 T
static void do_ugopen_api(void)
6 k$ C1 j6 x+ D! k{UF_FEATURE_SIGN sign=UF_NULLSIGN;
/ ^+ s& G- A) x! w- `6 ^( x) T: X' Rdouble block_orig[3]={0.0,0.0,0.0};
9 x( w$ X$ ]7 y$ B* ^, `char *block_len[3]={"1","2","3"};
- J/ S0 v9 F, s8 ?. U/ vtag_t blk_obj;/ \% Y9 x& y2 v6 j1 m
UF_CALL(UF_MODL_create_block1(sign,block_orig,block_len,&blk_obj));
' {, W6 `& R8 ]+ s, @$ \}7 |$ H6 J% a- E8 J% [, u
4 M y& U5 i- _7 v9 j4 G% a
void ufusr(char *param,int *retcode,int paramLen)
* }& j: N2 I% ~! Y# d{
7 N _5 W* m3 Q0 o if (!UF_CALL(UF_initialize()))
0 L1 S. G: ]3 M v8 g{do_ugopen_api();
, z/ ~& R, Z0 t# o& t6 b UF_CALL(UF_terminate());
7 V) B+ N( K1 S9 y% O4 k* b}
& x4 d- f6 m7 \2 j* h: p) Lelse
# R1 y' x. S& u) c{uc1601("获取开发许可失败,退出",1);' l4 j( z$ i/ ?7 }
}
( T! i7 O1 ]" n0 L) i}* b7 l' Q6 n, _
$ q+ K( |5 t; o: y
int ufusr_ask_unload(void)
. u/ N' T0 Z w1 T# j( I2 G{ B* n9 b3 a0 z' B! y5 C0 h
return (UF_UNLOAD_IMMEDIATELY);6 p5 l7 Z2 v0 I( a8 ` O
} |
|