QQ登录

只需要一步,快速开始

 注册地址  找回密码
查看: 9338|回复: 4
打印 上一主题 下一主题

[问题求助] C++调用lingo

[复制链接]
字体大小: 正常 放大

4

主题

3

听众

18

积分

升级  13.68%

该用户从未签到

跳转到指定楼层
1#
发表于 2011-5-23 12:06 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
本帖最后由 tomorrow0530 于 2011-5-23 12:07 编辑
  @6 k; d( F9 Q7 j8 x- ^6 }: Y+ s' Y; r
现需要c++来调用lingo文件
- e, k% Z, O" r' U我用lingo目录下C:\LINGO11\Programming Samples\VC++\**自带的文件,
3 h) t! n# w% @! y4 j6 M新建了一个工程,
' `6 Q6 o' d$ o然后**.c文件加入工程,
/ u( O9 F" X# ~8 V" R, F# s3 L1 D然后再把lingo11.lib添加到工程中,
# H6 V2 W" e: `9 Q" a2 d! M3 J* L% a& d! u" d7 O
但是编译报错!" _" a) U0 P. v1 N
直接编译报:
* N, p8 K" r* G1 F. M" I75 C:\LINGO11\Programming Samples\VC++\**\**.c invalid conversion from `int (*)(void*, void*, int, char*)' to `void (*)(void*, void*, int, char*)' 9 y, W( a# Y0 f
75 C:\LINGO11\Programming Samples\VC++\**\**.c   initializing argument 2 of `int LSsetCallbackErrorLng(void*, void (*)(void*, void*, int, char*), void*)' ' G& |/ _. l  x8 I
6 `4 b9 q; b7 S' p8 K; q* ?
用**目录下的makefile文件编译报:
/ s# E& C8 |- b" M7 q+ [  CreateProcess((null), cl -c **.c, ...) failed.
, X0 K  R+ a# [2 f$ Y! {  系统找不到指定的文件。 , b) ?- R- Z- f, m2 E) j
C:\LINGO11\Programming Samples\VC++\**\Makefile [Build Error]  [**.obj] Error 2 1 G: {0 a. S9 `# U% [
我用的C++编译器是devC++4.9.9.2
% S: L) R8 F0 S* g有人成功过吗?
' _0 X9 X% _4 ]3 F' m; y
zan
转播转播0 分享淘帖0 分享分享0 收藏收藏0 支持支持0 反对反对0 微信微信

4

主题

3

听众

18

积分

升级  13.68%

该用户从未签到

本帖最后由 tomorrow0530 于 2011-5-23 12:08 编辑 0 x! Z- N  A) S0 k

! o& P: v* j8 Q* `为什么我输入了s i m p l e变成**了
回复

使用道具 举报

4

主题

3

听众

18

积分

升级  13.68%

该用户从未签到

在直接编译下我把75行的注释后,编译没有错了,但是链接出错了,说明还是没有链接成功
2 T" d  C7 Y1 s提示. ^5 {2 I. R0 b7 W$ U
Compiler: Default compiler# y! \8 Q7 J% D$ v+ V
Building Makefile: "C:\LINGO11\Programming Samples\C++\**\Makefile.win"; d( n  ~9 g8 S  v( j0 g5 v0 K
Executing  make...) l6 ^/ a3 {9 H9 }7 f
make.exe -f "C:\LINGO11\Programming Samples\C++\**\Makefile.win" all
0 ^3 L+ X* u" _4 U6 N' ?  y& Gg++.exe **.o  -o "Project1.exe" -L"C:/Dev-Cpp/lib"   
' X' Q1 p& l* @4 N2 W& ?
; ]# [" o, l) c$ e1 B**.o(.text+0x15c):**.c: undefined reference to `LScreateEnvLng@0'( B8 V0 X6 l, Y" t% k. u: ]/ C
**.o(.text+0x1a6):**.c: undefined reference to `LSsetCallbackSolverLng@12'/ Z2 v, b' @; b% h
**.o(.text+0x1eb):**.c: undefined reference to `LSopenLogFileLng@8'
. Z  J  Z" p) e' ~**.o(.text+0x224):**.c: undefined reference to `LSsetPointerLng@12'% {( F# f# U9 p5 k6 Q
**.o(.text+0x25d):**.c: undefined reference to `LSsetPointerLng@12'
5 N: u8 D1 T2 o3 S  y  D**.o(.text+0x296):**.c: undefined reference to `LSsetPointerLng@12'
6 |0 f  N) N$ U# S**.o(.text+0x2cf):**.c: undefined reference to `LSsetPointerLng@12'
; [0 o  e2 j/ t5 L* `2 y- T1 u**.o(.text+0x308):**.c: undefined reference to `LSsetPointerLng@12'
- U5 }; K+ ^1 H# H**.o(.text+0x341):**.c: more undefined references to `LSsetPointerLng@12' follow: p0 a2 \" N9 X, j& V
**.o(.text+0x3bf):**.c: undefined reference to `L**ecuteScriptLng@8'
% p3 m. }  e* ]**.o(.text+0x3e1):**.c: undefined reference to `LScloseLogFileLng@4'
- Q2 Q: r: o& n8 z$ O* }**.o(.text+0x460):**.c: undefined reference to `LSdeleteEnvLng@4': b; m4 m( O% x  F; M
collect2: ld returned 1 exit status4 h& `7 c6 a% B* m9 B- m8 H1 _
0 _. O! F+ ]0 w$ R; O. {
make.exe: *** [Project1.exe] Error 1
  Q( X. m' R- _
! V) ]3 p. Z1 l( s) ^Execution terminated& M" X3 _7 U0 ]- `$ x9 q  A1 w$ B
回复

