How do I set up a Java-like language (LeJOS NXJ) in Visual Studio 2005 that uses an external compiler? - visual-studio

Recently, I installed the JDK and a java library called LeJOS NXJ, for controlling a LEGO Mindstorms robot. I'd like to be able to set up the language to run through visual studio, which offers J# color coding. The command line to compile the program is:
nxjc "Myfile.java"
and the command line to deploy or download the program to the controller is:
nxj -r "Myfile"
How can I set up a way to make Visual Studio use these options?

When you use Visual Studio for Java work, the editor is more or less as comfortable and helpful as Notepad, so I'd strongly suggest to use an IDE with full Java support for this kind of work. There are plugins for LeJOS support for both Eclipse and Netbeans, two complete, open source, free and easy-to-use IDE's.
Try them (I'd start with Netbeans but that's entirely a personal choice) and you'll see right away what you're missing when trying to shoehorn Java into VS :-)

You should really be using Eclipse, as the Eclipse plug-in has been greatly enhanced.
Netbeans support has been dropped, as the (very simple) Netbeans plug-in that leJOS provided in the past never really was very convenient. It never properly overrided the bootclasspath of projects for NXT-side programs.
Example projects with a sample build.xml for use with Ant (or anything that supports Ant) is still available. However, the programming experience will not be as smooth as with Eclipse.

Related

Compiling the opus-codec API library

First, going to be honest. I'm a c#/java-language-level dweller. So I have no idea about how to compile native-C projects such as opus.
I've tried doing it myself, and I've tried googling it. I simply need help compiling the opus-codec API (on Windows).
Once I have the library compiled, I'll build a wrapper for it's API.
While my searches have indeed found opus wrappers targeting my current project's language (c#), I can't find an up-to-date one. I don't know if it matters, but I need it for it's VoIP capabilities.
Sorry for my stupidity in the matter.
[UPDATE]
After compiling with Visual Studio 2010: Ultimate, I have a .lib library file. I need a .dll. I don't know what I'm doing. Help?
In a C project there is going to be some way to drive a build of all the object files, libraries, etc. Basically the same thing as maven build in Java, just with different tools. You will have to have the right tools if you don't.
On unix systems it's usually Makefile driven, running command line programs that compile and link the program or library that is being built. In GUI environments like XCode or Visual Studio, there are ways to run the build directly from the UI.
Looking at the source tree, there's a directory with a number of Visual Studio 2010 projects in it - https://git.xiph.org/?p=opus.git;a=tree;f=win32/VS2010
If you're using Visual Studio, loading that up and trying a build to see if it still works is where I'd start. Or perhaps have a look at Any way to do Visual Studio "project only" build from command line? or other questions that reference msbuild.

Does VS2010 contain inbuilt wdk in it?

Previously i was using the WDK drivers separately to set the environment.
But just i came to know that VS2010 contain inbuilt wdk package in it. If it contains, how to use it. how we can start building through VS2010 ? I am currently wanted to use free build for x64 platform.
can anyone help me out in this context. I need some screen short, since m new to VS. :)
No, to my knowledge WDK is still a self-contained kit and you can't use VS2010 to build your drivers -- this is still done by running "make" and using an appropriate makefile from WDK that is distributed separately.
You can, however, use VS2010 as a code editor with syntax highlight and autocompletion to edit the source code of your driver. Any other free editor, like Notepad++ or JEdit would also do here.
I would recommend you to read the following very nice document for the start with WDK:
http://msdn.microsoft.com/en-us/windows/hardware/gg463002

Compiling without setting up a project in NetBeans or Visual Studio

