User forums > Help

Segmentation fault with wxGLCanvas only in CB

(1/2) > >>

Pille456:
Hi!

I try to develop a wxWidgets application which uses OpenGL with Code::Blocks. The problem is, that I always receive a SIGSEGV error when I try to create a wxGLCanvas object. I already tried the examples from the wxWiki, which didn't work too (so the problem here is not the code!). The strange about this is, that this problem only occurs when I use Code::Blocks. With wxDevCpp or VC++ everything works fine.
Here my setup:
- Code::Blocks (latest nightly build)
- wxPack 2.8
- MinGW (latest version)

The only logical reason(for me) why the examples doesn't run with Code::Blocks is, that I messed up some settings of Code::Blocks or something like that.
Therefore I'm questioning myself what the term "us wxWidget DLL" in the project wizard exactly means? Unchecking this (and manually linking all libraries) leads me into an linker error, check this (and manually linking all libraries) leads me into this SIGSEGV error.
Any ideas?

Here the debugger stuff:

--- Code: ---Program received signal SIGSEGV, Segmentation fault.
In wxHashTableBase::DoGet (this=0x0, key=1640022, hash=1640022) at ../../src/common/hash.cpp:877 ()
In ntdll!LdrDisableThreadCalloutsForDll () (F:\WINDOWS\system32\ntdll.dll)
In ntdll!LdrFindCreateProcessManifest () (F:\WINDOWS\system32\ntdll.dll)
In ntdll!RtlCheckRegistryKey () (F:\WINDOWS\system32\ntdll.dll)
In ntdll!LdrFindCreateProcessManifest () (F:\WINDOWS\system32\ntdll.dll)
In ntdll!RtlCheckRegistryKey () (F:\WINDOWS\system32\ntdll.dll)
In ntdll!LdrFindCreateProcessManifest () (F:\WINDOWS\system32\ntdll.dll)
In ntdll!RtlUnhandledExceptionFilter () (F:\WINDOWS\system32\ntdll.dll)
In ntdll!LdrFindCreateProcessManifest () (F:\WINDOWS\system32\ntdll.dll)
In ntdll!RtlInitAnsiString () (F:\WINDOWS\system32\ntdll.dll)
In ntdll!RtlAppendStringToString () (F:\WINDOWS\system32\ntdll.dll)
In strchr () (F:\WINDOWS\system32\ntdll.dll)
In ntdll!RtlAppendStringToString () (F:\WINDOWS\system32\ntdll.dll)
Program received signal SIGSEGV, Segmentation fault.
In wxHashTableBase::DoGet (this=0x0, key=1640022, hash=1640022) at ../../src/common/hash.cpp:877 ()
Program exited with code 030000000005.
Debugger finished with status 0

--- End code ---

And here the example I compiled: http://wiki.wxwidgets.org/WxGLCanvas (error in line " new wxGLCanvasSubClass(frame);")

stahta01:
In setup.h for the wxWidgets you are using, what was the original value of wxUSE_GLCANVAS?

Tim S


--- Quote ---Therefore I'm questioning myself what the term "use wxWidget DLL" in the project wizard exactly means?
--- End quote ---

Means do you wish to use (Dynamic = DLL is yes) or Static wxWidgets Library (No to DLL).

What is the type of wxWidgets build are you trying to use?
DLL/Dynamic/Shared or Static ?
Unicode or non-unicode (sometimes called ANSI) ?
Release or Debug (Can be both, but you need to pick just one right now to trouble shoot this problem.) ?
Monolith or MultiLib ?

You stated you wanted an OpenGL build so assuming yes to OpenGL.

Which GLUT for MinGW under Windows are you using? Download Link Needed?

Tim S

Pille456:
I'm using wxPack, which is an already built version of wxWidgets (see: http://wxpack.sourceforge.net/Main/Downloads). This version includes many builds of wxWidgets including opengl (see forum: http://sourceforge.net/forum/forum.php?thread_id=1578110&forum_id=595652)
For debugging I use:
- unicode
- debug
- monolith (what does this suppose?)
and I have to use dynamic because if I do not so, then I receive lots of linker errors I cant solve.

Yeha, I have an application which (should) use(s) OpenGL for a few animations, therefore I dont need GLUT at this time.

stahta01:

--- Quote from: Pille456 on October 25, 2008, 10:53:52 am ---I'm using wxPack, which is an already built version of wxWidgets (see: http://wxpack.sourceforge.net/Main/Downloads). This version includes many builds of wxWidgets including opengl (see forum: http://sourceforge.net/forum/forum.php?thread_id=1578110&forum_id=595652)
For debugging I use:
- unicode
- debug
- monolith (what does this suppose?)
and I have to use dynamic because if I do not so, then I receive lots of linker errors I cant solve.

Yeha, I have an application which (should) use(s) OpenGL for a few animations, therefore I dont need GLUT at this time.

--- End quote ---


--- Quote ---- monolith (what does this suppose?)
--- End quote ---
That you wish to use larger, but less numerous libraries.

What sample code are you using; the link you gave requires GLUT header of <GL/glut.h>

Edit: I am getting the wxWidgets own openGL samples to work using Monolith DLL builds under Code::Blocks. Will attach project files when done.

Note: I do not use openGL so you going to have to figure out why the sample you found does not work right.

But, the samples with wxWidgets do work; I test them every few months when testing wxWidgets.

NOTE: The wxWidgets openGL samples crash with wxPack when Monolithic Build is used.
But, works when multiLib build is used. This appears to be caused by the wxPack packaging of wxWidgets.
The wxPack issue is likely explained in some readme file; my second guess is that the OpenGL DLL only works under MultiLib builds

Attached: CodeBlocks.7z which is Code::Blocks projects for OpenGL Samples with DLLs MultiLib Builds

Tim S



[attachment deleted by admin]

Pille456:
Ahh man big thanks to you!!
Now everything works fine :D :D
Just checked the projects you gave me which worked. Already checked the wxGLCanvas example from the wxWiki with a new project (with mulitlib) which also worked!
Thanks!

Yet I've another question:
My application project uses monolith libraries: Is there an easy way (except of manually editing everything) to change that? Well I could just copy/past the stuff into a new project, but maybe CB has a function for this?

Navigation

[0] Message Index

[#] Next page

Go to full version