473,799 Members | 2,926 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1121
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
3457
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++ compiler. I need to compile it under UNIX platform. correct? any other alternatives?? Please advise. Thanks!!
8
2699
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 partially? Something like: fileA.c fileB.c And I can compile fileA.c with debug info and compile fileB.c without debug info?
10
4475
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 Enterplise Linux 3 ES, and applied FixPack fp5_mi00069.tar to it. After creating an instance, starting the database, creating a database, and entering the table definitions, all of which seems to work OK, I entered a tiny 8-row table and can do...
2
3320
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 - Win32 Debug-------- ------------ Compiling... pp.cpp c:\program files\microsoft visual studio\vc98
13
1961
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. Thanks, Nick Z.
1
2089
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. Here is what I'm after. There are many programmers in my department, but only I use Visual Studio .NET 2003, the rest are using older technologies right now. If I was ever unavailable and they needed to make a change to one of my programs, they'd...
7
1460
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 will not initialize on other systems. After doing some digging I believe the problem is that I need to compile for Win32 platform instead of .NET platform. But that option is not available in the drop-down in Configuration Manager; .NET is...
0
999
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 question arises in licensing (when else?). The LGPL has pretty clear boundaries on static versus dynamic linking. That would be pretty clear in the old days using MFC programs and code compiled with VS6 C++ into DLLs. But what about .NET assemblies? ...
1
1700
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 file. still iam not able to compile the csharp file. the error generated is: csc is not recognized as internal or external command. But in another system in which visual studio has been installed, i am able to compile the csharp files in cmd...
0
9687
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9541
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10251
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9072
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7564
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6805
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5463
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4139
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2938
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.