In short: is there a way to compile and run single file in NetBeans or Visual Studio without having to setup and tinker with projects?
I'm currently using code::blocks as my IDE. It's fast and very simple: perfect for my needs as a begginner.
I wanted to dive a little deeper and try out a more advanced IDE such as NetBeans or Visual Studio. It appears I have to mess with projects and have a setup that seems overkill for having to compile and run one very simple .c/.cpp source file that contains less than 50-100 lines of code etc.
Is there a way around this?
You always have to setup a project - this is where information about libraries etc is found by the IDE, so it cannot do without. If you just have one file, and not a lot of dependencies you could just stick with a plain editor. Once you want auto completion of functions, refactoring, etc... you have to store the information about what is relevant somewhere, and the some sort of 'project' will become necessary.

Moving to Eclipse from Visual Studio

I'm curious about your thoughts on moving to a new IDE (specifically Eclipse). I have been hearing wonderful things about it from this community and I'm always on the lookout to try new things.
Currently I'm running Visual Studio 2005, with a bunch of external commands loaded (for compiling down to a binary, running lint, etc). We're developing C code for microcontrollers.
I've read over some of the other threads on here about the advantages and disadvantages to Eclipse and Visual Studio (specifically SO - best IDE thread and SO - best C IDE thread), but I'd like to hear your thoughts on using it for programming an embedded environment. I'd imagine that there is a simple way to use the external tools that Visual Studio currently uses (it simply calls various batch files that we've created).
Is it worth it to specifically switch over to Eclipse?
Answer to you question about way to call external tools: no problem - from eclispe you can anything: external program, batch file etc. Moreover, if you use custom build generator - you could use it transparent with eclipse.
I don't think I would switch from Visual Studio to Eclipse in hopes of getting a better IDE. Typically an embedded manufacturer makes plugins and toolchains that work specificially with Eclispe, that's what makes it worth using in the Embedded world. For example with the NetBurner plug-ins, when creating a new project you can just select New NetBurner Device Excecutable, or New NetBurner Library, all the default includes and libraries get set up for you and the proper cross platform tool chain is set up for you automatically. In the NetBurner case it also uses the Eclipse managed build process (as opposed to make files) which I find nice. There is also support for using make files if you prefer that option.
While I have a couple of tools set up to run as external tools (lint, an auto version updater, DOS prompt etc) most steps can be triggered from pre-build or post-build steps or there are many many add-ons for common needs like source code management, bug tracking, etc. There is great support for SVN, Trac and Mylyn for example. I use both VS2010 and Eclipse. I like them both but VS2010 is the better IDE. It's a little hard to compare because I do C# (and a little C++/CLI )in VS and C++ in Eclipse. That said, I wouldn't relish the though of trying set up VS to do my embedded tasks.

Importing WinSCP source files into Microsoft Visual Studio 2008?

I am pretty new to programming. I would like to download an open source project and build it in my Microsoft Visual Studio 2008. In fact, I tried to import and build the application WinSCP:
https://sourceforge.net/projects/winscp/
But I didn’t work. Please can somebody help me and tell me which files do I have to download (from sourceforge) and how to import these into Microsoft Visual Studio in order to build the application. Thank you a lot. David
WinSCP seems to be written in Borland C++ Builder or whatever it's called today. It's not a standard C++ program and wouldn't compile in any other compiler because it uses special features only present in BCB. (It uses Delphi-style components, VCL and thus the __property keyword.)
Unfortunately, a lot of Open Source projects have very poor support for Microsoft's development tools. One project that comes to mind as being not too big and having workable MSVC project files is FreeType2, but that's a library and not an application, which probably makes it not very interesting for toying around with.
In support forum of winscp, they say, that you can't compile this project in Visual Studio.
Winscp appears to be a CPP project using a makefile instead of a sln file. VS uses SLN and *proj files to control builds and such. A good way to start would be to open VS, create a new console project (and solution) and go through some tutorials online.
If you really want to just see how a large project works in VS, grab something like IronRuby or IronPython or even something like the Witty twitter client.
In the general case, it is not possible to pour the C++ sources of a program into Visual Studio and expect it to work. C++ programming environments are far too different between operating systems for that. If you have a open-source program which builds and runs fine on Linux (for example), it may need several weeks (or months) or programming effort to make it run on Windows.

Resources