C-style naming and C ++ naming

Source: Internet
Author: User

I asked a few Daniel a question in my question today. They spoke very deeply. I have a very low qualification and I can't help it. I have to think about it myself. below is the question.


 

//////////////////////////////////////// //////////////////////////////////////// //////////

7c9211ff test byte PTR [ESI + 10 h], 10 h
7c921203 je 7c92fef6
7c921209 pop ESI
7c92120a leave
7c92120b RET 4
7c92120e INT 3 // here is the breakpoint,
7c92120f RET
7c921210 mov EDI, EDI
7c921212 INT 3
7c921213 RET
7c921214 mov EDI, EDI
7c921216 mov eax, dword ptr [esp + 4]
7c92121a INT 3
7c92121b RET 4
7c92121e mov eax, dword ptr fs: [00000018 H]
7c921224 RET
7c921225 push EDI
7c921226 mov EDI, dword ptr [esp + 0ch]
7c92122a mov edX, dword ptr [esp + 8]
7c92122e mov dword ptr [edX], 0
7c921234 mov dword ptr [edX + 4], EDI

The above is the compilation code. I didn't know what was going on at the time. I suggest using try, but I tried it many times and failed (in fact, I didn't use try ), the rogue tried to set the breakpoint and found that the DLL he called had a problem. It was strange that it was correct to use the command prompt of Vs to check the DLL. Everything was normal, open the function source file and find the following code:

 

 

//
// MATLAB Compiler: 4.0 (R14)
// Date: Mon Aug 30 14:16:33 2010
// Arguments: "-B" "macro_default" "-W" "cpplib: libmyadd" "-T" "link: lib"
// "Filtertemp"
//

# Ifndef _ libmyadd_h
# DEFINE _ libmyadd_h 1

# If defined (_ cplusplus )&&! Defined (mclmcr_h) & defined (_ Linux __)
# Pragma implementation "mclmcr. H"
# Endif
# Include "mclmcr. H"
# Include "mclcppclass. H"
# Ifdef _ cplusplus
Extern "C "{
# Endif

Extern bool libmyaddinitializewithhandlers (mcloutputhandlerfcn error_handler,
Mcloutputhandlerfcn print_handler );
Extern bool libmyaddinitialize ();
Extern void libmyaddterminate ();

Extern void mlxfiltertemp (INT nlhs, mxarray * plhs [],
Int nrhs, mxarray * prhs []);

# Ifdef _ cplusplus
}
# Endif

# Ifdef _ cplusplus

Extern void filtertemp (INT nargout, mwarray & Y
, Const mwarray & ad0, const mwarray & AD1 );

# Endif

# Endif

 

 

//////////////////////////////////////// ///////////

Why ?? After thinking about it, I found that libmyaddinitialize () is compiled into a C style (with-underline), while my compiler is, c ++ style (with a strange symbol,). That's right. Don't comment it out. It's really right, this function initializes the DLL that I call. After I comment it out, I find that the memory cannot be read, it's really hard for two ,..... this is a tough issue.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.