Gah! Stupid Linux! Help!

Monkey Forums/Monkey Programming/Gah! Stupid Linux! Help!

DruggedBunny(Posted 2012) [#1]
OK, spent about an hour trying to resolve this today! Yesterday, I figured out how to build Ted on Linux (on the Raspberry Pi), but right at the end (after 15-20 minutes building) it complains as below:

process.cpp: In member function ‘virtual void ProcWaiter::run()’:
process.cpp:349:29: error: ‘waitpid’ was not declared in this scope
make: *** [process.o] Error 1
pi@raspberrypi ~/Desktop/Dev/monkey/src/ted $ 

I found that 'waitpid' belongs to 'wait.h' (which is in /usr/include) but that just includes '/sys/wait.h'. I'm guessing it's failing because it can't find '/sys/wait.h'.

My /sys folder contains only sub-folders, no *.h files. I installed the linux-header files but they're in /usr/include/arm-linux-gnueabihf/sys/ as far as I can tell.

I've been trying to create links between the folders, or to create symlinks to the .h files, but to no avail.

In short, what do I need to do to get the compiler to think my headers are in /sys? (For symlinks, I'd need the actual command, as my attempts with ln are just no happening!)

Or should I just bite the bullet and copy the entire contents of the arm-linux folder into /sys? In fact, gonna try that now, but I'd rather find out how this 'should' be handled...


DruggedBunny(Posted 2012) [#2]
Nope, no joy on copying!

cp -r /usr/include/arm-linux-gnueabihf/sys/* /sys


... results in:

cp: cannot create regular file blahblah.h: No such file or directory

[... repeat a zillion times...]


Well, that's the file I'm trying to create, fercrissakes! Tried as root, too. I had similar results when trying to symlink, so I'm stumped... :/


dawlane(Posted 2012) [#3]
Don't know about building on a Raspberry Pi. But did you enclose the header file in chevrons or quotes and put it in Ted's std.h?. Builds OK (with warnings) on linux.


DruggedBunny(Posted 2012) [#4]
Thanks, dawlane, and sorry for the delayed response. I had a look at std.h tonight but only found the qt4 include line.

In theory, the Pi should be no different to any other Linux distro (it's Debian built for ARM), but there's certainly no /sys/wait.h and Google hasn't really helped with any queries I've thrown at it in regards to the error message.

I'll continue to fiddle over the next few days and see if I can get anywhere...


skid(Posted 2012) [#5]
I think you'll be fine commenting them out. The problem I think is the Pi cannot run two processes at the same time so waitpid is not possible.


marksibly(Posted 2012) [#6]
Hi,

/sys/wait.h sounds wrong to me - is there a /usr/include/sys/wait.h?

Maybe you haven't sent an include path correctly?


dawlane(Posted 2012) [#7]
I had a look at std.h tonight but only found the qt4 include line.
Ah but did you add #include <sys/wait.h> to the top Ted's std.h file. This is what I had to do to get Ted to compile.
I would have thought the wait.h would have been include it the qt header files myself.

If your still having problems. You could try and add some gcc path environment variables to your commands shells .profile or the profile in /etc.. Don't forget to restart you command terminal or the machine for it to take effect.

@skid: Would they still not include some sort of dummy code as work around to get things to compile?


DruggedBunny(Posted 2012) [#8]

/sys/wait.h sounds wrong to me - is there a /usr/include/sys/wait.h?


No (there's no sys folder in /usr/include here), but I have just found /usr/include/wait.h -- so how do I point the makefile/command line/Linux/whatever so it looks there?!

Currently having a go at building with dawlane's suggested #include but it'll be some time building...

@skid: Not sure what you mean about not being able to run two processes -- the Pi is running Debian so runs tons of processes anyway, desktop and all. Do you mean there's some kind of limit in terms of one program launching another?

Anyway, thanks to all so far!


DruggedBunny(Posted 2012) [#9]
Woohoo! Thanks to dawlane, I've got Ted running on the Pi now -- adding the #include line worked first time! This is just using monkey-ext with upgrade to 'stable'.

The weird thing is, it runs really well -- quick to launch, scroll, docs work and everything. I expected it to really drag!

Just got to figure out setting up targets again, as I have nothing at the moment...

Here it is, built and run via a VNC session:




dawlane(Posted 2012) [#10]
Glad you finally got it to work.
Just got to figure out setting up targets again, as I have nothing at the moment...
I cheated and just made a copy of conf.macos and renamed it conf.linux then just modified the paths a little.
The problems you will fined is getting some of the other targets to build the same as windows and mac, glfw,stdcpp will work out of the box (with a linux build of trans). The others will require mserver to be rebuilt, and trans modified to run the other build tools using a posix command line.


DruggedBunny(Posted 2012) [#11]
I did have GLFW running on the Pi (via command line, software-rendered) some time ago, but I've forgotten/blanked-out every detail of the experience. Hopefully what I posted at the time will let me piece it all back together...

(I still don't get how sys/wait.h connects to /usr/include/wait.h, but hey-ho!)

This experience has given me a new-found respect for Qt, though. The IDE feels genuinely very useable, even though the Pi experience on the whole is still rather slow (with Debian).

I kind of thought the monkey-ext stable version came with a build of trans, but I've just realised that even if it does, it'll be x86... d'oh! I'll get on to that tomorrow. (I'm only really interested in STDCPP, HTML5 and GLFW for the Pi at this point.)

Anyway, thanks for all your help with this.


NoOdle(Posted 2012) [#12]
I'm very glad you got it working, I was dreading being the one to figure this out having never used linux before. Ordering myself a Pi pretty soon to have a play.


dawlane(Posted 2012) [#13]
I'm only really interested in STDCPP, HTML5 and GLFW
STDCPP and GLFW are easy peasy(ish), but getting mserver is going to be a lot more tricky as you have to have root privileges to open a virtual terminal and then the next part is getting the html file to run.


jondecker76(Posted 2012) [#14]
I've run linux compiled html5 monkey projects in both chrome and firefox just by using a file:// path and no need for MServer


DruggedBunny(Posted 2012) [#15]
I'm not too worried about HTML5, actually -- that's never going to run well on the Pi since none of the browsers are likely to get accelerated canvases.

Once they finally get accelerated X drivers, though, GLFW should at least become a decent target.


zoqfotpik(Posted 2012) [#16]
GLFW will compile and run under GCC?


DruggedBunny(Posted 2012) [#17]
Yeah, it will -- I finally got it building here on the Raspberry Pi:

http://www.monkeycoder.co.nz/Community/post.php?topic=3415

... but I can't run the built executables as the Pi distro I'm using doesn't support GLX! Gah!


zoqfotpik(Posted 2012) [#18]
Just a hint-- the way I got HTML5 files hosted on localhost was to install Apache 2. Then, instead of bothering with the configuration Apache wants for symlinks, I did this:

watch -n 1 "cp -u -r main.build /var/www/<gamedirectory>"


Every second, this will copy any changed files into a directory named after your game under /var/www. Then you can just navigate to that from http://localhost. After you make a new compile, hit refresh on your browser and you will have the new version of your game in your browser.

I got the monkey IDE (didn't try with Ted) running under Wine.