Intel® oneAPI Data Parallel C++
Support for Intel® oneAPI DPC++ Compiler, Intel® oneAPI DPC++ Library, Intel® DPC++ Compatibility Tool, and GDB*
Announcements
The Intel sign-in experience has changed to support enhanced security controls. If you sign in, click here for more information.

Cannot compile dpc++ file that has "try"

Siqiao_Fu
Beginner
840 Views

When I use "dpcpp *.cpp" to compile a cpp file that has "try" in it, the cmd shows me the error below.

 

error: cannot use 'try' with exceptions disabled
try {
^
1 error generated.

 

Can anybody tell me why this happened and how I should deal with this problem?

0 Kudos
1 Solution
NoorjahanSk_Intel
Moderator
780 Views

Hi,

Thanks for providing the details.

Could you please try using /EHsc flag

Command:

dpcpp *.cpp /EHsc

Please do let us know, if it works.


Thanks & Regards

Noorjahan


View solution in original post

5 Replies
NoorjahanSk_Intel
Moderator
816 Views

Hi,

Thanks for reaching out to us.

Could you please provide the below details.

OS version

oneAPI compiler version

 

Thanks & Regards

Noorjahan

 

Siqiao_Fu
Beginner
792 Views

Hi Noorjahan,

My OS is win10 and my oneAPI version is the latest (according to the Intel oneAPI command prompt). Should I add any flag when I compile?

 

NoorjahanSk_Intel
Moderator
781 Views

Hi,

Thanks for providing the details.

Could you please try using /EHsc flag

Command:

dpcpp *.cpp /EHsc

Please do let us know, if it works.


Thanks & Regards

Noorjahan


Siqiao_Fu
Beginner
774 Views
NoorjahanSk_Intel
Moderator
763 Views

Hi,

Thank you for accepting as a solution.

 

As this issue has been resolved, we will no longer respond to this thread.

If you require any additional assistance from Intel, please start a new thread.

Any further interaction in this thread will be considered community only.

 

Thanks & Regards

Noorjaha.

 

Reply