BeOS Release 3.0/3.1
For general release notes, see Developer Release Notes.
At the highest level of the directory structure, nothing has changed. The /boot directory is at the root of the Be file system and contains the eight "real" (nonvirtual) subdirectories that you're already familiar with:
Although you can create your own /boot subdirectories, it's recommended that you put all your own work in subdirectories of /boot/home.
Currently, the Intel version of the Be file system (bfs) is not compatible with the PPC bfs (endian trouble). This means, as an annoying example, that your Intel machine will not be able to read a floppy that was initialized on a PPC machine (and vice versa). If you want to use a floppy to transfer data between Intel and PPC, use tar.
The bfs incompatibility doesn't affect ftp: Files that are transferred through ftp will be properly converted.
The layout and use of the Release 3 header files is similar to PR2: /boot/develop/headers is the master header file master directory. It contains four subdirectories:
If you're developing a library that needs to install its own headers files, you may want to create your own subdirectory of /boot/develop/headers. Just don't put them in the Be-defined subdirectories listed above.
The BeIDE looks for system headers in the be, cpp, and posix subdirectories. If the BeIDE loses these settings, visit the Project/Access Paths portion of the Settings window and either reset to Factory Settings or add the paths yourself.
There's an important new header file in R3:
![]() |
/boot/develop/headers/be/BeBuild.h. |
This file throws a compiler switch that tells your apps to import the global symbols that are exported by the Be libraries. The file is included by default when you build your app: You don't need to explicitly include this file in your source code.
Starting in Release 3, each global symbol that's defined in the Be headers is marked with the keyword...
![]() |
_IMPEXP_LIB |
...where LIB is the Be library in which the symbol is defined. For example (from storage/FilePanel.h):
|
The keyword works in conjunction with the switch that's thrown by BeBuild.h. We'll return to the _IMPEXP_LIB business when we describe how to build a shared library.
Distinguishing between linkable and loadable libraries makes build management easier--even on the PPC, where it isn't strictly necessary. In theory, you could replace the linkable libraries to create different versions of the same app (a PR2 version and a Release 3 version, for example).
As in PR2, the two fundamental libraries, libbe and libroot, are included by default by the BeIDE. To link against additional libraries, you have to add the linkable libraries to the project yourself--don't add the loadable libraries.
If you're building a kernel-loaded driver, you should remove the libroot.so library from your project, and add _KERNEL_.LIB and kitruntime_sta.a. The (minimally) complete driver library suite looks like this:
If you're building a normal application or a static library, you don't have to export symbols. However, if you're developing a shared library you must explicitly export every global symbol in your library. We recommend you use the __declspec() macro to export your symbols. To export a symbol, you declare it thus...
|
Some examples:
|
To import these symbols, an app that wants to use your library must reverse the declaration by replacing dllexport with dllimport:
|
The trouble with this system is that it implies two sets of headers, one set for building your library (which would declare dllexport) and another set that the library client would use (which would declare dllimport). To unify the Be headers, the Be libraries use macros, defined in BeBuild.h, that throw the import/export switch. For example, here's the macro for libbe:
|
When libbe is being built (at Be), a private compiler directive defines _BUILDING_be to be non-zero, thus causing _IMPEXP_BE to export symbols. Before the headers are shipped, _BUILDING_be is set to zero so that _IMPEXP_BE imports symbols.
You may want to emulate this system by defining your own library macros:
WARNING: The use of #pragma to export symbols, while supported, is discouraged. The __declspec method may be clunky, but it's the standard in the PC world.
Since the symbols in an add-on are imported programmatically (through get_image_symbol()), you don't have to use the __declspec() business when loading an add-on. But you do have to __declspec(dllexport) the symbols when you're building your add-on.
To convert your PPC resources into Intel resources, you need two tools:
Both programs live in /boot/beos/bin on their respective CDs: rescvt_intel is on the Intel BeOS CD, rescvt_ppc is on the PPC BeOS CD. You can also download the programs from the Be FTP site:
rescvt_ppc.zip
rescvt_intel.zip
To use the tools, follow these steps:
WARNING: rescvt_intel will crash your system if you pass it an executable. You must only pass in App.res files.
If you've followed these instructions correctly, the resources will be automatically added to your executable the next time you build your project .