使用道具 举报

4

主题

3

听众

18

积分

升级  13.68%

该用户从未签到

本帖最后由 tomorrow0530 于 2011-5-23 15:21 编辑
$ R% y  k) E: l9 `( q; [- d* p. |
1 z# x4 `/ U6 g- ACompiler: Default compiler) b0 o4 z5 e6 Z0 |- R. d# \! b  c* q
Building Makefile: "C:\LINGO11\Programming Samples\C++\s imple\Makefile.win"
  e1 K" ]3 O/ Z2 dExecuting  make...
$ \( v! {9 ?- o4 \0 jmake.exe -f "C:\LINGO11\Programming Samples\C++\s imple\Makefile.win" all
5 R( P/ ^9 J1 l9 K' w: Fg++.exe -c S imple.c -o S imple.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include"  -I"C:/Dev-Cpp/include/c++/3.4.2/backward"  -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32"  -I"C:/Dev-Cpp/include/c++/3.4.2"  -I"C:/Dev-Cpp/include"  -I"../../"   
, A4 L' t( ~) i. c  j5 |' N, x6 z$ {/ x+ y7 U* }
g++.exe S imple.o  -o "Project1.exe" -L"C:/Dev-Cpp/lib" -L"C:/LINGO11/Programming Samples" ../../Lingd11.lib  
/ P$ U7 z8 x) E1 x$ m
5 o7 ]1 B3 E9 j, M; |: d& K
S imple.o(.text+0x15c):**.c: undefined reference to `LScreateEnvLng@0'
. a; `( w8 A$ X/ k# n' ?; CS imple.o(.text+0x1a6):**.c: undefined reference to `LSsetCallbackSolverLng@12'' b8 s1 c* E2 C* \
S imple.o(.text+0x1eb):**.c: undefined reference to `LSopenLogFileLng@8'
* ^- d- E7 @3 ], s/ G* X3 Q( E0 DS imple.o(.text+0x224):**.c: undefined reference to `LSsetPointerLng@12'% U& ~5 w+ f; t! }
**.o(.text+0x25d):**.c: undefined reference to `LSsetPointerLng@12'3 Q3 z3 q% O4 h  P+ W  }
**.o(.text+0x296):**.c: undefined reference to `LSsetPointerLng@12'. E: W1 F- p/ P4 p
**.o(.text+0x2cf):**.c: undefined reference to `LSsetPointerLng@12'
$ d8 I! e! b, N$ p  ^  r**.o(.text+0x308):**.c: undefined reference to `LSsetPointerLng@12'
# r; n, B! A5 k; B0 A**.o(.text+0x341):**.c: more undefined references to `LSsetPointerLng@12' follow
/ c  [# ]: t4 Z9 s/ V**.o(.text+0x3bf):**.c: undefined reference to `L**ecuteScriptLng@8'# L) f1 w2 n0 s" O. \
**.o(.text+0x3e1):**.c: undefined reference to `LScloseLogFileLng@4'
% `* i; P" b) Q5 B5 d  ?4 N**.o(.text+0x460):**.c: undefined reference to `LSdeleteEnvLng@4'
! y6 V( a2 [& x6 i1 \collect2: ld returned 1 exit status
# R) b3 S. B" w, n* |4 \" L: f( W
, M0 {/ W4 y! z! c( t4 \9 Emake.exe: *** [Project1.exe] Error 1# N6 }1 T% B4 J3 P4 Z& d) U% |

% n( r9 c6 V6 u5 p+ P( Z# IExecution terminated% I! I, [! E% u$ A2 ?5 |* W1 _

8 V& k" m" S0 r$ c7 O" k这次的编译结果,应该是s imple.o文件已经生成,但是生成project1.exe的时候出错了
回复

使用道具 举报

alair004        
头像被屏蔽

0

主题

4

听众

563

积分

升级  87.67%

  • TA的每日心情
    无聊
    2012-2-6 07:37
  • 签到天数: 4 天

    [LV.2]偶尔看看I

    提示: 作者被禁止或删除 内容自动屏蔽
    回复

    使用道具 举报

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

    qq
    收缩
    • 电话咨询

    • 04714969085
    fastpost

    关于我们| 联系我们| 诚征英才| 对外合作| 产品服务| QQ

    手机版|Archiver| |繁體中文 手机客户端  

    蒙公网安备 15010502000194号

    Powered by Discuz! X2.5   © 2001-2013 数学建模网-数学中国 ( 蒙ICP备14002410号-3 蒙BBS备-0002号 )     论坛法律顾问:王兆丰

    GMT+8, 2025-12-4 17:27 , Processed in 1.348337 second(s), 71 queries .

    回顶部