Author Topic: How to make Code::Blocks use DW2 exception handling?  (Read 10416 times)

Mowgli

  • Guest
How to make Code::Blocks use DW2 exception handling?
« on: October 03, 2013, 08:38:59 pm »
I am new to Code::Blocks, and I need to use it with OpenCV on a Windows XP SP3 computer. I have faced the following problem:

when I try to run any application that includes OpenCV, I immediately get the following error message:


Cannot find entry point of procedure __gxx_personality_v0 in dynamically linked library libstdc++-6.dll


As people say here: http://answers.opencv.org/question/3740/opencv-243-mingw-cannot-run-program/ -- this problem is probably caused by Code::Blocks using SJLJ exception handling method, while OpenCV supports only DW2. I can see that in the /bin/ folder of Code::Blocks, the *.dll files for both DW2 and SJLJ are present. How can I force Code::Blocks to use DW2 instead?

Thank you in advance.

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: How to make Code::Blocks use DW2 exception handling?
« Reply #1 on: October 04, 2013, 12:56:33 pm »
What types of exceptions your program uses depends only on the compiler, Code::Blocks has nothing to do with it.

The TDM compiler suite has a DW2 variant which works reliably, to name one example. Though of course you could just rebuild OpenCV using your compiler instead, too.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: How to make Code::Blocks use DW2 exception handling?
« Reply #2 on: October 04, 2013, 06:32:40 pm »
What types of exceptions your program uses depends only on the compiler, Code::Blocks has nothing to do with it.

The TDM compiler suite has a DW2 variant which works reliably, to name one example. Though of course you could just rebuild OpenCV using your compiler instead, too.

@Mowgli,

I'm elaborating Thomas' message. You can either
1) Download(http://sourceforge.net/projects/tdm-gcc/files/TDM-GCC%204.7%20series/4.7.1-tdm-1%20DW2/), install and use TDM compiler dw2 version, or
2) Recompile OpenCV with compiler that ships with Code::Blocks 12.11.
Be a part of the solution, not a part of the problem.