Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 10-12-2005, 09:27 AM   #1
Registered: Dec 2004
Location: Russia, Siberia, Kemerovo
Distribution: Slackware
Posts: 893

Rep: Reputation: 35

I get "Segmentation fault" when try to do
map->skybox.back.filename = "string";
map is a pointer to Map class.
filename is of wxString class.
I can't understand what's wrong here, because when I do
map->skybox.back.texid = 1
it doesn't cause the error.
texid is of GLint type.

I even tried to change filename to string type, not wxString class, but with no success. Even memset was done for skybox...

I'm at a loss what to do, and what can cause the error

Can anyone help me?


PS: Sources
(remove ".doc" from the filename)
The sources require wxWidgets and OpenGL.
Call "Map->Skybox->OK" and you will get "Segmentation fault".
Old 10-13-2005, 09:46 AM   #2
Registered: Oct 2005
Posts: 51

Rep: Reputation: 16
I don't have time to take a look at the code but here's a really wild guess. You need to save a string into a char array, right? Since map->skybox.back.filename is a pointer to the first character to that array, what you need to do is add a "*" to that statement:
* map->skybox.back.filename = "string";
That's a really wild guess. If it doesn't work tell me and I'll actually RTFsource.
Old 10-13-2005, 10:05 AM   #3
Registered: Dec 2004
Location: Russia, Siberia, Kemerovo
Distribution: Slackware
Posts: 893

Original Poster
Rep: Reputation: 35
Thanks, destuxor.

Well, I was answered at wxWidgets forum about that already
the problem is in memset (&skybox, 0, sizeof (skybox))
because when it's done, wxString field is destroyed (as well as string field) and this causes the error.
If it has char* (built-in type) all works ok.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
xml + wxwidgets wmoti Programming 1 10-27-2005 10:34 PM
Problems with wxWidgets DonBilbo Linux - Software 3 10-12-2005 09:21 AM
wxwidgets or gtk?? logicalfuzz Linux - Software 3 09-21-2005 12:43 PM
Using OpenGL thru wxWidgets, need help kornerr Programming 5 09-15-2005 10:09 AM
wxwidgets, anyone used it? acidjuice Programming 6 03-31-2005 03:28 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:55 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration