青华模具培训学校

 找回密码
 注册

QQ登录

只需一步,快速开始

青华模具培训学院
查看: 2618|回复: 3

[疑难] vc 编程高手求解

[复制链接]
发表于 2011-3-24 15:50 | 显示全部楼层 |阅读模式
为什么用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文件啊 怎么办?? 强调我是新手
发表于 2011-3-24 16:04 | 显示全部楼层
执行 cl.exe 时出错.5 c9 D6 b" X6 r! F- f' D: S( ?; W9 M
CreateBlock.exe - 1 error(s), 0 warning(s)
( K' S& Z( v" {% y' H; T$ G1 R9 C5 F8 o+ d
1 P# d$ r1 y9 x5 }1 a2 P- p2 |- a1 N4 H% {# P4 D3 {6 [
: @8 t7 o3 H2 T& G. j& e5 l; T2 \+ H

# l  N6 _* P' R5 R+ ]; ?你这即是编对了也生成不了DLL文件!你用的是外部模式,生成的是EXE。- k" q- k; @) X' b: E" d
我没有细看,你想创建一个BLOCK吧,头文件没有加全。
4 a% {5 s& T, x3 b! Z5 i把程序发给我看看……
回复 支持 反对

使用道具 举报

发表于 2011-3-28 16:12 | 显示全部楼层
晕,什么破程序啊。呵呵
回复 支持 反对

使用道具 举报

发表于 2011-9-29 10:17 | 显示全部楼层
[img] VC 没设置好
1.jpg
2.jpg
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|关于我们|sitemap|小黑屋|Archiver|手机版|UG网-UG技术论坛-青华数控模具培训学校 ( 粤ICP备15108561号 )

GMT+8, 2025-6-29 22:43 , Processed in 0.060154 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表