|
Allegro 4.1.16 and FreeBSD |
Squirrel Havoc
Member #3,032
December 2002
|
Hi there, I am having a problem compiling the latest WIP of Allegro with FreeBSD. First I type "./configure", and all is well. Then I type "gmake", and it starts building. But after a bit, I get this error: src/unix/usystem.c: In function `_unix_get_executable_name': I don't know much about unix programming like I do windows, so I can't make changes to the source file that has the error. What should I do? I am running FreeBSD 5.2.1, with GCC 3.3.3 (please tell me this isn't a GCC bug, I don't have the free space to upgrade it yet). I also tried the latest stable version, and got a different error. Don't remember what it was though... Please help, so I don't have to go back to windows for game programming! |
Evert
Member #794
November 2000
|
It's not a problem with GCC. Can you add #include <sys/ioctl.h> to the top of allegro/src/unix/usystem.c file (it should go to line 45 if you're strict about it) and see if that fixes the problem? EDIT: what errors were you getting with 4.0.3? I assume that's what you meant by latest stable...? |
Squirrel Havoc
Member #3,032
December 2002
|
Hmm, I added the #include (which wasnt there, so I thought it was whats wrong), but I get the same error. About 4.0.3, I am building now, I will let you know what it says. i have a slow system EDIT: That's weird, 4.0.3 built this time. I guess I just gotta wait till the next WIP and hope they fix the error. Thanks for your help |
Evert
Member #794
November 2000
|
Quote: Hmm, I added the #include (which wasnt there, so I thought it was whats wrong), but I get the same error. That's very strange. Can you check if there is a /usr/include/sys/ioctl.h on your system? Also, do you get exactly the same error, or only about PIOCPSINFO? Quote: That's weird, 4.0.3 built this time. That's a relief Quote: I guess I just gotta wait till the next WIP and hope they fix the error. Well, that include should really be there regardless, but if it doesn't fix the problem we'll need to look further. Problem is, I don't have acces to a BSD system. I'll look around and get back to you if I think of something else to try. In the mean time, you can remove the line with #define ALLEGRO_HAVE_SV_PROCFS from allegro/include/allegro/platform/alunixac.h. This will disable the ioctl procfs and make Allegro build cleanly, but you may have to reconfigure allegro with ./configure --enable-magicmain if you want to use get_executable_name(). EDIT: Can you try with adding #include <sys/ioctl.h> and #include <fcntl.h>? |
Squirrel Havoc
Member #3,032
December 2002
|
Hmm I tried adding those includes, but got the same error message. |
Evert
Member #794
November 2000
|
I don't really get this... can you send me your /usr/include/sys/ioctl.h file? |
Squirrel Havoc
Member #3,032
December 2002
|
grep in both directories produced no results. Ill dig up the file and email it to you later, I'm gonna be gone all day. I'll look into it when I get back. |
Evert
Member #794
November 2000
|
Take your time. Thanks for spotting this problem and helping out. |
Milan Mimica
Member #3,877
September 2003
|
Quote: That's very strange. Strange is not enough. Check this out: There is no prpsinfo, only elf_prpsinfo. 2) 3) #ifdef ALLEGRO_HAVE_SV_PROCFS i'd like to get some errors #include <sys/procfs.h> #endif
-- |
Squirrel Havoc
Member #3,032
December 2002
|
Now I get this error: src/unix/usystem.c:360:39: missing terminating " character Ofcourse, thats a typo, even I can fix that Line 360 becomes: snprintf(filename, 1024, "%s", argv[0]); It's building now, got past usystem.c, I'll let you know how it goes... EDIT: Got this error all of the sudden: Don't know how to fix this one... |
Evert
Member #794
November 2000
|
Quote: Strange is not enough. Check this out:
Let me guess: you tried it on Linux Quote: It's building now, got past usystem.c, I'll let you know how it goes... Yay! Quote: Don't know how to fix this one... I think it's a similar problem. The xwin struct is declared in include/xalleg.h. The locked_thread element is probably declared between #ifdef guards which are missing from xvtable.c. That's my guess though, I'll see if I can take a look at the code tomorrow, it's late. Again, thanks for helping out EDIT: yes, that was the problem. Can you try the attached replacement? |
Squirrel Havoc
Member #3,032
December 2002
|
Hmm, the library built, but I get this new error i think when its building the demo: lib/unix/liballeg-4.1.16.so: undefined reference to `kvm_open' |
Evert
Member #794
November 2000
|
Ah, ok, that is a missing dependency. Almost there now. Can you see if there's a libkvm.a in either /usr/lib or /usr/local/lib? If so, can you add -lkvm LIBS in the makefile? |
Squirrel Havoc
Member #3,032
December 2002
|
Well, we're getting closer I added the -lkvm to 2 different spots in the makefile, one for allegro, one for the programs built with allegro. Now I am getting this error: EDIT: I am attatching the makefile, incase I screwed something up |
Evert
Member #794
November 2000
|
The makefile looks fine to me. It looks like Allegro is trying to use another Linuxism. Can you try passing the --disable-vga flag to configure? |
Squirrel Havoc
Member #3,032
December 2002
|
Hmm, did what you said, and I think this is the same error: gcc -s -L/usr/X11R6/lib -Wl,-export-dynamic -o demo/demo obj/unix/demo.o -Llib/unix -lalleg-4.1.16 -lalleg_unsharable -lm -lkvm |
Evert
Member #794
November 2000
|
Strange. The only location where I can see outportb being used (in Linux) are the VGA and Mode-X drivers. I can't find any reference for this using a quick google, so I'm at a loss to figure out how to work around this at the moment. |
Kitty Cat
Member #2,815
October 2002
|
4.1.16 has the problem of not properly figuring out what code to include or not include when certain drivers are disabled. I posted a patch to AD a while ago that fixes that issue, but I don't think anyone's tried it out yet. -- |
Evert
Member #794
November 2000
|
Good point, may be worthwhile to check this again with your patch applied. |
Squirrel Havoc
Member #3,032
December 2002
|
I'm using the latest stable branch right now (cant remember the version number). I am trying to run grabber, and get a screen flooded with this error repeated a lot: grabber in free(): error: recursive call right when I start it up, fullscreen or windowed, that happens before I can do anything. I perused the grabber sourcefile, and saw no mention of this error, so I assume its not an allegro error, but a compiler system thing. I am running XFree86 with KDE 3.3, on FreeBSD 5.2.1 still. |
Evert
Member #794
November 2000
|
That won't really help in working out the kinks in the latest WIP though - and I'd rather focus on that at the moment. |
Squirrel Havoc
Member #3,032
December 2002
|
Here is the config output with the latest WIP: localhost# ./configure --disable-vga configure: WARNING: You need to use GNU make to build Allegro. hope this helps |
Evert
Member #794
November 2000
|
The configure output looks ok to me, nothing strange there. I have acces to SF's compile farm now so I can test things on BSD myself. It looks like the outport problem is caused by Chris' patch that always defines all graphics driver constants on UNIX. |
|