Visual Studio for cross platform (windows/linux) developement?

  • Thread starter Michael Reichenbach
  • Start date
M

Michael Reichenbach

After working with script languages, notepad(++) and co. and several
other ide`s I found something which really improved my productivity
(Visual Studio 2005). It`s imho better then dev-cpp... I worked with C#
and VB.net a bit and it was really easy because of the debugger, the
interactive debugger, intellisense, command completer and so on.

I would like to stick to this ide.

But I thought about to invest in C++ instant of C# / VB.net because .net
is not portable enough (programs can`t compile to native code, them need
always the .net framework and them can`t be written cross platform from
windows to linux because mono is not ready yet). C++ is a bit better in
this case.

My question is, if I decide to use VS05 to write C++... Are I limited to
Windows? Or if I use cross platform frameworks like qt I just need to
recompile under linux?

Or is VS05 C++ incompatible with gcc/qt and so on?

I couldn`t even compile a hello world example for gcc.
(http://www2.latech.edu/~acm/helloworld/c++.html) I guess because VS05
don`t has iostream.h. But if I would add this reference I could use VS05
anyway?

Is there any reason against VS05 for cross platform? What is the most
used ide for cross platform C++? Dev-cpp?
 
B

BobR

Michael Reichenbach said:
I couldn`t even compile a hello world example for gcc.
(http://www2.latech.edu/~acm/helloworld/c++.html) I guess because VS05
don`t has iostream.h.

Because that file does not exist! Try <iostream>!!!!

#include <iostream>

int main(){ using std::cout; // for NG post
cout << "Hello World!" << std::endl;
return 0;
} // main()

[ Use g++, gcc is the GCC 'C' compiler!! ]
--
Bob R
POVrookie
- -
Dev-C++ IDE: http://www.bloodshed.net/
MinGWStudio http://www.parinyasoft.com/ (has GNU/Linux port)
Code::Blocks http://www.codeblocks.org/
 
I

Ian Collins

Michael said:
Yeah, it`s working with g++ and dev-cpp (which is using g++ aswell too).

But what about the ide from microsoft (vs05)?

What about it? Please retain the context in the message you are
replying to.

VS is windows only.
 
M

Michael Reichenbach

Yeah, it`s working with g++ and dev-cpp (which is using g++ aswell too).

But what about the ide from microsoft (vs05)?
 
B

Boris

After working with script languages, notepad(++) and co. and several
other ide`s I found something which really improved my productivity
(Visual Studio 2005). It`s imho better then dev-cpp... I worked with C#
and VB.net a bit and it was really easy because of the debugger, the
interactive debugger, intellisense, command completer and so on.

I would like to stick to this ide.

But I thought about to invest in C++ instant of C# / VB.net because .net
is not portable enough (programs can`t compile to native code, them need
always the .net framework and them can`t be written cross platform from
windows to linux because mono is not ready yet). C++ is a bit better in
this case.

My question is, if I decide to use VS05 to write C++... Are I limited to
Windows? Or if I use cross platform frameworks like qt I just need to
recompile under linux?

Or is VS05 C++ incompatible with gcc/qt and so on?

If you (as a developer) don't change the operating system on a daily base
just go ahead with what you prefer (eg. Visual Studio) and write
C++ standard code. If you use third-party libraries you need to check
their documentation to see if they are cross-platform.

Boris
 
Z

Zeppe

Michael said:
> After working with script languages, notepad(++) and co. and several
> other ide`s I found something which really improved my productivity
> (Visual Studio 2005). It`s imho better then dev-cpp...

Really good choice. Visual studio (even in the free edition, visual c++
express edition) is a professional tool , and it's very very powerful.
You just can't compare it to dev-cpp.
> I worked with C#
> and VB.net a bit and it was really easy because of the debugger, the
> interactive debugger, intellisense, command completer and so on.
>
> I would like to stick to this ide.
>

Good idea. Everybody should be able to hoose the ide that suits better
to him, in my opinion.
> My question is, if I decide to use VS05 to write C++... Are I limited to
> Windows? Or if I use cross platform frameworks like qt I just need to
> recompile under linux?

Oh, well, visual studio is for windows, in the sense that if you compile
a code, the program will run only under windows (except for emulators).
But, remember, C++ is a standard thing, and both Visual c++ and g++ are
becoming more and more stick to the standard. So, as long as you write
standard code, you are guaranteed that it will compile on both the
compilers. So, feel free to develop under windows, and from time to
time, if the portability is your concern, try to compile your code under
g++ and linux to see if it still works (the best thing would be a test
suite...).

Another thing are the libraries. Not all of them are oprtable. Qt is,
but in the free edition (for non-commercial use) visual c++ is not
supported. Fortunately, you can compile them even if they are not
supported, it's not illegal. But it's a little bit tricky. You can find
tutorials online.
> Or is VS05 C++ incompatible with gcc/qt and so on?

see above. It's not, with qt, it may be with other tools.
> I couldn`t even compile a hello world example for gcc.
> (http://www2.latech.edu/~acm/helloworld/c++.html) I guess because VS05
> don`t has iostream.h. But if I would add this reference I could use VS05
> anyway?

the headers with the .h ending are obsolete and are being gradually
removed (their usage can lead to errors as well). The c++ headers are
without extension (iostream, vector, map...) and the c header have a c
in front of them (cstdio, cstdlib, cmath...).

Good work!

Regards,

Zeppe
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top