在没有 C 运行时使用 64 位整数 - 链接错误 __alldiv [英] Using 64 bits integers without C runtime - link error __alldiv

查看:32
本文介绍了在没有 C 运行时使用 64 位整数 - 链接错误 __alldiv的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在不使用 C 运行时(msvcrt 或 libcmt)的情况下构建 Windows 控制台应用程序.那就是只链接 kernel32.lib 并使用来自 WIN32 API 的控制台函数而不是 printf 等.

I am trying to build a windows console application without using the C runtime (msvcrt or libcmt). That is to link just against kernel32.lib and use console functions from WIN32 API instead of printf and such.

我的问题是,在链接期间,编译器找不到 __alldiv,它似乎在 32 位应用程序中处理 64 位整数除法.我尝试了 Microsoft 的编译器和 Intel 的编译器.

My problem is that during link the compiler fails to find __alldiv which seems to handle 64 bit integer divides in 32 bits applications. I tried both Microsoft's compiler and Intel's.

该函数存在于运行时库中.很烦人的是,像 64 位整数这样基本的东西需要完整的 C 运行时.

This function exist in the runtime libraries. It is quite annoying that something as basic as 64 bit integers will require the full C runtime.

有什么想法可以克服这个问题吗?

Any ideas how to overcome the problem?

推荐答案

找到了 __alldiv 链接问题的解决方案:

Found a solution for the __alldiv link problem:

在 msdev 安装中找到 lldiv.obj.我可以将该对象文件添加到链接而不是 C 运行时.

Found lldiv.obj in msdev installation. I can add that object file to the link instead of the C runtime.

对我来说路径是:

c:Program Files (x86)Microsoft Visual Studio 9.0VCcrtsrcintelmt_liblldiv.obj.

c:Program Files (x86)Microsoft Visual Studio 9.0VCcrtsrcintelmt_liblldiv.obj.

这篇关于在没有 C 运行时使用 64 位整数 - 链接错误 __alldiv的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