= Common Porting Problems = This page serves to collect information about common problems encountered when porting applications/libraries to the Haiku/BeOS platform. The problems should be identified by the (compiler) errors that typify them. Information about BeOS's POSIX compatibility, see [wiki:BeOSPosix]. === no undefined references allowed in i586-pc-beos shared libraries === ports: [wiki:dev-util/subversion], [wiki:dev-libs/apr] You need to pass the {{{-no-undefined}}} option to libtool Alternatively, libtool can be patched to always exhibit this behavior, at the risk of breaking static compilation when dynamic linking fails. -- andreasf === (stat) structure has no member named `st_blocks' (Now fixed in Haiku) === ports: [wiki:app-arch/tar] (make check), [wiki:net-fs/samba], [wiki:dev-util/cvs] The stat struct in sys/stat.h in BeOS ~~and Haiku~~ ([http://dev.haiku-os.org/ticket/2261 Haiku now has it] [http://dev.haiku-os.org/changeset/27791 as seen here]) doesn't have an st_blocks member. In projects with autoconf, you can check for HAVE_STAT_ST_BLOCKS. http://lists.samba.org/archive/samba-technical/2005-January/039275.html === -lm === ports: [wiki:dev-lang/lua], others The -lm refers to libm which isn't needed for Haiku or BeOS as the math library is part of libroot and linked by default You can simply create a shortcut of libroot.so and rename to libm.so on gcc4 and gcc2 lib directory (Haiku hybrids case) or you can change the -lm references in the configure file to -lroot. Here is some explanation: http://www.freelists.org/archives/haiku-development/04-2008/msg00904.html === No SDL/SDL.h found === If after changing all the file paths in the configure file and continue to receive this message, even with the libSDL installed, it is because the configuration file is searching for the /tmp folder Copy the SDL folder in /boot/common/include to /boot/var/tmp/common/include resolves the problem. === conflicting types for `restrict' (Now fixed in Haiku) === /boot/develop/headers/posix/search.h:35: conflicting types for `restrict' /boot/develop/headers/posix/search.h:35: previous declaration of `restrict' This seems to be an issue with Haiku and has been reported [http://dev.haiku-os.org/ticket/2262 Haiku-2262] This has been fixed in Haiku. If using a version prior to the fix you can copy the search.h file over the one in your headers/posix folder. === GCC 2.9 related build problems === output_operand_lossage `invalid expression as operand' This can be avoided by not passing the '-g' option to gcc for this test. === GCC 4.3 related build problems === Typical errors look like these: error: 'find' is not a member of 'std' error: 'exit' was not declared in this scope Please take a look at: http://www.cyrius.com/journal/2007/05/10#gcc-4.3-include or http://www.comp.leeds.ac.uk/hannah/cpp/errors.html === stdbool.in.h (Now fixed in Haiku) === This has been fixed: http://ports.haiku-files.org/wiki/dev-libs/gnulib So any releases posted AFTER May 25, 2008 'should' include an updated stdbool.in.h === iconv (Now fixed in Haiku)) === Iconv is included in Haiku, but many times ./configure does not detect and use it. This is because it is in libtextencoding.so ([http://dev.haiku-os.org/ticket/2294 should be fixed now]). So try adding a check for iconv in libtextextencoding and see if that works.