Comments (13)
extern "system"
是没错的,因为win下我就是用的stdcall
方式。至于无法链接,我只提供了64位的liblcl.dll
和liblcl.lib
,32位的dll可以在govcl项目中下载,32位的liblcl.lib可以用apptest
目录下的genlib.bat
生成。
from rust-vcl.
我是用的32位的dll生成的lib,但是就是会报大量的LINK2019
'librust_vcl-6bfd44d4010f45cf.rlib(rust_vcl-6bfd44d4010f45cf.rust_vcl.c67hlxnr-cgu.15.rcgu.o) : error LNK2019: 无法解析
的外部符号 __imp__Printer_Instance@0,该符号在函数 __ZN4core3ops8function6FnOnce9call_once17h10386a96de90124fE 中被引用\
r\n'
我是用msvc生成的lib.
from rust-vcl.
这个问题的原因我找了下,是因为x86下__stdcall
修饰名的问题, 因为liblcl.dll不是vc生成的,用vc的lib.exe生成的lib不符合__stdcall修饰名。。。 是个很蛋疼的问题。。。
from rust-vcl.
应该不是这个问题吧,我尝试用C++调用liblcl是可以正常执行的。
from rust-vcl.
我测试了,是这个问题来着。修正 修饰名 编译正常。至于c++调用你要用的liblcl.h的话那个是动态调用的,不存在修饰名问题。
from rust-vcl.
感谢帮助,我写了个脚本处理了下def文件可以了。
from rust-vcl.
我用masm的工具生成了lib,测试了可以的,不知道你用的哪种方式
from rust-vcl.
还是有问题,编译过了 运行导入表又不一致。
from rust-vcl.
cargo rustc --target=i686-pc-windows-msvc -- -C link-args="/SAFESEH:NO"
这是我用masm工具链生成的32位的liblcl.lib
from rust-vcl.
可以了 ,感谢。
from rust-vcl.
我又测试了下,可以正常编译,但是跑不起来:
#![windows_subsystem = "windows"]
#![allow(non_snake_case)]
#![allow(dead_code)]
// #[cfg(target_os = "windows")]
use rust_vcl::fns::*;
use rust_vcl::types::*;
use rust_vcl::vcl::*;
fn main() {
Application.SetMainFormOnTaskBar(true);
let form = Application.CreateForm();
form.SetCaption("你好,Rust! - Hello Rust!");
Application.Run();
}
from rust-vcl.
我测试是可以跑起来的,原来的例子因为要加载一个ico文件,govcl中的dll有点不一样,所以不会的错误提示,新的dll和命令行编译我都放仓库里面了,你可以pull下,里面有win32和win64的dll和lib,
from rust-vcl.
谢谢,试了可以跑起来了,原来我代码有点问题。
from rust-vcl.
Related Issues (7)
- MessageDlg相关问题 HOT 4
- TNotifyEvent捕获问题 HOT 18
- 类似TMouseButton的enum比较问题 HOT 2
- to_RustString导出 HOT 47
- Error HOT 23
- TTreeView类名不对 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rust-vcl.