|
为什么用vc6.0 组建后就是有一个错误,怎么也解决不来!!
6 \7 f: }5 [, T+ k2 K: v- h# `( n9 s( J% n) `; C8 E) n9 P
程序如下:挺简单的
# x9 h" R2 k2 b, Q% w* V/ r
/ i, S4 h5 o) e; {( y: \& f3 m#include <stdio.h>
5 W" {+ K5 G: T4 }$ G! f4 k( m' v#include <uf.h>
& n& y8 \, C7 M% }#include <uf_modl.h>2 S, t. Y' N( m' `! a/ c( {9 g
#define UF_CALL(X) (report( __FILE__, __LINE__, #X, (X)))6 B. w0 S, F+ m
static int report( char *file, int line, char *call, int irc)
2 s3 f& r- j/ x; M3 Q{' I7 o4 a7 i4 Q0 f5 ?! j
if (irc)
3 @, j( r- u% Z6 g {$ G0 ?0 w5 v V; I7 H3 [
char messg[133];0 o8 }2 n& }' H; s$ B3 s2 W$ }' n
printf("%s, line %d: %s\n", file, line, call);' v& I5 z+ e% L
(UF_get_fail_message(irc, messg)) ?
- Y; {4 W7 W& p; Y4 I printf(" returned a %d\n", irc) :
7 r0 l; U+ l% a; |- m' l& I9 ` printf(" returned error %d: %s\n", irc, messg);
1 V" D8 [4 {9 ^- C8 K" H }' m3 ?: X* {! E' Y3 l* B/ |
return(irc);3 }* n& r+ R+ {1 X6 |
}
/ N" r" N$ S1 X. nstatic void do_ugopen_api(void)
( ~4 l. P0 K$ b: I: J{
6 f( N* G$ Y/ L /* 用户在此编写自己的UF程序 */5 M% P6 ]9 m: i3 W: W. z5 v! `# _9 K
UF_FEATURE_SIGN sign = UF_NULLSIGN;
6 e! o2 ]4 Z. h9 |: G% C& }( { double block_orig[3] = {0.0,0.0,0.0};
; R2 e2 a1 h$ M' L. \ char *block_len[3] = {"1","2","3"};
# l6 u1 z* j Z1 l tag_t blk_obj;
- ~* x+ k7 `+ D* P P UF_CALL(UF_MODL_create_block1(sign, block_orig, block_len, &blk_obj));
' k6 W* F6 C1 \/ w}& r! K2 C3 Z3 o0 Z0 _$ i) Y
/*ARGSUSED*/4 w0 O& ^; q$ l9 X
void ufusr(char *param, int *retcode, int paramLen)
7 T; b$ d( U3 L# R1 U9 v; s{
4 x- q8 y# Z2 e3 v* G( M, y 9 W: {% F# s% `5 g: w$ I( y+ d7 V
+ |8 B2 W! c* c! B) t1 s if (!UF_CALL(UF_initialize()))
, Y, |5 i9 X# T" _3 D+ C {. s0 Z4 D9 Z' L# C& @1 F
do_UGopen_api();
, k' u) X( X) K UF_CALL(UF_terminate());& t9 K: c+ G; |) k' I: M, L% T1 u
}
6 {9 d: Q! `- w- }}( I9 N7 N5 s7 l( _3 U
int ufusr_ask_unload(void)
! {1 g' B5 u7 y: M$ n0 i0 n{4 j% A% |) k# c4 q6 [" k/ r6 O3 r3 v# s
return (UF_UNLOAD_IMMEDIATELY);- }# t7 b+ W R/ Y) [* T
}
! ^# W2 Q m- S3 J+ }, F2 _7 q% j( X3 ?! \* R9 H4 s
1 M5 W1 I, P; V- e5 D
; j* t! H0 r' @% X& U% b0 \) ~/ s5 v" D* Y
错误显示:3 y) O9 k" M- H
Compiling...6 O: ^5 V( x) ]. W& D7 k& i. l+ S" E$ T. K
create block.cpp, R8 x. K7 s: m, s/ Z5 ^' b+ U3 W
G:\UG\ugbook\create block\create block.cpp(11) : error C2065: 'printf' : undeclared identifier
1 t& _2 F. C3 O: mG:\UG\ugbook\create block\create block.cpp(12) : error C2065: 'erc' : undeclared identifier9 k7 e3 ~4 [4 h8 W* H. V% m2 Y+ B7 ]: |
G:\UG\ugbook\create block\create block.cpp(25) : error C2065: '_' : undeclared identifier7 }) N) Q* n( W& ^' T/ x0 i
G:\UG\ugbook\create block\create block.cpp(25) : error C2146: syntax error : missing ')' before identifier '_FILE_'
$ S0 h& }- w, _5 ` H5 w, j# F7 w4 NG:\UG\ugbook\create block\create block.cpp(25) : error C2059: syntax error : ')'
3 H" y( C" [' ?* I4 y/ HG:\UG\ugbook\create block\create block.cpp(29) : error C2146: syntax error : missing ')' before identifier '_FILE_'
$ |6 l& H/ L1 F1 R0 W9 nG:\UG\ugbook\create block\create block.cpp(29) : error C2059: syntax error : ')'$ h; {6 y( F4 }! p2 `& B& N3 O: T
G:\UG\ugbook\create block\create block.cpp(30) : error C2143: syntax error : missing ';' before '{'6 U: n" k7 {- ^" R' y
G:\UG\ugbook\create block\create block.cpp(32) : error C2146: syntax error : missing ')' before identifier '_FILE_'" v$ A. g# [3 I5 A, `5 r
G:\UG\ugbook\create block\create block.cpp(32) : error C2059: syntax error : ')'
( i* A9 p7 r) P2 N1 bG:\UG\ugbook\create block\create block.cpp(34) : error C2181: illegal else without matching if7 U- W* |8 c6 W( B, t3 j; c2 R: e. V
执行 cl.exe 时出错., N9 T2 {" s+ L7 z
CreateBlock.exe - 1 error(s), 0 warning(s)$ m \0 s, Y7 N# g
, {! a8 ?3 \' z Y X _
& N. ~: n, V3 E" P% ^4 b0 ]2 L无法生出dll文件啊 怎么办?? 强调我是新手 |
|