Beginner Tutorial - Part 0: Building the library

From NXT++

Jump to: navigation, search

Since NXT++ is a library, you will have to compile the NXT++ source files to create it. Under windows, this special file is NXT++(d).lib. Under Linux, it is libnxtpp.a. NOTE: The Linux port of NXT++ does not currently support Bluetooth or system commands like getting the NXT's version or name. Also, let me get this straight because it is a common misconception. NXT++ is in no way, shape, or form, a way to produce .rxe files to put on the NXT. The NXT just obeys whatever the program commands it to do. Before you begin, make sure you have the LEGO Mindstorms software (the CD included) installed because it installs some crucial drivers. Also, newer NXT's should be fine, but if you have an older version (roughly 2007 or before) the NXT software and drivers will be version 1.0. Windows Vista or 64-bit OS's will not be compatible with version 1.0, so you can buy a disc for the new 1.1 version here. If you don't want to buy the new version, you must use your NXT on a computer with Windows XP.

Windows

To compile NXT++ under Windows, you will need to have VC++ 9.0 or later. You can download the Express Editions for free on the Microsoft website. NOTE: You do not have to have VC++ if you know how to compile libraries with another compiler, but VC++ is the only supported compiler. To compile, open up NXT++.sln from the build\vs90 directory and go to Build->Build Solution in the menu. You can select whether to build the debug or release versions by selecting them on the drop down menu at the top of the screen. If everything went correctly, your new library files are in the bin/win32 folder.

Linux

Linux is only compatible with versions 0.5 and below! It was taken out in NXT++ 0.6!

If you know what you are doing, the Linux version is a lot easier to compile than the Windows version. Before you begin, make sure you have downloaded and installed libusb, because NXT++ needs it to function. You also need a recent version of gcc, because there is conflict with the std library on older versions. Once you've got those things, all you have to do is cd to the NXT++ installation directory and type 'make'. Once libnxtpp.a is created, the makefile automatically moves it to usr/lib.

The fun begins

Hopefully now you should have the NXT++ library compiled and ready to go! If you had any problems along the way, feel free to ask on the forums. If you can absolutely not compile the library, you can use the legacy versions that only have a header to include.

On to Part 1: Setting up the compiler

Personal tools