RE: Linking problems in MSVC++

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Don,

 

also in C, the MSVC compiler adds decorations to the function for the linker, depending on the calling convention:

 

`__cdecl` calling convention:

a leading underscore `_` is added

 

`__stdcall` calling convention:

a leading underscore `_` is added a trailing at sign `@` followed by the number of bytes in the parameter list in decimal

 

 

https://learn.microsoft.com/en-us/cpp/build/reference/decorated-names?view=msvc-170#FormatC

 

HTH,

Matthias

 

From: openssl-users <openssl-users-bounces@xxxxxxxxxxx> On Behalf Of Don Payette
Sent: Wednesday, September 6, 2023 3:23 PM
To: openssl-users@xxxxxxxxxxx
Subject: Re: Linking problems in MSVC++

 

Well, the linker is giving me this error, plus other similar errors:

 

    Error LNK2019 unresolved external symbol _SSL_CTX_new referenced in function ...

 

My code is calling SSL_CTX_new, so it appears something is adding an underscore on the front.

I looked in libssl.def and SSL_CTX_new is there, but not _SSL_CTX_new. Anybody know where

the underscore is coming from?


 

Don Payette

(cell) 479-216-6320

 

 

On Thu, Aug 31, 2023 at 11:53 AM Kenneth Porter <shiva@xxxxxxxxxxxxxxx> wrote:

On 8/31/2023 8:24 AM, Don Payette wrote:

I'm using Microsoft Visual Studio, so no command line. 

In the linker settings there is an External Dependencies. I added libcrypto.lib and libssl.lb.

We'll see what happens.

Open the project configuration, go to Configuration Properties | Linker | Command Line, and you can copy and paste the arguments that the IDE will pass to the linker. (There's a similar feature under C/C++ in that dialog for the command line compiler.) If it says "different options", you need to use the drop-down menus at the top of the dialog to select a specific configuration (like Debug and x64) to see the command line for that configuration.

 

Attachment: smime.p7s
Description: S/MIME cryptographic signature


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux