Intel® oneAPI DPC++/C++ Compiler
Talk to fellow users of Intel® oneAPI DPC++/C++ Compiler and companion tools like Intel® oneAPI DPC++ Library, Intel® DPC++ Compatibility Tool, and Intel® Distribution for GDB*

Trouble compiling MFC code

D_F
Einsteiger
2.278Aufrufe

I'm having trouble compiling MFC code using Intel OneAPI DPC C++ compiler. I get multiple build errors. Attached is a sample MFC project that shows the build errors, I get different errors using the Intel Classic c++ compiler.  Typical errors are "non-static member function without an object argument". Seems to be a redefinition of some MFC defines??

0 Kudos
6 Antworten
NoorjahanSk_Intel
Moderator
2.236Aufrufe

Hi,

 

Thanks for posting in Intel Communities.

 

>>Typical errors are "non-static member function without an object argument"

You can remove these errors by defining a member function with the class object that it belongs to.

For example, we have made the below changes in PropertiesWnd.cpp file 

      ON_UPDATE_COMMAND_UI(ID_EXPAND_ALL, &CPropertiesWnd::OnUpdateExpandAllProperties)

      ON_COMMAND(ID_SORTPROPERTIES, &CPropertiesWnd::OnSortProperties)....

 

Please refer to the below screenshot for more details:

NoorjahanSk_Intel_0-1678356690400.png

 

Please try to make similar changes in your application as mentioned above and let us know If your issue still persists.

 

Thanks & Regards,

Noorjahan.

 

D_F
Einsteiger
2.201Aufrufe

Thanks, that did it. However I'm getting a few warnings (-Wunused-local-typedef ). How do I suppress these warnings with the Intel compiler?

NoorjahanSk_Intel
Moderator
2.140Aufrufe

Hi,


>>Thanks, that did it

Glad to know that it worked for you


>>How do I suppress these warnings with the Intel compiler?


You can suppress this warning by adding the/Wno-unused-local-typedef flag under


Properties -> C/C++ -> Command-line -> Additional-options.


Thanks & Regards,

Noorjahan.


NoorjahanSk_Intel
Moderator
2.100Aufrufe

Hi,


Has the information provided above helped? If yes, Could you please confirm whether we can close this thread from our end?


Thanks & Regards,

Noorjahan.


D_F
Einsteiger
2.088Aufrufe

Yes, thanks for the help.

NoorjahanSk_Intel
Moderator
2.058Aufrufe

Hi,


Thanks for the confirmation!


As this issue has been resolved, we will no longer respond to this thread. If you need any additional information, please post a new question


Thanks & Regards,

Noorjahan.


Antworten