Strict Standards: Declaration of action_plugin_safefnrecode::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /mnt/data/www/nbee/lib/plugins/safefnrecode/action.php on line 14

Strict Standards: Declaration of action_plugin_popularity::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /mnt/data/www/nbee/lib/plugins/popularity/action.php on line 57

Warning: Cannot modify header information - headers already sent by (output started at /mnt/data/www/nbee/lib/plugins/safefnrecode/action.php:14) in /mnt/data/www/nbee/inc/auth.php on line 352

Warning: Cannot modify header information - headers already sent by (output started at /mnt/data/www/nbee/lib/plugins/safefnrecode/action.php:14) in /mnt/data/www/nbee/inc/actions.php on line 180
Creating NetBee applications [NetBee]
 

Creating NetBee applications

This section is useful in case you want to create a new program which is based on the NetBee library.

Please note that the NetBee library includes several modules, among the other the NetBee one being the most important one.

When you link against the NetBee module, this includes also the NetPDLProtoDB module, but it does not include the SockUtils and NetVM modules. Therefore, when you include NetBee alone (nbee.h), you can use all the structures defined in the NetBee and ProtoDB modules.

Vice versa, other modules are “standalone”: for instance, if you include the ProtoDB module, you do not have access to NetBee classes. The same happens for the NetVM and SockUtils modules.

How to create a program based on NetBee

The procedure required to compile a program that uses the NetBee library is the following:

  • Open Microsoft Visual C++
  • Create a new project
  • Open the menu 'Project - Settings', then follow these steps:
    • Tab “Linker”, category “General”, box “Object/Library modules”: add nbee.lib
    • Tab “Linker”, category “Input”, box “Additional library path”: add the path to [NetBee folder]/lib/
    • Tab “C/C++”, category “Preprocessor”, box “Additional include directories”: add the path to [NetBee folder]/include

Additionally, you need to include file nbee.h in your source files in order to be able to use NetBee structures and copy all the NetBee DLLs (the ones you can find in the in the NetBee/bin subfolder) into the folder that will contain your executable.

How to create a program based on another module

In case you want to use also the ProtoDB, SockUtils and NetVM modules which are part of the NetBee library (but, by default, are not included in your program) you have to:

  • Open Microsoft Visual C++
  • Create a new project
  • Open the menu 'Project - Settings', then follow these steps:
    • Tab “Linker”, category “General”, box “Object/Library modules”: add YourModule.lib
    • Tab “Linker”, category “Input”, box “Additional library path”: add the path to [NetBee folder]/lib/
    • Tab “C/C++”, category “Preprocessor”, box “Additional include directories”: add the path to [NetBee folder]/include

where YourModule will be nbprotodb, nbsockutils or nbnetvm.

Please note that these modules are not needed at 99.99% by your program. For exanple, NetBee does have some classes that use the NetVM module in a much more friendly way.

Troubleshooting

Can I use the object-oriented API exported by NetBee in a pure C program?

Yes. However, you must convince your compiler to do its job using the C++ support. In Microsoft Visual Studio, a .c file is always compiled using only C language. To overcome the problem, you must open the menu 'Project - Properties', the select the 'C/C++ - Advanced' section, the set the 'Compile As' setting with the 'Compile as C++ Code (/TP)' option.

 
docs/programming.txt · Last modified: 2009/04/20 11:35 by admin     Back to top