NEWBIE QUESTION: Writing Small Program for Linux

J

John Ryan

I'm a PHP/MySQL web developer who doesn't have a clue about c++, but I'm
willing to learn a bit to accomplish a task. I've a copy of Visual studio
with visual c++, but need to write a quick program to upload to my web
server to run on linux. Is it easy to convert Visual C++ code into Linux??
 
A

Aggro

John said:
I'm a PHP/MySQL web developer who doesn't have a clue about c++, but I'm
willing to learn a bit to accomplish a task. I've a copy of Visual studio
with visual c++, but need to write a quick program to upload to my web
server to run on linux. Is it easy to convert Visual C++ code into Linux??

That depends how much code you have and what you have in it. If it is
standard C++, then it will compile just like that on Linux. If a lot of
Windows extensions are used in the code, then it might be a bigger problem.
 
S

Shane Beasley

John Ryan said:
I'm a PHP/MySQL web developer who doesn't have a clue about c++, but I'm
willing to learn a bit to accomplish a task. I've a copy of Visual studio
with visual c++, but need to write a quick program to upload to my web
server to run on linux. Is it easy to convert Visual C++ code into Linux??

Linux programs must be built with a compiler that builds Linux
programs. Visual C++ is not one of those. The easiest way to do what
you want is to build the program on Linux using GCC, the GNU Compiler
Collection, which can compile C++ and several other languages. If it
is not installed on your Linux system, ask your administrator to
install it. If you don't have terminal access to the Linux system, you
may want to look into that, or else install it at home.

Alternatively, there's something called a "cross compiler" which can
build programs for a different system than that upon which it runs,
e.g., a Windows cross-compiler which builds Linux programs. GCC can be
built as a cross-compiler, but it's not the easiest thing to do, and
you may in fact find it nigh impossible with your admittedly limited
experience in this area.

Finally, note that this newsgroup discusses the ISO C++ language, not
issues with various C++ compilers, operating systems, or third-party
packages which happen to be written in C++. Each of these entities has
its own support venues (newsgroups, mailing lists, etc.) read by those
most familiar with the topic at hand. Please make sure to direct such
questions to the appropriate forum.

- Shane
 
T

Troll_King

John Ryan said:
I'm a PHP/MySQL web developer who doesn't have a clue about c++, but I'm
willing to learn a bit to accomplish a task. I've a copy of Visual studio
with visual c++, but need to write a quick program to upload to my web
server to run on linux. Is it easy to convert Visual C++ code into Linux??

No, it's not easy because they are incompatible. Most of that stuff
will probably be incompatible with even the next Microsoft product -
Longhorn.
 

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,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top