QQ登录

只需要一步,快速开始

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

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

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

4

主题

3

听众

18

积分

升级  13.68%

该用户从未签到

跳转到指定楼层
1#
发表于 2011-5-23 12:06 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
本帖最后由 tomorrow0530 于 2011-5-23 12:07 编辑 9 v9 p1 b, h' S/ l
+ s  s( Q+ V4 e8 }
现需要c++来调用lingo文件
! N$ w1 p1 V  V( N  W8 X) w我用lingo目录下C:\LINGO11\Programming Samples\VC++\**自带的文件,9 r& U! c* z6 [" ]9 Z" ?$ D1 G5 C
新建了一个工程,  j8 w' o% E2 ^: @) P$ x" @4 V
然后**.c文件加入工程,# y5 f, }4 D: R1 A8 K1 i
然后再把lingo11.lib添加到工程中," K, c9 e0 }. W; l3 z" f; }% N
8 d7 F7 h# L* _: r( p" s
但是编译报错!# f5 D: ~4 E  ]& a. ?* K
直接编译报:
3 i3 L1 p' ?7 [1 M* I75 C:\LINGO11\Programming Samples\VC++\**\**.c invalid conversion from `int (*)(void*, void*, int, char*)' to `void (*)(void*, void*, int, char*)' - C9 g: ?: O) Q7 ?5 k3 J
75 C:\LINGO11\Programming Samples\VC++\**\**.c   initializing argument 2 of `int LSsetCallbackErrorLng(void*, void (*)(void*, void*, int, char*), void*)'
' O4 x9 g# q! J" k
! r: {& S5 r  J用**目录下的makefile文件编译报:& @. }! I! d, Z/ r
  CreateProcess((null), cl -c **.c, ...) failed.
. m* ]8 k* A8 D/ k& \) ]6 b/ N  系统找不到指定的文件。 ) `2 q( |9 u8 J4 T& v
C:\LINGO11\Programming Samples\VC++\**\Makefile [Build Error]  [**.obj] Error 2
2 w$ M9 d! V, m/ _我用的C++编译器是devC++4.9.9.2
, g8 e" x9 l2 X' @, L有人成功过吗?" i: `# q9 n* ]( o$ d/ ^, i! Q
zan
转播转播0 分享淘帖0 分享分享0 收藏收藏0 支持支持0 反对反对0 微信微信

4

主题

3

听众

18

积分

升级  13.68%

该用户从未签到

本帖最后由 tomorrow0530 于 2011-5-23 12:08 编辑   u9 A& m( x9 F) g3 f# S  L5 c

% l6 J& E/ O" h! ~; w7 W为什么我输入了s i m p l e变成**了
回复

使用道具 举报

4

主题

3

听众

18

积分

升级  13.68%

该用户从未签到

