Giter Club home page Giter Club logo

Comments (13)

ying32 avatar ying32 commented on May 26, 2024

extern "system"是没错的,因为win下我就是用的stdcall方式。至于无法链接,我只提供了64位的liblcl.dllliblcl.lib,32位的dll可以在govcl项目中下载,32位的liblcl.lib可以用apptest目录下的genlib.bat生成。

from rust-vcl.

bstaint avatar bstaint commented on May 26, 2024

我是用的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.

ying32 avatar ying32 commented on May 26, 2024

这个问题的原因我找了下,是因为x86下__stdcall修饰名的问题, 因为liblcl.dll不是vc生成的,用vc的lib.exe生成的lib不符合__stdcall修饰名。。。 是个很蛋疼的问题。。。

from rust-vcl.

bstaint avatar bstaint commented on May 26, 2024

应该不是这个问题吧,我尝试用C++调用liblcl是可以正常执行的。

from rust-vcl.

ying32 avatar ying32 commented on May 26, 2024

我测试了,是这个问题来着。修正 修饰名 编译正常。至于c++调用你要用的liblcl.h的话那个是动态调用的,不存在修饰名问题。

from rust-vcl.

bstaint avatar bstaint commented on May 26, 2024

感谢帮助,我写了个脚本处理了下def文件可以了。

from rust-vcl.

ying32 avatar ying32 commented on May 26, 2024

我用masm的工具生成了lib,测试了可以的,不知道你用的哪种方式

from rust-vcl.

bstaint avatar bstaint commented on May 26, 2024

还是有问题,编译过了 运行导入表又不一致。

from rust-vcl.

ying32 avatar ying32 commented on May 26, 2024

liblcl.zip

cargo rustc --target=i686-pc-windows-msvc -- -C link-args="/SAFESEH:NO"

这是我用masm工具链生成的32位的liblcl.lib

from rust-vcl.

bstaint avatar bstaint commented on May 26, 2024

可以了 ,感谢。

from rust-vcl.

bstaint avatar bstaint commented on May 26, 2024

我又测试了下,可以正常编译,但是跑不起来:

#![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.

ying32 avatar ying32 commented on May 26, 2024

我测试是可以跑起来的,原来的例子因为要加载一个ico文件,govcl中的dll有点不一样,所以不会的错误提示,新的dll和命令行编译我都放仓库里面了,你可以pull下,里面有win32和win64的dll和lib,

from rust-vcl.

bstaint avatar bstaint commented on May 26, 2024

谢谢,试了可以跑起来了,原来我代码有点问题。

from rust-vcl.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.