Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7944 Discussions

Calling convection & compiler compatibility

mrbenson
Beginner
729 Views

Hello everybody,

 

I'm willing to use/link a static C++ library, compiled with intel compiler, in my pure visual studio project which use the native C++ visual compiler. 

When linking, i get some unresolved errors, how can fix that ? Do intel and microsoft compiler ABI are compatible ?

Do i need to build the static library using a specific calling convention ?

 

Thanks for you help.

0 Kudos
4 Replies
NoorjahanSk_Intel
Moderator
674 Views

Hi,

 

Thanks for reaching out to us.

 

>> Do intel and microsoft compiler ABI are compatible ?

Yes, it is compatible. You can create/link static library with Intel C++ compiler and can be used in visual studio project that uses C++ visual compiler. 

 

We have tried to create a sample static library using Intel C++ compiler (2021.5/2022.0) and used this library in another source file that compiled with visual C++ compiler.

 

Creating static library:

1. Open visual studio and create Windows Desktop Wizard project type

Please find attached screenshot to create.

NoorjahanSk_Intel_0-1648023450580.png

 

2.Create Header file and Source file as required by your use case and build it with intel C++ compiler.

 

Using static library in another project:

1. Create a C++ console application project type

2. Rewrite the .cpp code as per your requirements.

3. On Property Pages, go to C/C++->General->Additional Include Directories and provide the path, where the header file of the library that you want to use is located.

4. Then go to Linker->General->Additional Library Directories and specify the path, where your .lib file is located.

5. If you get any linking error (libmmdd.lib is not found), locate for the libmmdd.lib file and specify the path in Linker->General->Additional Library Directories

6. Finally, go to Linker->Input->Additional Dependencies and add the name of the file containing your library together with its extension (e.g. example_library.lib)

7. Build your program and run it.

 

Please find the attached projects that we have tried.

 

If this does not match your use-case,

Could you please provide the sample reproducer along steps you have followed to reproduce the issue and the compiler version being used?

>>i get some unresolved errors

Could you please provide us the errors that your are getting? 

 

Thanks & Regards,

Noorjahan.

 

0 Kudos
mrbenson
Beginner
631 Views

Hi,

 

Thanks for helping, the issue was due to /Qipo optimization in my librarie...

 

Best regards.

0 Kudos
NoorjahanSk_Intel
Moderator
581 Views

Hi,

 

Could you please confirm whether your issue is resolved? If yes, could you please confirm whether can we go ahead and close this issue?

 

 

Thanks & regards,

Noorjahan.

 

0 Kudos
NoorjahanSk_Intel
Moderator
510 Views

Hi,

We are closing this thread assuming your issue has been resolved.

We will no longer respond to this thread. If you need any additional information, please submit a new question as this thread will no longer be monitored.


Thanks & Regards,

Noorjahan.


0 Kudos
Reply