在直接编译下我把75行的注释后,编译没有错了,但是链接出错了,说明还是没有链接成功$ V7 y* `' n" a
提示' F2 [" d5 R& i& q  g
Compiler: Default compiler' P  }1 m( Y+ ]$ k/ b9 U
Building Makefile: "C:\LINGO11\Programming Samples\C++\**\Makefile.win"* u. t) ~, Z/ V
Executing  make...
1 L0 p( V: P$ Amake.exe -f "C:\LINGO11\Programming Samples\C++\**\Makefile.win" all& _% M) n/ H; i+ Y* S
g++.exe **.o  -o "Project1.exe" -L"C:/Dev-Cpp/lib"   
9 \0 k) ^- \( i; n9 ~
9 g; r2 \1 R' O- p**.o(.text+0x15c):**.c: undefined reference to `LScreateEnvLng@0'% h1 J& V9 \, i- O
**.o(.text+0x1a6):**.c: undefined reference to `LSsetCallbackSolverLng@12'
- z. M! ]0 d  ]. \8 N" ?**.o(.text+0x1eb):**.c: undefined reference to `LSopenLogFileLng@8'4 e" W) a, Y4 Y* E4 _
**.o(.text+0x224):**.c: undefined reference to `LSsetPointerLng@12'' `! a+ v- E9 A" I) W
**.o(.text+0x25d):**.c: undefined reference to `LSsetPointerLng@12'
" c; W9 A8 F4 X5 N2 e8 b1 W8 ~" Z1 E**.o(.text+0x296):**.c: undefined reference to `LSsetPointerLng@12'' c% |; g- `7 ]7 {0 _3 s
**.o(.text+0x2cf):**.c: undefined reference to `LSsetPointerLng@12'. ]/ q) @- E6 i2 J. ]0 Y/ s" d; f
**.o(.text+0x308):**.c: undefined reference to `LSsetPointerLng@12', o; Y0 V) l. _; T2 W# P
**.o(.text+0x341):**.c: more undefined references to `LSsetPointerLng@12' follow
* j% q1 l  d) g; t, V9 U3 W8 o**.o(.text+0x3bf):**.c: undefined reference to `L**ecuteScriptLng@8'
8 l+ T. v6 M: X% z& H3 g$ A0 C**.o(.text+0x3e1):**.c: undefined reference to `LScloseLogFileLng@4': i, s# Q/ x# M& _
**.o(.text+0x460):**.c: undefined reference to `LSdeleteEnvLng@4'/ }9 R& l8 j+ a; q! I( l
collect2: ld returned 1 exit status
: f6 P9 l" x' v2 ]3 _& O$ X: W8 E8 v& o" `
make.exe: *** [Project1.exe] Error 1
! I& |+ H( i7 x9 j( U4 H, M
9 H, p, Z$ |% p; I+ i9 Q) oExecution terminated
% U5 r: l) W+ v$ i: {6 e# ]
回复

使用道具 举报

4

主题

3

听众

18

积分

升级  13.68%

该用户从未签到

本帖最后由 tomorrow0530 于 2011-5-23 15:21 编辑 " p: W3 C$ N! [7 v& ^
" U: ~: o7 Z" C9 w8 [9 e& A% U* C
Compiler: Default compiler
, q: ?# _; _  u' P6 o4 B" i! GBuilding Makefile: "C:\LINGO11\Programming Samples\C++\s imple\Makefile.win"
! }+ a5 C  V2 E* V" TExecuting  make...# `/ {2 f+ E' Q" u
make.exe -f "C:\LINGO11\Programming Samples\C++\s imple\Makefile.win" all1 i4 _. _7 L3 o
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"../../"   
7 ~( F/ W& U/ f/ t- u7 o% D' A3 h5 C  f& U
g++.exe S imple.o  -o "Project1.exe" -L"C:/Dev-Cpp/lib" -L"C:/LINGO11/Programming Samples" ../../Lingd11.lib  
; M3 |4 V0 }5 p- B! C& x8 q8 z1 }. ^, R6 j
S imple.o(.text+0x15c):**.c: undefined reference to `LScreateEnvLng@0'' ]( R# [" g3 T: j& g3 n
S imple.o(.text+0x1a6):**.c: undefined reference to `LSsetCallbackSolverLng@12'1 }9 D$ c+ I/ ^8 j
S imple.o(.text+0x1eb):**.c: undefined reference to `LSopenLogFileLng@8'
3 a0 G# a! F6 ^2 K' Q, `) D7 O% lS imple.o(.text+0x224):**.c: undefined reference to `LSsetPointerLng@12', @. b4 G+ `. @/ @! o
**.o(.text+0x25d):**.c: undefined reference to `LSsetPointerLng@12'
- I8 U2 t$ P; u) c" B; \**.o(.text+0x296):**.c: undefined reference to `LSsetPointerLng@12'% L- |& _  `' [. |7 H3 U0 t0 A
**.o(.text+0x2cf):**.c: undefined reference to `LSsetPointerLng@12'
7 z  ^/ f- J2 I, @, D1 m**.o(.text+0x308):**.c: undefined reference to `LSsetPointerLng@12'
. H0 J7 B/ Z7 g; G**.o(.text+0x341):**.c: more undefined references to `LSsetPointerLng@12' follow
4 Y3 g- z; \: G# x' q**.o(.text+0x3bf):**.c: undefined reference to `L**ecuteScriptLng@8'
' ?8 }5 {9 A* C( ]- w**.o(.text+0x3e1):**.c: undefined reference to `LScloseLogFileLng@4'
3 Z8 H3 @; q5 l: f1 s7 R**.o(.text+0x460):**.c: undefined reference to `LSdeleteEnvLng@4'6 ], F+ u, @, f& Q- B- `( g
collect2: ld returned 1 exit status4 a- S4 x* G) b3 U5 |, Y
+ i# P7 C& E# H% \  [3 e* d
make.exe: *** [Project1.exe] Error 1
( [# z9 ^& m& w0 ^: _
' a# ?8 h; R) p- c( S2 MExecution terminated
. U  s/ m8 c% j7 W" d, Y( p" t. E
6 f- A  L9 e# b! f8 h5 l: h这次的编译结果,应该是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 06:48 , Processed in 0.507587 second(s), 72 queries .

    回顶部