name-decoration

C4503 warnings? How do i solve/get rid of them?

别说谁变了你拦得住时间么 提交于 2020-01-03 08:29:34
问题 It's my first time trying out C++ STL. I'm trying to build a multidimensional associative array using map. For example: typedef struct DA { string read_mode; string data_type; void *pValue; void *pVarMemLoc; }DA; int main() { map<string, map<string, map<string, map<string, map<string, DA*>>>>> DATA; DATA["lvl1"]["stg1"]["flr1"]["dep1"]["rom1"] = new DA; DATA["lvl1"]["stg1"]["flr1"]["dep1"]["rom2"] = new DA; DATA["lvl1"]["stg1"]["flr1"]["dep1"]["rom3"] = new DA; IEC["lvl1"]["stg1"]["flr1"][

C++ name space confusion - std:: vs :: vs no prefix on a call to tolower?

99封情书 提交于 2019-12-30 06:51:21
问题 Why is this? transform(theWord.begin(), theWord.end(), theWord.begin(), std::tolower); - does not work transform(theWord.begin(), theWord.end(), theWord.begin(), tolower); - does not work but transform(theWord.begin(), theWord.end(), theWord.begin(), ::tolower); - does work theWord is a string. I am using namespace std; Why does it work with the prefix :: and not the with the std:: or with nothing? thanks for your help. 回答1: using namespace std; instructs the compiler to search for

Can't access variable in C++ DLL from a C app

一曲冷凌霜 提交于 2019-12-22 04:38:16
问题 I'm stuck on a fix to a legacy Visual C++ 6 app. In the C++ DLL source I have put extern "C" _declspec(dllexport) char* MyNewVariable = 0; which results in MyNewVariable showing up (nicely undecorated) in the export table (as shown by dumpbin /exports blah.dll). However, I can't figure out how to declare the variable so that I can access it in a C source file. I have tried various things, including _declspec(dllimport) char* MyNewVariable; but that just gives me a linker error: unresolved

C++ DLL Export: Decorated/Mangled names

穿精又带淫゛_ 提交于 2019-12-17 02:22:15
问题 Created basic C++ DLL and exported names using Module Definition file (MyDLL.def). After compilation I check the exported function names using dumpbin.exe I expect to see: SomeFunction but I see this instead: SomeFunction = SomeFunction@@@23mangledstuff#@@@@ Why? The exported function appears undecorated (especially compared to not using the Module Def file), but what's up with the other stuff? If I use dumpbin.exe against a DLL from any commercial application, you get the clean: SomeFunction

Calling a native C compiled with VS 2005 from C++/CLI Visual studio 2010 - Cannot open .lib file…

拟墨画扇 提交于 2019-12-13 06:08:13
问题 Hi I want to call functions from a C dll to C++/CLI. The C functions are declared extern. I followed this tutorial for linking the dll: http://social.msdn.microsoft.com/Forums/en/Vsexpressvc/thread/84deabaa-ae82-47cc-aac0-592f5a8dfa22 and then in my C++/CLI dll I have the following: // testWrapper.h #pragma once using namespace System; namespace testWrapper { extern "C" int GtoCalcImpliedVolatility2( double premium, int optionType, double underPrice, double strike, double yearsToExpiry,

mingw32 g++ and stdcall @suffix

时光怂恿深爱的人放手 提交于 2019-12-11 12:37:06
问题 I declared some C++ functions prototyped as follows: extern "C" void __stdcall function(); I also have some third-party dll with exported function() - no name decorations at all. I'm unable to build my exe or dll due to undefined reference to function@... , because of MinGW's stdcall @-suffix. How can I obtain object file without @... just plain function names? 回答1: It sounds like you're trying to use MinGW to compile a program that uses external C functions from a third-party dll. There's a

DLL and Name Mangling

送分小仙女□ 提交于 2019-12-10 20:47:00
问题 I have a third-party LIB which has symbols exported as plain C/cdecl, so for example dumpbin.exe /SYMBOLS reports that both __imp_nvmlInit and nvmlInit are exported. However in Visual Studio 2010 when I try to import them, the header file will have extern "C" nvmlReturn_t nvmlInit(...); but when I try to compile, I get the following error: main.obj : error LNK2019: unresolved external symbol _nvmlInit referenced in function _main How can I stop Visual Studio from looking for that symbol with

Export Unmanaged Classes from a Visual C++ DLL?

这一生的挚爱 提交于 2019-12-10 18:04:43
问题 When creating a DLL with Visual C++ 2008 I have a couple of choices. I can create a "Class Library" , which I understand will actually give me a .Net Library that uses the CLI (managed) extenstion of C++. Since I don't want that, and I assumed that I need a static .LIB file to link into another Visual C++ windows executable project, I choose instead "Win32 Project" and, on the Application Settings panel, specify a C++ (no MFC) DLL. This will create a project with a .cpp file which is supposed

White-box testing in Javascript - how to deal with privacy?

微笑、不失礼 提交于 2019-12-10 13:24:50
问题 I'm writing unit tests for a module in a small Javascript application. In order to keep the interface clean, some of the implementation details are closed over by an anonymous function (the usual JS pattern for privacy). However, while testing I need to access/mock/verify the private parts. Most of the tests I've written previously have been in Python, where there are no real private variables (members, identifiers, whatever you want to call them). One simply suggests privacy via a leading

GCC compiling a dll with __stdcall

a 夏天 提交于 2019-12-10 03:22:19
问题 When we compile a dll using __stdcall inside visual studio 2008 the compiled function names inside the dll are. FunctionName Though when we compile the same dll using GCC using wx-dev-cpp GCC appends the number of paramers the function has, so the name of the function using Dependency walker looks like. FunctionName@numberOfParameters or == FunctionName@8 How do you tell GCC compiler to remove @nn from exported symbols in the dll? 回答1: __stdcall decorates the function name by adding an