Help with Compiling Bochs

Hey, I’m trying to compile Bochs and was wondering if anyone had any experience.

When I run configure or the special beos script, it says “Can’t detect build type, please select one manually”. When I use the --build argument, I can’t find the right option. I’ve tried many different spellings of Beos and Haiku, and each time it tells me that it isn’t a valid option. I tested it with --build mac just to test that it works, which it does.

Anyone have any ideas?
Thanks

first try:
–build=i586-pc-haiku
likely won’t work, so you can try:
–build=i586-pc-beos
a beos build may work but it also may not work properly

also specify which GUI to use:
–with-beos
or
–with-nogui

To make a Haiku version; read through this to learn how:
http://ports.haiku-files.org/wiki/PortingTips#PortingTips

Thanks, that worked. I managed to solve a header problem by copying the SDL headers into the GUI folder and making the #include statements relative. After this, it says /boot/common/bin/sdl-config: operation not allowed and then

somefolder/file.a

in example cc file.cc function somefunction()

undefined reference to something

Could you explain what this means please?

Not sure what is going on with sdl-config. Thinking incorrect arguments passed to it. You can try running sdl-config --help and see what it says.

undefined reference; two types: 1) preprocessing: you are missing a header file (something not defined) - will provide file + line number of undefined reference 2) during linking: you are not linking against the proper library or the library does not have that reference defined (ie: older library version).

for #1, requires including a header file - you have to find which one defines your reference
for #2, requires linking against proper or updated library

I can only give general help without seeing exact error output.

Okay, so could I assume that when it says:

/gui/libgui.a
in sdl.cc in function something() : undefined reference to something

it means that some library header files were compiled by themselves into object code into the .a file, and the linker is trying to link the object code into the sdl.cc code but can’t find some variables?

yes.

libgui.a is a static library but upon linking it looks for that reference defined in a certain library.
I assume sdl.cc is part of libgui.a. (ie: compiled into libgui.a)

I would say one of the SDL libraries is not linking in. You would have to fix your Makefile. Look where the linking happens and add the missing library. ie: -lSDL (could be a different one too).

Check your gcc version. Check that SDL libraries are installed and use same gcc version. ie: using gcc2 compiler with gcc4 libraries does not work. haikuware provides gcc4 SDL libraries so make sure you use gcc4 compiler

Either library missing or wrong gcc version library or not linking to correct (SDL) library.

Thanks, I fixed the SDL-config problem by making the shell script executable, which solved most of the library.a errrors. Now I’ll contact the developers about an undefined reference in serial.cc.

The functions that seem to be missing are gethostbyname, socket, listen, bind, and some others in function bx_serial_c::init(void)

I’ve been told on the bochs forum that they’re standard POSIX functions. I’ll get a list of the included libraries when I can. Does this have anything to do with the mention of sockets here:

http://ports.haiku-files.org/wiki/CommonProblems

yes, that link you gave is on the right track.

You need to fix up the configure script to properly detect them. I am fairly sure that all of those are found in libnetwork but configure does not know how to check this. (ie: it looks for socket in libsocket when it should look for it in libnetwork…, etc.)

PS you should post on haiku-ports site mailing list to get help because I have not compiled stuff on Haiku for awhile. They may better help you out with this.

Ok, will do.

I had the same problem porting another project. The problem went away when I added -lnetwork to the link line.

If you can use Paladin, it makes adding libraries very easy. Just select from a list.

It Worked!!! Thank you so much. The -lnetwork was all it needed. NOw for some extensive testing and ultimately, posting it on haikuware.