name-decoration

Using C++ DLLs with different compiler versions

风格不统一 提交于 2019-11-27 18:30:48
问题 This question is related to "How to make consistent dll binaries across VS versions ?" We have applications and DLLs built with VC6 and a new application built with VC9. The VC9-app has to use DLLs compiled with VC6, most of which are written in C and one in C++. The C++ lib is problematic due to name decoration/mangling issues. Compiling everything with VC9 is currently not an option as there appear to be some side effects. Resolving these would be quite time consuming. I can modify the C++

C++ name mangling decoder for g++? [duplicate]

情到浓时终转凉″ 提交于 2019-11-27 11:30:54
问题 This question already has answers here : Why does typeid.name() return weird characters using GCC and how to make it print unmangled names? (6 answers) Closed 4 years ago . is there any C++ name-mangling decoder for g++? 回答1: You can use c++filt to demangle c++ symbols. For instance $ c++filt -n _Z1fv f() 回答2: c++filt, example usage here: Can we see the template instantiated code by C++ compiler 回答3: You may also be interested on the -C option of objdump : objdump -CSr main.o which demangles

Exporting functions from a DLL with dllexport

一曲冷凌霜 提交于 2019-11-26 05:59:24
I'd like a simple example of exporting a function from a C++ windows DLL. I'd like to see the header, the cpp file, and the def file (if absolutely required). I'd like the exported name to be undecorated . I'd like to use the most standard calling convention (__stdcall?). I'd like the use __declspec(dllexport) and not have to use a DEF file. For example: //header extern "C" { __declspec(dllexport) int __stdcall foo(long bar); } //cpp int __stdcall foo(long bar) { return 0; } I'm trying to avoid the linker added underscores and/or numbers (byte counts?) to the name. I'm OK with not supporting

Exporting functions from a DLL with dllexport

守給你的承諾、 提交于 2019-11-26 01:56:38
问题 I\'d like a simple example of exporting a function from a C++ windows DLL. I\'d like to see the header, the cpp file, and the def file (if absolutely required). I\'d like the exported name to be undecorated . I\'d like to use the most standard calling convention (__stdcall?). I\'d like the use __declspec(dllexport) and not have to use a DEF file. For example: //header extern \"C\" { __declspec(dllexport) int __stdcall foo(long bar); } //cpp int __stdcall foo(long bar) { return 0; } I\'m