Intel® oneAPI Data Parallel C++
Support for Intel® oneAPI DPC++ Compiler, Intel® oneAPI DPC++ Library, Intel® DPC++ Compatibility Tool, and GDB*

Cannot compile dpc++ file that has "try"

Siqiao_Fu
Beginner
352 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
292 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
328 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
304 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
293 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
286 Views
NoorjahanSk_Intel
Moderator
275 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