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

OneAPI C++ Compiler Classic Problem with Qt

Mentzer__Stuart
2,157 Views

I'm trying the "classic" icl compiler from the new OneAPI on existing projects that use Qt 5.15.2. Whether I just set the environment for the OneAPI compiler and try to run the application built with Parallel Studio icl or I clean build the project with the OneAPI icl I get Qt DLL load entry point errors when I run the applications. One of the errors is shown in the attachment.

Something in the OneAPI environment is breaking the Qt DLL loading. This happens on an application that doesn't use OpenMP, TBB, MKL, etc.

The environment is:

  • Windows 10 64-bit
  • Visual Studio 2019 16.7.7
    I am on VS2019 16.7 because 16.8 isn't compatible with Parallel Studio C++ but if 16.8 is required with OneAPI that wasn't documented/checked during install
  • Intel(R) C++ Intel(R) 64 Compiler Classic Version 2021.1 Build 20201112_000000
  • Qt 5.15.2 msvc2019_64

Thanks for any assistance on this!

0 Kudos
1 Solution
AbhishekD_Intel
Moderator
2,030 Views

Hi,


Sorry for the delay.

I got your issue, the ITAC's bin directory that is on the PATH by setvars.bat contains its own copies of Qt DLLs which is creating a problem with your projects Qt DLLs.

To avoid this problem no need to change the path order and setvars.bat, you can source separate vars.bat according to your usage. Suppose you only want to use Intel Compiler, with MKL and TBB then you can try separately running the vars.bat from the respective directory like ...\compiler\latest\env\vars.bat, ...\mkl\latest\env\vars.bat and ...\tbb\latest\env\vars.bat this will help you to use your own Qt DLLs and will not choose from ITAC's directory.


You can also try to put the path of your DLLs in LD_LIBRARY_PATH so that whenever your application will use Qt DLLs then it will first go to the DLL from the path and will solve the issue.


Do let us know if it solved your problem.



Warm Regards,

Abhishek


View solution in original post

0 Kudos
5 Replies
AbhishekD_Intel
Moderator
2,137 Views

Hi,

 

Thanks for reaching out to us.

We can see that you are using Intel Classic Compiler from OneAPI toolkit with Visual Studio for your application which uses QT-5.15.2. And it seems that there is some problem with DLL from QT. At the linking stage compiler is not able to find the location of the given DLL.

So we think that the issue is more related to your environment. As this is from native libraries you can try any of the below approaches for resolving the issue.

  1. Try copying the DLL from that location to the location where your .vcxproj file is present (present working dir of your project).
  2. Or you can also try giving the path of that DLL inside the Project Properties -> Debugging -> Environment field.               PATH=%PATH%;C:\location_of_DLL\

 

And try rebuilding your project, this should solve your issue.

Hope the provided details will help you.

 

 

Warm Regards,

Abhishek

 

 

0 Kudos
Mentzer__Stuart
2,108 Views

Thanks for the response Abhishek but you didn't understand the issue. The Qt DLLs are being found but loading them was failing.

I did the investigation work and found the problem is that the oneAPI\itac\latest\bin directory that is put on the PATH by setvars.bat contains its own copies of Qt DLLs and if that ends up on my PATH before the installed Qt bin directory the DLL load fails when I start my application.

I can work around this problem by controlling the PATH order but setvars.bat makes this harder by putting directories at the front of PATH.

I think the OneAPI PATH setup is problematic and this will affect other developers using Qt. I suggest submitting this issue for correction.

Thanks.

0 Kudos
AbhishekD_Intel
Moderator
2,031 Views

Hi,


Sorry for the delay.

I got your issue, the ITAC's bin directory that is on the PATH by setvars.bat contains its own copies of Qt DLLs which is creating a problem with your projects Qt DLLs.

To avoid this problem no need to change the path order and setvars.bat, you can source separate vars.bat according to your usage. Suppose you only want to use Intel Compiler, with MKL and TBB then you can try separately running the vars.bat from the respective directory like ...\compiler\latest\env\vars.bat, ...\mkl\latest\env\vars.bat and ...\tbb\latest\env\vars.bat this will help you to use your own Qt DLLs and will not choose from ITAC's directory.


You can also try to put the path of your DLLs in LD_LIBRARY_PATH so that whenever your application will use Qt DLLs then it will first go to the DLL from the path and will solve the issue.


Do let us know if it solved your problem.



Warm Regards,

Abhishek


0 Kudos
Mentzer__Stuart
2,017 Views

Hi Abhishek,

Thanks for the response. I solved the problem here by reworking my project PATH setup but setting up the environment for just the tools you want to use from the command line is probably the best approach.

I am marking your comment as a the "solution" but to really solve this problem I suggest the dev team:

  • Reconsider the amount of stuff being placed in the default environment setup:
    • How many users will run VTune or ITAC from the command line?
    • Do the tools really need to put their directories at the front of PATH?
  • Eliminate any directory from a command line setup that could interfere with users' project builds (as with the itac Qt DLLs).
  • Provide a full documentation of how to do this a la carte environment setup. This page mentions the existence of separate vars.bat files but doesn't list them with the arguments they need.
  • If the environment setup is this complex maybe a friendlier mechanism than chained bat files should be provided for users.
0 Kudos
AbhishekD_Intel
Moderator
1,931 Views

Hi,


Thanks for all of your suggestions, we have discussed all your problems and suggestions with the concerned team and they also have noted them out.

We will no longer monitor this thread, please post a new thread if you have any other issues.


Warm Regards,

Abhishek


0 Kudos
Reply