Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is "__cdecl"?

Tags:

c++

visual-c++

I want to use the AES algorithm with MPI.

I code in visual c++. When I compile the code I get this error:

unresolved external symbol "void __cdecl BTM(int,int)" (?BTM@@YAXHH@Z) referenced in function _main

like image 654
ar.gorgin Avatar asked Jul 17 '12 12:07

ar.gorgin


People also ask

What is the use of __ cdecl?

__cdecl is the default calling convention for C and C++ programs. Because the stack is cleaned up by the caller, it can do vararg functions. The __cdecl calling convention creates larger executables than __stdcall, because it requires each function call to include stack cleanup code.

What does cdecl stand for?

The cdecl (C Declaration) calling convention is usually the default calling convention for x86 C compilers.

What does __ Stdcall mean?

The __stdcall calling convention is used to call Win32 API functions. The callee cleans the stack, so the compiler makes vararg functions __cdecl . Functions that use this calling convention require a function prototype. The __stdcall modifier is Microsoft-specific.

What is __ Fastcall in C++?

The __fastcall calling convention specifies that arguments to functions are to be passed in registers, when possible. This calling convention only applies to the x86 architecture.


1 Answers

__cdecl is a calling convention, but the problem you have is a linker failure. It is stating that a definition for the function called BTM() cannot be located.

Ensure you are linking with all the necessary .libs.

like image 177
hmjd Avatar answered Sep 23 '22 19:09

hmjd