简体   繁体   English

MSVC ++仅编译/禁用链接器

[英]MSVC++ compile only / disable linker

I need to compile some C++ code that will be called from Java with JNI, and these C++ functions have to call an Assembly function (assembled with NASM), so the C++ functions in the .dll loaded by JNI are just wrappers for the Assembly functions. 我需要编译一些将使用JNI从Java调用的C ++代码,并且这些C ++函数必须调用Assembly函数(与NASM组装在一起),因此JNI加载的.dll中的C ++函数只是Assembly函数的包装器。

But I'm not able to resolve the undefined external reference to the Assembly function before the code has been compiled into a .dll that I can link with my .obj file generated by NASM. 但是在将代码编译成.dll以与NASM生成的.obj文件链接之前,我无法解析对Assembly函数的未定义外部引用。 So, how do I "disable" the linker so there will be no complaints when I build the C++ module? 因此,如何“禁用”链接器,以便在构建C ++模块时不会有任何抱怨?

要针对NASM生成的obj文件进行链接,请打开C ++项目的Configuration Properties > Linker > Input ,选择“ Configuration Properties > Linker > Input ,然后将obj文件添加到“ Additional Dependencies列表(以分号分隔)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM