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*
585 Discussions

Cannot compile dpc++ file that has "try"

Siqiao_Fu
Beginner
1,369 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,309 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,345 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,321 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,310 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,303 Views
0 Kudos
NoorjahanSk_Intel
Moderator
1,292 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