Crystal Space
Welcome, Guest. Please login or register.
December 20, 2014, 08:28:36 am

Login with username, password and session length
Search:     Advanced search
9032 Posts in 2046 Topics by 9293 Members
Latest Member: Michaelcrist
* Home Help Search Login Register
+  Crystal Space
|-+  Crystal Space Development
| |-+  Support
| | |-+  Can't compile simple.cpp with event handling.
« previous next »
Pages: [1] 2 Print
Author Topic: Can't compile simple.cpp with event handling.  (Read 5563 times)
Winter Knight
Newbie
*
Posts: 21


View Profile
« on: October 11, 2006, 04:11:09 pm »

I managed to get simple.cpp to compile. So far so good. But when I add the "Esc" funtionality, from 4.3.1.2 of the tutorial, I get a load of errors. Here are the top ten lines, and I'll give more if asked:

/tmp/ccDrZV3N.o(.text+0x11): In function `Simple::OnKeyboard(iEvent&)':
: undefined reference to `csKeyEventHelper::GetEventType(iEvent const*)'
/tmp/ccDrZV3N.o(.text+0x29): In function `Simple::OnKeyboard(iEvent&)':
: undefined reference to `csKeyEventHelper::GetCookedCode(iEvent const*)'
/tmp/ccDrZV3N.o(.text+0x13a): In function `Simple::Simple[not-in-charge]()':
: undefined reference to `csApplicationFramework::csApplicationFramework[not-in-charge]()'
/tmp/ccDrZV3N.o(.text+0x148): In function `Simple::Simple[not-in-charge]()':
: undefined reference to `csBaseEventHandler::csBaseEventHandler[not-in-charge]()'
/tmp/ccDrZV3N.o(.text+0x22c): In function `Simple::Simple[not-in-charge]()':
: undefined reference to `csBaseEventHandler::~csBaseEventHandler [not-in-charge]()'

My operating system is debian stable. I am using the pseudo-stable version of crystalspace. gcc version is 3.3.5 (debian). My video card is PNY Verto GeForce FX 5500 AGP 8x. My driver is the latest proprietary nvidia driver in the debian stable repos. This setup has been working well for me. No problems with any games or anything.

My gcc invocation looks like this:
$g++ -I/usr/local/include/crystalspace -L./lib -lcrystalspace_opengl -lcrystalspace -lpthread -lz -lGL -lSM -lICE -L/usr/X11R6/lib -lX11 -lXext -lm -lm -ldl -lnsl -L/usr/local/lib simple.cpp

So, anyone know anything that would help me?

Thanks in advance,
Winter Knight
Logged
jorrit
Administrator
Hero Member
*****
Posts: 1706


View Profile
« Reply #1 on: October 11, 2006, 04:34:46 pm »

Are you reading the tutorial from the web site or from your local documentation that came with CS?

Greetings,
Logged
Winter Knight
Newbie
*
Posts: 21


View Profile
« Reply #2 on: October 11, 2006, 05:02:43 pm »

Local documentation. Is the website versoin better? I'll check that out.

Update: I checked the online documentation. As far as this particular program is concerned, they are identical. I also looked at some other related chapters, like the one on compiling in unix, and they don't seem to be any different either. Still the same problems. I think a required library isn't being included, but I don't know which one.
« Last Edit: October 11, 2006, 05:15:03 pm by Winter Knight » Logged
jorrit
Administrator
Hero Member
*****
Posts: 1706


View Profile
« Reply #3 on: October 11, 2006, 06:22:30 pm »

Exactly how are you building? What environment and such? Are you using cs-config?

Greetings,
Logged
Winter Knight
Newbie
*
Posts: 21


View Profile
« Reply #4 on: October 11, 2006, 07:25:29 pm »

It is in my original post.

I am using gcc (g++). I gave you the entire command line. Yes, I got that info from cs-config. Here it is again:

$g++ -I/usr/local/include/crystalspace -L./lib -lcrystalspace_opengl -lcrystalspace -lpthread -lz -lGL -lSM -lICE -L/usr/X11R6/lib -lX11 -lXext -lm -lm -ldl -lnsl -L/usr/local/lib simple.cpp

I'm sorry, Is that what you were asking?
« Last Edit: October 11, 2006, 07:34:52 pm by Winter Knight » Logged
jorrit
Administrator
Hero Member
*****
Posts: 1706


View Profile
« Reply #5 on: October 12, 2006, 09:11:20 am »

You probably need to add -lcrystalspace again at the end of the link line. The gcc linker is one pass. Try to see if that helps.

Greetings,
Logged
Winter Knight
Newbie
*
Posts: 21


View Profile
« Reply #6 on: October 12, 2006, 11:19:01 am »

I wasn't sure exactly what you meant, so I tried it two ways. When I add "-lcrystalspace" right before simple.cpp, no effect. But when I add it after, it compiles. Thanks, jorrit.

But the compiled and linked program crashes. It displays a hollow frame for a split second, then segfaults.

I should mention that I am now using the latest svn crystalspace, as of 12 hours ago, or so. I compiled the previous simple.cpp, the one without the "esc" functionality, the one that was working before, and that one also segfaults now. Also, before you helped me compile, jorrit, I was getting an a.out. I didn't notice before. Apparently those errors were just warnings. The program segfaulted when I ran it, though.

Jorrit, could you do me a favor? If it's not to much trouble, could you try to compile simple.cpp with the "g++" commands I used? See if you get the same errors? Or if it works for you? That will help me more closely determine where the problem lies.

