Visual Studio Tutorials: Setting up Visual Studio
From NXT++
Lately, many people have had trouble compiling with NXT++ using VC++. I decided to make this tutorial to clear up confusion. I am a visual learner, so I hope these screenshots will be of assistance to those like me. Let's begin.
After opening up VC++, create an new project by going to File->New->Project....
When the dialog comes up, make sure you select Win32 Console Application and give the new project a useful name. Click OK.
After that, a new dialog pops up. It lets you configure your project a little more. We want to make a blank project, so we go to Application Settings and check Empty Project. Click Finish.
Once inside the project, we need to create a new .cpp file. Do this by right clicking Source Files (in the left sidebar for me) and going to Add->New Item....
In the new dialog, be sure to mark C++ File(.cpp) and give it a name also. Click Add to continue.
Put some code in. Simple as that.
Normal code would compile right now. NXT++ projects require a little more attention to the project settings. To edit the settings, got to Project->[Project's name] Properties... in the menu.
This takes you to a confusing dialog. Fortunately for us, we only have to pay attention to 3 things. For the first, in the settings tree, navigate to Configuration Properties->C/C++->General. After that, go to Additional Include Directories and type in where your NXT++ /include folder is. This shows VC++ where to find NXT++.h Just forget the $(SolutionDir) stuff from the screenshot. One example would be 'C:\nxt++files\include'.
Now, navigate to Configuration Properties->Linker->General. This is similar to the last step. All you have to do is go to Additional Library Directories, and add the location of your NXT++ /bin/win32 folder is. This shows VC++ where to find the NXT++ library file you built earlier. Again, forget about $(SolutionDir). An example would be C:\nxt++files\bin\win32'.
Only one more setting to go. Navigate to Configuration Properties->Linker->Input, and look at Additional Dependencies. From there, just add NXT++d.lib if you are under the debug configuration or just plain NXT++.lib if you are under the release configuration.
Finally to compile, go to Build->Build Solution in the menu.
This is what the build output should look like if you did everything correctly. If not, and you cannot figure out why, start a new thread on the forums. Good luck and happy coding!












