QQ登录

只需要一步,快速开始

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

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

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

4

主题

3

听众

18

积分

升级  13.68%

该用户从未签到

跳转到指定楼层
1#
发表于 2011-5-23 12:06 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
本帖最后由 tomorrow0530 于 2011-5-23 12:07 编辑
, f4 B9 Z% K- p. d+ n
1 f* [, ?. H8 Z0 Q现需要c++来调用lingo文件
) n* ~2 Q6 K; K  h) }2 U我用lingo目录下C:\LINGO11\Programming Samples\VC++\**自带的文件,/ E! W% A1 V+ R. t# }# I0 b2 ^
新建了一个工程,
) @0 A( l& b4 ?2 s# P  }* j/ ?; ~然后**.c文件加入工程,
+ e2 B1 j, Z% K然后再把lingo11.lib添加到工程中,
& x+ Y) a* x" q& N1 T$ u/ n. s, {5 W4 D
但是编译报错!& ?" @0 L! U& f  U3 B; S* o% u# v
直接编译报:
/ D& p# z4 m: p- W9 r75 C:\LINGO11\Programming Samples\VC++\**\**.c invalid conversion from `int (*)(void*, void*, int, char*)' to `void (*)(void*, void*, int, char*)' / L. x* D. Z, j5 \  s& z
75 C:\LINGO11\Programming Samples\VC++\**\**.c   initializing argument 2 of `int LSsetCallbackErrorLng(void*, void (*)(void*, void*, int, char*), void*)' ( v' @+ H* M2 p
, U: {/ C0 C+ S. V/ m
用**目录下的makefile文件编译报:% S/ R2 c( a" L2 I  K9 |
  CreateProcess((null), cl -c **.c, ...) failed. + A5 H: O7 P7 a. U- L
  系统找不到指定的文件。 ; [3 ^6 l' s) r) p9 ?/ L
C:\LINGO11\Programming Samples\VC++\**\Makefile [Build Error]  [**.obj] Error 2   g9 o' F2 B0 T! l- ^& I/ [
我用的C++编译器是devC++4.9.9.2
' K, C6 ]9 M( k- b4 c有人成功过吗?, a  [; ]+ \- ^$ F
zan
转播转播0 分享淘帖0 分享分享0 收藏收藏0 支持支持0 反对反对0 微信微信

4

主题

3

听众

18

积分

升级  13.68%

该用户从未签到

本帖最后由 tomorrow0530 于 2011-5-23 12:08 编辑 ; Z& i' S; W4 u+ p7 r/ }

( O) X  a( s* W7 P1 R9 i1 q0 q3 E) e为什么我输入了s i m p l e变成**了
回复

使用道具 举报

4

主题

3

听众

18

积分

升级  13.68%

该用户从未签到

在直接编译下我把75行的注释后,编译没有错了,但是链接出错了,说明还是没有链接成功
) L& v! f7 h; k提示
: W( L5 C1 G8 L# J2 l' I7 PCompiler: Default compiler1 e$ h1 a. L" z6 ^! G7 P4 J( u5 _
Building Makefile: "C:\LINGO11\Programming Samples\C++\**\Makefile.win"" v: R0 M2 e9 v! {7 [
Executing  make...7 B3 M' {) {) l& ^; ^# v( U
make.exe -f "C:\LINGO11\Programming Samples\C++\**\Makefile.win" all8 u  O0 U  \! e4 V' c! z. [/ X% x
g++.exe **.o  -o "Project1.exe" -L"C:/Dev-Cpp/lib"   0 N# {  f0 N% c& S' W

) K2 }1 j; C" z# i**.o(.text+0x15c):**.c: undefined reference to `LScreateEnvLng@0'1 P# N, Q; R, b- M  Z
**.o(.text+0x1a6):**.c: undefined reference to `LSsetCallbackSolverLng@12'; }/ ?# R( M( f  v$ b7 w6 E
**.o(.text+0x1eb):**.c: undefined reference to `LSopenLogFileLng@8'
0 |* ]$ k1 k: c2 T6 l**.o(.text+0x224):**.c: undefined reference to `LSsetPointerLng@12'
6 n: t4 {3 Q$ F- A**.o(.text+0x25d):**.c: undefined reference to `LSsetPointerLng@12'
3 `- B$ s) v: H" M" w5 b3 y**.o(.text+0x296):**.c: undefined reference to `LSsetPointerLng@12'
: N. b+ K  P, V, }( O**.o(.text+0x2cf):**.c: undefined reference to `LSsetPointerLng@12'
/ R- ^  H+ H+ L3 Y; Q4 j" k**.o(.text+0x308):**.c: undefined reference to `LSsetPointerLng@12'
* k; B( {2 \. G8 y**.o(.text+0x341):**.c: more undefined references to `LSsetPointerLng@12' follow- l+ A# |( ~% G/ c& Y7 g: S- o$ U
**.o(.text+0x3bf):**.c: undefined reference to `L**ecuteScriptLng@8'+ O6 ^( b+ u9 p% o7 Q
**.o(.text+0x3e1):**.c: undefined reference to `LScloseLogFileLng@4'
& h, h, E- u) g" i) B**.o(.text+0x460):**.c: undefined reference to `LSdeleteEnvLng@4'
3 [" v9 d( x* r7 C: @# Icollect2: ld returned 1 exit status0 w, w! e2 \( s% O2 l/ m

7 V( L2 J1 p# A6 ~9 O8 O1 wmake.exe: *** [Project1.exe] Error 1
: ?4 l8 Q2 E3 x# _5 I$ e* Y) w9 x2 x: k( M6 V
Execution terminated5 H* D- ^4 G% e, O
回复

使用道具 举报

4

主题

3

听众

18

积分

升级  13.68%

该用户从未签到

本帖最后由 tomorrow0530 于 2011-5-23 15:21 编辑
& b7 i* F. ]' u0 G  K4 z+ O
4 S" L% G( S5 m; w. n' e( |4 D9 H3 n. [, TCompiler: Default compiler
, r% _/ [. [! O/ G) n( ^; J7 XBuilding Makefile: "C:\LINGO11\Programming Samples\C++\s imple\Makefile.win"9 C* @( o6 U6 s' r3 w0 n! a4 d
Executing  make...* B5 c: |6 U+ }9 F
make.exe -f "C:\LINGO11\Programming Samples\C++\s imple\Makefile.win" all( J- Z: J7 [6 y' l$ E, F
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"../../"   3 `0 k* a# A4 S2 ?, h: f8 b& P( L9 G  R& s
7 N; h3 \, G( r9 }# Z" o8 L
g++.exe S imple.o  -o "Project1.exe" -L"C:/Dev-Cpp/lib" -L"C:/LINGO11/Programming Samples" ../../Lingd11.lib  
" [& F# g$ Y9 c: b# N6 g+ T
8 M9 q3 k8 M. f- G9 J* ~1 @
S imple.o(.text+0x15c):**.c: undefined reference to `LScreateEnvLng@0'( r: o: p# d3 s
S imple.o(.text+0x1a6):**.c: undefined reference to `LSsetCallbackSolverLng@12'
# {) B* U6 a* W1 v% dS imple.o(.text+0x1eb):**.c: undefined reference to `LSopenLogFileLng@8'
8 F1 ^0 z1 D5 B9 {5 HS imple.o(.text+0x224):**.c: undefined reference to `LSsetPointerLng@12'
! z2 L4 M* {! }- V, s0 _**.o(.text+0x25d):**.c: undefined reference to `LSsetPointerLng@12'% H! ?* I, \. P0 |& U; j! G
**.o(.text+0x296):**.c: undefined reference to `LSsetPointerLng@12'
  b' c( L: Z6 y3 {% H) u; v**.o(.text+0x2cf):**.c: undefined reference to `LSsetPointerLng@12'5 o- L4 q1 W5 |! E( P) J8 P: o/ [
**.o(.text+0x308):**.c: undefined reference to `LSsetPointerLng@12'
# J: d2 z9 \4 F8 O* W**.o(.text+0x341):**.c: more undefined references to `LSsetPointerLng@12' follow  J; N" y. Q2 o, j# L  E( P
**.o(.text+0x3bf):**.c: undefined reference to `L**ecuteScriptLng@8', U' L& V( @1 r4 u
**.o(.text+0x3e1):**.c: undefined reference to `LScloseLogFileLng@4'4 H9 R5 ~) P8 h# S, e& H
**.o(.text+0x460):**.c: undefined reference to `LSdeleteEnvLng@4'( s9 d% E2 b8 q( l
collect2: ld returned 1 exit status
9 P; z  L8 a, K. L" G$ C& d7 d& D% E6 ^& Z& z
make.exe: *** [Project1.exe] Error 1' g- \* B  {+ [$ |; R$ R+ K! l
$ l/ v2 J# `' ]- w
Execution terminated( G* Z! E3 z& L, d5 O! a. {
! `7 I: l; K7 S' d
这次的编译结果,应该是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, 2024-4-28 20:57 , Processed in 0.470763 second(s), 71 queries .

    回顶部