2

I want to use two 3rd party libraries in my project but one was compiled with __stdcall convention and another with __cdecl. No matter what I set my project property to, the LINKER fails to link one library or another. Is there a way to do this?

Bo Persson
  • 90,663
  • 31
  • 146
  • 203
Anorflame
  • 376
  • 3
  • 12

1 Answers1

2

The calling convention external code is compiled with should be irrelevant. As long as the appropriate functions are declared with the correct convention, the convention you use for your own code matters not and it will work whatever choice you make.

Puppy
  • 144,682
  • 38
  • 256
  • 465
  • I agree, but I saw that if I just try to compile it without changing the declarations in one of the headers, the linker fails (described in more details in other question of mine). If the convention is not specified explicitly in the header, what convention is used for the imported functions? My assumption (correct me if I'm wrong) is that the one specified in the properties of the project or a specific file. In this case (I use one convention for the whole project while the 3rd party library was compiled with another), I think it makes sense that the linker failed. – Anorflame Jul 25 '12 at 19:55