有没有一个Visual C ++相当于gcc --kill-at? [英] Is there a Visual C++ equivalent to gcc --kill-at?
问题描述
编辑:多一点信息:
我试图让一个C ++ JNI dll工作,但是我经常得到
线程Thread-0中的异常java.lang.UnsatisfiedLinkError: eveTimers.PollThread.checkKeyboardChanges()V
返回而不是一个功能正常的程序。我用quickview看看dll,发现它是用@ 8装饰的, http://www.velocityreviews.com/forums/t143642-jni-unsatisfied-link-error-but-the-method-name-is-correct.html 建议是一个可能的问题。帮助将不胜感激。
另一种方法是指定在.DEF文件中导出名称。
您的调用约定和链接器设置也可以影响这一点。老实说,这是一件黑色的艺术品。使用MSVC十几年,您仍然会偶尔遇到麻烦的名称,这些问题应该很容易解决,但是不同的设置如何相互影响,实际上是非常简单的。
Namely, a DLL name has an extra @8 at the end which is causing trouble. Apparently, using the --kill-at flag in gcc would solve this, but I can't find any similar suggestions for MSVC.
EDIT: A little more info:
I'm trying to get a C++ JNI dll to work, but I constantly get Exception in thread "Thread-0" java.lang.UnsatisfiedLinkError: eveTimers.PollThread.checkKeyboardChanges()V back instead of a functioning program. I used quickview to look at the dll and discovered it's decorated with @8 which http://www.velocityreviews.com/forums/t143642-jni-unsatisfied-link-error-but-the-method-name-is-correct.html suggests is a possible problem. Help would be greatly appreciated.
[Edited out as irrelevant, per comment below].
Another approach is to specify export names in a .DEF file.
Your calling convention and linker settings can affect this as well. It's a bit of a black art, to be honest. Use MSVC for a dozen years and you'll still occasionally run into pesky name-mangling issues that should be easy to fix, but are non-trivial to actually fix, given how the different settings interact.
这篇关于有没有一个Visual C ++相当于gcc --kill-at?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!