QQ登录

只需要一步,快速开始

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

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

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

4

主题

3

听众

18

积分

升级  13.68%

该用户从未签到

跳转到指定楼层
1#
发表于 2011-5-23 12:06 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
本帖最后由 tomorrow0530 于 2011-5-23 12:07 编辑 / \6 `& U3 K8 t
; U. u  U" W, h
现需要c++来调用lingo文件
" r( V$ M# a% i" n9 H我用lingo目录下C:\LINGO11\Programming Samples\VC++\**自带的文件,
. g; H( y& A7 k8 t7 L; [% l新建了一个工程,
3 d6 O2 X( W6 {3 e然后**.c文件加入工程,
$ M2 n: g: `, L然后再把lingo11.lib添加到工程中,* y+ j5 P2 {, K, E

) W9 M1 J: a3 \# g8 s, Z! q& V但是编译报错!
  s, ?) W6 {8 x2 O直接编译报:4 T% r  c( h! ?, y2 c9 p0 O7 S: H" J
75 C:\LINGO11\Programming Samples\VC++\**\**.c invalid conversion from `int (*)(void*, void*, int, char*)' to `void (*)(void*, void*, int, char*)' 9 a! x0 m1 P8 f5 z  |
75 C:\LINGO11\Programming Samples\VC++\**\**.c   initializing argument 2 of `int LSsetCallbackErrorLng(void*, void (*)(void*, void*, int, char*), void*)'
0 l9 z# Q3 J! }2 `) G' V3 E7 `
用**目录下的makefile文件编译报:+ Y4 w: |2 g' Y
  CreateProcess((null), cl -c **.c, ...) failed. 9 J/ ?  R9 @0 ]# ]
  系统找不到指定的文件。
0 O1 X' _8 z" O# S9 D' d' `5 xC:\LINGO11\Programming Samples\VC++\**\Makefile [Build Error]  [**.obj] Error 2
  m3 e# O7 D, A- @我用的C++编译器是devC++4.9.9.2
/ y& C1 V! n# I% U8 y# \$ n有人成功过吗?
) a1 }" [: N  ~) @' k# J3 T( u
zan
转播转播0 分享淘帖0 分享分享0 收藏收藏0 支持支持0 反对反对0 微信微信

4

主题

3

听众

18

积分

升级  13.68%

该用户从未签到

本帖最后由 tomorrow0530 于 2011-5-23 12:08 编辑 % b/ r9 H" v$ ~- S

! I# q0 |0 s" b为什么我输入了s i m p l e变成**了
回复

使用道具 举报

4

主题

3

听众

18

积分

升级  13.68%

该用户从未签到

在直接编译下我把75行的注释后,编译没有错了,但是链接出错了,说明还是没有链接成功
7 V2 x+ l5 e' O( m提示
1 e) Z( z! `+ NCompiler: Default compiler. A* `! V) s: N( {* I' h. H
Building Makefile: "C:\LINGO11\Programming Samples\C++\**\Makefile.win"
2 x; ?& q8 Q' A# @' K' V/ I* l# xExecuting  make...1 F/ [; ?2 x) o4 d1 x" C! M
make.exe -f "C:\LINGO11\Programming Samples\C++\**\Makefile.win" all7 p. t/ n/ M- r0 f. O
g++.exe **.o  -o "Project1.exe" -L"C:/Dev-Cpp/lib"   
% L6 T- I% n/ _2 [( M5 M! N
' N' A: e, k9 R**.o(.text+0x15c):**.c: undefined reference to `LScreateEnvLng@0'0 g6 H' K/ {& N+ x
**.o(.text+0x1a6):**.c: undefined reference to `LSsetCallbackSolverLng@12'
; J9 y9 b& q5 U% M, V2 r2 T& o3 B**.o(.text+0x1eb):**.c: undefined reference to `LSopenLogFileLng@8'1 n3 d4 H6 J& W
**.o(.text+0x224):**.c: undefined reference to `LSsetPointerLng@12'* P% O/ m# p# f, B. o
**.o(.text+0x25d):**.c: undefined reference to `LSsetPointerLng@12'
( y/ @1 U8 T1 p- ^( F**.o(.text+0x296):**.c: undefined reference to `LSsetPointerLng@12'# B- ~! E* z2 u, c! w
**.o(.text+0x2cf):**.c: undefined reference to `LSsetPointerLng@12'
7 _/ k& k5 t9 T9 x**.o(.text+0x308):**.c: undefined reference to `LSsetPointerLng@12'+ u8 Z' S- O9 D: R' Z, U2 J
**.o(.text+0x341):**.c: more undefined references to `LSsetPointerLng@12' follow
( m. ]9 d0 s& u9 @  c**.o(.text+0x3bf):**.c: undefined reference to `L**ecuteScriptLng@8'
# r3 R2 ]. A1 V# q! t9 [**.o(.text+0x3e1):**.c: undefined reference to `LScloseLogFileLng@4'. `. v' r5 Y) i" t( r5 v2 u* ?
**.o(.text+0x460):**.c: undefined reference to `LSdeleteEnvLng@4'
* \% b! P6 }6 W( i( W# E: U. _9 kcollect2: ld returned 1 exit status
% h0 W& r: @4 v- ]2 Q
2 j, D' |2 ]: R3 q$ L4 U, s6 l+ pmake.exe: *** [Project1.exe] Error 1
3 R# y% f! C4 D) {% o+ P! l5 x5 Q. v! `4 h2 h" b8 z
Execution terminated8 \3 M0 ^, F; v# g/ E
回复

使用道具 举报

4

主题

3

听众

18

积分

升级  13.68%

该用户从未签到

本帖最后由 tomorrow0530 于 2011-5-23 15:21 编辑 5 t  ^5 B- C. M0 V" J2 O- u+ @

7 _# f3 e; `) x1 o! ]/ U( R0 B) BCompiler: Default compiler3 W) C. J! X% F6 [7 r7 F9 J8 w
Building Makefile: "C:\LINGO11\Programming Samples\C++\s imple\Makefile.win"  `2 q7 x+ m- g1 f7 t4 p6 X! T
Executing  make...
. l% h; g9 `1 g/ o+ Hmake.exe -f "C:\LINGO11\Programming Samples\C++\s imple\Makefile.win" all/ e# n" J! ^* t" \. W& n) t9 a; c
g++.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"../../"   5 |1 n1 D2 i1 I2 p( e5 D4 }
: `/ h5 O$ w7 H1 }, H
g++.exe S imple.o  -o "Project1.exe" -L"C:/Dev-Cpp/lib" -L"C:/LINGO11/Programming Samples" ../../Lingd11.lib  
) G& [! c* ]% T& Q
7 f( ~( r$ i) @
S imple.o(.text+0x15c):**.c: undefined reference to `LScreateEnvLng@0'
2 s3 }3 X4 |/ y" Y! GS imple.o(.text+0x1a6):**.c: undefined reference to `LSsetCallbackSolverLng@12'
4 ]) t) m2 Z" Q- a& x& r, U: \S imple.o(.text+0x1eb):**.c: undefined reference to `LSopenLogFileLng@8'/ v1 t& }0 g- k4 g: e2 S+ ?9 f; {8 n
S imple.o(.text+0x224):**.c: undefined reference to `LSsetPointerLng@12'
. Y. B$ s' S) n  ]+ a$ j**.o(.text+0x25d):**.c: undefined reference to `LSsetPointerLng@12'/ I$ w/ T; W" C$ y$ x9 U4 a) i; v
**.o(.text+0x296):**.c: undefined reference to `LSsetPointerLng@12') s5 J' ]  n# y0 v% @+ _
**.o(.text+0x2cf):**.c: undefined reference to `LSsetPointerLng@12'
$ ~7 m# M6 Q/ e**.o(.text+0x308):**.c: undefined reference to `LSsetPointerLng@12'- ^* k3 t) n# y1 `
**.o(.text+0x341):**.c: more undefined references to `LSsetPointerLng@12' follow: H# @  K% p- g( Q9 Q' ^
**.o(.text+0x3bf):**.c: undefined reference to `L**ecuteScriptLng@8'1 h4 }5 V* E1 x8 w( {
**.o(.text+0x3e1):**.c: undefined reference to `LScloseLogFileLng@4'
0 T3 h* V  M! ]/ T**.o(.text+0x460):**.c: undefined reference to `LSdeleteEnvLng@4') C- j- ]8 s* t2 @& h, Q, A
collect2: ld returned 1 exit status  W" v5 S. w, |# h$ C' {

5 w) X1 n3 L& V/ kmake.exe: *** [Project1.exe] Error 1& r, ~4 D0 O! p. y
% V: s. j* B. l
Execution terminated
0 B, I: k3 ^$ M2 x# n
6 a' \$ K' ?) |; I) O/ U这次的编译结果,应该是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, 2026-8-23 07:05 , Processed in 0.352024 second(s), 72 queries .

    回顶部