Help Compiling GSPlus

I got a bit further tonight. Compiler spits out an error:

/boot/home/Desktop/gsplus/src/unix_host_common.c: In function 'host_set_file_info':
/boot/home/Desktop/gsplus/src/unix_host_common.c:428:16: error: incompatible types when assigning to type 'struct timeval' from type 'int'
  428 |     times[0] = 0;             // access
         |                ^

Any ideas?

smell need casting/converting?

More likely, it’s using a raw memory access to the first field instead of using the dot operator to access it.

the simplest fix would be to comment out line 428. The similar line is commented out for __linux__ and __sun. i don’t know if there’s an architecture or build type where you’d want that code, but maybe it works in some situation.

A better fix might be to duplicate that code block and add an elif defined(__haiku__) section and comment it out there (and then of course build with __haiku__ ). There could be other parts of the code that need conditional compilation.

3 Likes

I took the advice from @dsizzle and sort of just put whatever was for Linux under the else statement, and it built further. Now it’s stuck at:

/boot/system/develop/tools/x86/bin/../lib/gcc/i586-pc-haiku/11.2.0/../../../../i586-pc-haiku/bin/ld: CMakeFiles/GSplus.dir/scc_socket_driver.c.o: in function `scc_socket_maybe_open_incoming':
scc_socket_driver.c:(.text+0x6eb): undefined reference to `socket'
/boot/system/develop/tools/x86/bin/../lib/gcc/i586-pc-haiku/11.2.0/../../../../i586-pc-haiku/bin/ld: scc_socket_driver.c:(.text+0x71f): undefined reference to `setsockopt'
/boot/system/develop/tools/x86/bin/../lib/gcc/i586-pc-haiku/11.2.0/../../../../i586-pc-haiku/bin/ld: scc_socket_driver.c:(.text+0x752): undefined reference to `bind'
/boot/system/develop/tools/x86/bin/../lib/gcc/i586-pc-haiku/11.2.0/../../../../i586-pc-haiku/bin/ld: scc_socket_driver.c:(.text+0x876): undefined reference to `listen'
/boot/system/develop/tools/x86/bin/../lib/gcc/i586-pc-haiku/11.2.0/../../../../i586-pc-haiku/bin/ld: CMakeFiles/GSplus.dir/scc_socket_driver.c.o: in function `scc_socket_open_outgoing':
scc_socket_driver.c:(.text+0xff7): undefined reference to `socket'
/boot/system/develop/tools/x86/bin/../lib/gcc/i586-pc-haiku/11.2.0/../../../../i586-pc-haiku/bin/ld: scc_socket_driver.c:(.text+0x1034): undefined reference to `setsockopt'
/boot/system/develop/tools/x86/bin/../lib/gcc/i586-pc-haiku/11.2.0/../../../../i586-pc-haiku/bin/ld: scc_socket_driver.c:(.text+0x10c0): undefined reference to `gethostbyname'
/boot/system/develop/tools/x86/bin/../lib/gcc/i586-pc-haiku/11.2.0/../../../../i586-pc-haiku/bin/ld: scc_socket_driver.c:(.text+0x10f3): undefined reference to `connect'
/boot/system/develop/tools/x86/bin/../lib/gcc/i586-pc-haiku/11.2.0/../../../../i586-pc-haiku/bin/ld: scc_socket_driver.c:(.text+0x1239): undefined reference to `__h_errno'
/boot/system/develop/tools/x86/bin/../lib/gcc/i586-pc-haiku/11.2.0/../../../../i586-pc-haiku/bin/ld: scc_socket_driver.c:(.text+0x1244): undefined reference to `hstrerror'
/boot/system/develop/tools/x86/bin/../lib/gcc/i586-pc-haiku/11.2.0/../../../../i586-pc-haiku/bin/ld: CMakeFiles/GSplus.dir/scc_socket_driver.c.o: in function `scc_socket_empty_writebuf':
scc_socket_driver.c:(.text+0x1cef): undefined reference to `send'
/boot/system/develop/tools/x86/bin/../lib/gcc/i586-pc-haiku/11.2.0/../../../../i586-pc-haiku/bin/ld: CMakeFiles/GSplus.dir/scc_socket_driver.c.o: in function `scc_accept_socket':
scc_socket_driver.c:(.text+0x2101): undefined reference to `accept'
/boot/system/develop/tools/x86/bin/../lib/gcc/i586-pc-haiku/11.2.0/../../../../i586-pc-haiku/bin/ld: CMakeFiles/GSplus.dir/scc_socket_driver.c.o: in function `scc_socket_fill_readbuf':
scc_socket_driver.c:(.text+0x22a4): undefined reference to `recv'
/boot/system/develop/tools/x86/bin/../lib/gcc/i586-pc-haiku/11.2.0/../../../../i586-pc-haiku/bin/ld: CMakeFiles/GSplus.dir/unix_host_common.c.o: in function `host_get_file_xinfo':
unix_host_common.c:(.text+0x5ba): undefined reference to `getxattr'
/boot/system/develop/tools/x86/bin/../lib/gcc/i586-pc-haiku/11.2.0/../../../../i586-pc-haiku/bin/ld: unix_host_common.c:(.text+0x5e8): undefined reference to `getxattr'
/boot/system/develop/tools/x86/bin/../lib/gcc/i586-pc-haiku/11.2.0/../../../../i586-pc-haiku/bin/ld: CMakeFiles/GSplus.dir/unix_host_common.c.o: in function `host_set_file_info':
unix_host_common.c:(.text+0x8ff): undefined reference to `setxattr'

I forgot to add its now compiling 77% of the way.

You have to link to libnetwork. usually by adding -lnetwork to the linker flags

you didnt really say which build system is used so I can’t be more specific : )

I think it’s 32bit secondary architecture :slight_smile:

@christech if you are running in Terminal, try export LDFLAGS="-lnetwork" before you start the build.

Build system like make configure, meson cmake etc. : )

Use the source Luke! :wink: https://github.com/digarok/gsplus (cmake)