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

Cannot compile dpc++ file that has "try"

Siqiao_Fu
Beginner
1,312 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
1,252 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

0 Kudos
5 Replies
NoorjahanSk_Intel
Moderator
1,288 Views

Hi,

Thanks for reaching out to us.

Could you please provide the below details.

OS version

oneAPI compiler version

 

Thanks & Regards

Noorjahan

 

0 Kudos
Siqiao_Fu
Beginner
1,264 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?

 

0 Kudos
NoorjahanSk_Intel
Moderator
1,253 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


0 Kudos
Siqiao_Fu
Beginner
1,246 Views
0 Kudos
NoorjahanSk_Intel
Moderator
1,235 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.

 

0 Kudos
Reply