473,396 Members | 1,940 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Is it possible to compile and run c programs in the visual C++ .NE

I have a bunch of C programs from sun. I would like to port them over to PC.
I am wondering if I can simply recompile and run them in Visual C++ .NET
without
having to making a lot of changes? Specifically how to invoke C run time
library from Visaul C++ .NET?
Nov 17 '05 #1
3 1107
Hi Kueishiong!
I have a bunch of C programs from sun. I would like to port them over to PC.
I am wondering if I can simply recompile and run them in Visual C++ .NET
without
having to making a lot of changes? Specifically how to invoke C run time
library from Visaul C++ .NET?


MS C++(.NET) is a "normal" C/C++ compiler, so you can just create a
project and insert all c/cpp-files.
It also supports the standard C-Runtime.
So there should be no "big" problem if you only relay on the CRT...

--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/
Nov 17 '05 #2
Hi Jochen!

When I create a new console project, the template main function created is
always a C++ file from VC++ .NET. Is it possible to create a new project with
the template main function created a C file? Also is it possible to have a
project with both C and C++ source files?

"Jochen Kalmbach [MVP]" wrote:
Hi Kueishiong!
I have a bunch of C programs from sun. I would like to port them over to PC.
I am wondering if I can simply recompile and run them in Visual C++ .NET
without
having to making a lot of changes? Specifically how to invoke C run time
library from Visaul C++ .NET?


MS C++(.NET) is a "normal" C/C++ compiler, so you can just create a
project and insert all c/cpp-files.
It also supports the standard C-Runtime.
So there should be no "big" problem if you only relay on the CRT...

--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/

Nov 17 '05 #3
Hi Kueishiong!
When I create a new console project, the template main function created is
always a C++ file from VC++ .NET. Is it possible to create a new project with
the template main function created a C file?
There is no template for C-files. But you can simply rename the
"cpp"-extension to "c" (or delete the file and create a new one).

You also should be sure to disable "pre-compiled headers" (in project
properties "C/C++|Precompiled headers".
Also is it possible to have a
project with both C and C++ source files?


Yes, there is no problem with that.

Just a small note:
If you want to include "c"-headerfiles then you must be sure that you
put the following around them (or include this in the h-file):

#ifdef __cplusplus
extern "C" {
#endif

#include "your-c-h-file.h"

#ifdef __cplusplus
}
#endif
--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/
Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: jrefactors | last post by:
If the C programs have UNIX system calls such as fork(), alarm(), etc.., we should call it UNIX programs, not traditional C programs? We couldn't compile the programs with system calls using VC++...
8
by: Davy | last post by:
Hi all, I use VC and gcc/gdb to compile and debug C/C++ files. But I found some of the debug version of the compiled files are too large to be run in a small RAM. Can I compile C/C++ Debug...
10
by: Jean-David Beyer | last post by:
I have some programs running on Red Hat Linux 7.3 working with IBM DB2 V6.1 (with all the FixPacks) on my old machine. I have just installed IBM DB2 V8.1 on this (new) machine running Red Hat...
2
by: Gustavo | last post by:
After updating Windows 2000 I began to get a weird compile error message: Deleting intermediate files and output files for project 'pp - Win32 Debug'. --------------------Configuration: pp -...
13
by: Nick Z. | last post by:
Whenever I try to compile a VC++ program using VS .NET 2003 I get an error saying mspdb71.dll not found. How can I fix this error? PS. I ran vsvars32.bat and it did not change a thing. ...
1
by: Raterus | last post by:
Hi, Is there a way I can see what commands VS.net is using to compile my asp.net projects? I'm sure its using the vbc/csc programs, but I'd love to see the command-line options it is using. ...
7
by: dwasifar | last post by:
I'm an occasional VB user who has just installed VB .NET 2003 (previously using VB6). I migrated a VB6 project over, tweaked it, and compiled it. It runs fine on the machine I compiled it on, but...
0
by: mumin via DotNetMonster.com | last post by:
All, quick question about assemblies. If someone uses another .NET assembly in a . NET program, is the first program considered "dynamically linked" into the new program? Of course the...
1
by: kalaivanan | last post by:
hi, how should i compile csharp programs in the cmd command prompt without being installing visual studio .net. I have installed framework 1.1 and sdk. also i have executed the vsvars32 btach...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.