Also, what version of gcc do you use? What do the devs recommend? Do other people have problems using crystalspace in debian stable?

I'm going to take a step back, take a walk, come back and install a fresh copy of debian etch. Then x-windows. Then nvidia driver. Then crystalspace dependencies, then crystal space. I'll tell you how that goes.

Thanks a lot for your help, Jorrit.
Logged
jorrit
Administrator
Hero Member
*****
Posts: 1706


View Profile
« Reply #7 on: October 12, 2006, 11:46:26 am »

Can you first tell me if the rest of CS works fine? i.e. walktest and the other apps that come with CS.

Greetings,
Logged
Winter Knight
Newbie
*
Posts: 21


View Profile
« Reply #8 on: October 12, 2006, 12:41:07 pm »

Actually, walktest doesn't work fine.

There is only one case where I was able to get it to work. When I compiled psuedo-stable crystalspace in the source directory. Then I had to run walktest in that directory. Once I installed crystalspace with make install, and tried to run walktest from /opt/crystal-space/bin/walktest, I got an error about not being able to find thingPlane.060. I realized that the data directory in /opt/crystal-space/share/crystalspace/data was not as complete as ~/CS/data (in source directory), so I copied that over, but didn't help. I even checked some config files int /opt/crystal-space/etc/crystalspace, including vfs.cfg and walktest.cfg but those looked okay to me. I'm not sure exactly what the problem was. Installing to /usr/local didn't help any.

Now, with svn crystalspace, I get:
DEBUG: Sound System Software Renderer Initializing...
Segmentation fault.

I just got home a few mins ago. I'm going to try a reinstall, see if that helps. I've installed cegui and nvidia CS since. Maybe that will help.
Logged
jorrit
Administrator
Hero Member
*****
Posts: 1706


View Profile
« Reply #9 on: October 12, 2006, 12:48:50 pm »

Hmm maybe you should avoid the install. Occasionally installing CS breaks. Most people don't install CS but instead use the CRYSTAL environment variable to just point to where Crystal Space is installed and then work from there. Try if that at least works.

Greetings,
Logged
Winter Knight
Newbie
*
Posts: 21


View Profile
« Reply #10 on: October 12, 2006, 01:41:49 pm »

Okay. I updated to latest svn, as of a few mins before 5am PST.

./configure
make
export CRYSTAL=/home/wk/svn/crystal
./walktest

I get the following messages:
DEBUG: Sound System Software Renderer Initializing...
Segmentation Fault

Right before the Segmentation Fault, I get a hollow window for a split second.

Any more ideas? It's really nice of you to help me out like this.
Logged
jorrit
Administrator
Hero Member
*****
Posts: 1706


View Profile
« Reply #11 on: October 12, 2006, 01:48:30 pm »

hmm. Can you do:

./walktest -verbose

And give me the complete output you get?


Greetings,
Logged
Winter Knight
Newbie
*
Posts: 21


View Profile
« Reply #12 on: October 12, 2006, 02:03:53 pm »

All righty. Here it is, in the attachment. It is kind of long. But you were probably expecting that.

* wtverbose.txt (37.81 KB - downloaded 178 times.)
Logged
jorrit
Administrator
Hero Member
*****
Posts: 1706


View Profile
« Reply #13 on: October 12, 2006, 02:19:07 pm »

hmm looks ok. Could you try to configure CS with debug mode like this:

./configure --enable-debug
jam

(best to use jam instead of make. Works a lot better)

And then run walktest in gdb like this:

gdb ./walktest
gdb> run
...
CRASH
gdb> where

I need the output of that 'where' command.

Greetings,
Logged
Winter Knight
Newbie
*
Posts: 21


View Profile
« Reply #14 on: October 12, 2006, 03:22:44 pm »

Okay, did that. Or, what I could

gdb ./walktest
gdb > run

It doesn't crash. Rather, I get a hollow window, which will not close. It won't kill either, without the -9 option. However, running ./walktest from the command line, not inside of gdb, it does crash as it did before.

So, I altered your instructions a bit. I don't know if this will give you the info you need. Here is what I followed:

./configure --enable-debug
./jam
(wait 30-45 min)
gdb ./walktest
gdb > run
kill -9 <walktest pid> (from different workspace)
gdb > where

Here is the output:

wk@ALPHA:~/svn/crystal$ gdb ./walktest
GNU gdb 6.3-debian
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-linux"...Using host libthread_db library "/lib/tls/libthread_db.so.1".

(gdb) run
Starting program: /home/wk/svn/crystal/walktest
[Thread debugging using libthread_db enabled]
[New Thread 1076316960 (LWP 10999)]
DEBUG: Sound System Software Renderer Initializing...  (This is where I killed it)
[New Thread 1128934320 (LWP 11002)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1076316960 (LWP 10999)]
0x42bfb188 in scfImplementationPooled<scfImplementation1<CS::Plugin::XMLShader::csReplacerDocumentNodeIterator, iDocumentNodeIterator> >::operator new ()
   from /home/wk/svn/crystal/xmlshader.so
(gdb) where
#0  0x42bfb188 in scfImplementationPooled<scfImplementation1<CS::Plugin::XMLShader::csReplacerDocumentNodeIterator, iDocumentNodeIterator> >::operator new ()
   from /home/wk/svn/crystal/xmlshader.so
Error accessing memory address 0x42bfb160: No such process.
(gdb)

Does that help?
« Last Edit: October 12, 2006, 03:48:30 pm by Winter Knight » Logged
Pages: [1] 2 Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 7.475 seconds with 15 queries.