Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can MS Visual C++ be use for coding C for linux?

Status
Not open for further replies.

nanao550

Technical User
Nov 8, 2002
12
US
Hello,
I know that C code for linux needs to be compile on the kernel in which it is to be used on, but can MS Visual C++ environment be use for coding C code for linux?

If not, what are some IDE development software that can be use to code C for linux?

Thanks.
 
Hi, I've recently been doing some work on linux for web purposes. You can't compile the code using VC++ but you can use VC++ to check your syntax, etc. - especially if you stick to ANSI routines.

Here's how I've been doing things:

I write my code in VC++ and syntax check wherever possible. I upload the source to my linux web server by FTP and make a telnet connection.

Once I navigate my way to the directory which holds the source file using telnet, I type in the command

[tt]gcc -o outputname.out sourcename.cpp[/tt]

this uses the built-in linux GNU c++ compiler to compile the source file. Then set the file permissions by typing this command:

[tt]chmod 0700 outputname.out[/tt]

Once the source is compiled OK (any errors will show up during compilation) you can execute your code in two ways by typing into telnet either of these commands:

[tt]./outputname.out[/tt]

or

[tt]./outputname.out&[/tt]

use the ampersand '&' if you want your program to continue running after you close the telnet connection.

Hope this gives you some pointers!

Obviously, [tt]outputname[/tt] and [tt]sourcename[/tt] in my examples are the names of your output program file and source files respectively.

[rockband]

tellis.gif

programmer (prog'ram'er), n A hot-headed, anorak wearing, pimple-faced computer geek.
 
KDEvelop is quite nice IDE tool on linux and kdbg is a good debugger. SourceForge can be used also, but it is not freeware. As qednick mentioned, you can use no IDE at all -edit sources using text editor, compile them calling the gcc compiler directly from command line or use make files.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top