473,386 Members | 1,812 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,386 software developers and data experts.

Debugging Help

Has anybody downloaded the free Microsoft Visual C++ studio? If yes,
can some body tell me if it works?? I have a very short code (pasted
below) that compiles on my friend's computer but doesn't compile on
mine. I get the following errors:

Build started: Project: File Alpha, Configuration: Debug Win32 ------
Linking...
MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol
_main referenced in function ___tmainCRTStartup
C:\Documents and Settings\Lara\My Documents\Visual Studio
2005\Projects\Invest Alpha\Debug\Invest Alpha.exe : fatal error
LNK1120: 1 unresolved externals
Build log was saved at "file://c:\Documents and Settings\Lara\My
Documents\Visual Studio 2005\Projects\File Alpha\File
Alpha\Debug\BuildLog.htm"
File Alpha - 2 error(s), 0 warning(s)

Here is my code:
#include <iostream.h>;
/*Declaring a variable - matrix 4x10*/
float Start_Data[10][4] =
{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,2 0};
/*declaring a function that substracts the third column from the second
column*/
int Get_Range (Range)
{
int Range [10];
for (int i =0; i <=10; i++)
Range = Raw_Data [i][3] - Raw_Data [i][2];
return Range;
};

WHAT AM I MISSING?!?!

Apr 9 '06 #1
7 3254
i've only used the regular visual c++ at my school, but it's good to know there is a free version out there....
did you start a new project? I know that a lot of the #define stuff in visual c++ is pretty specific. I usually just start an empty project and paste the bulk of my code into the run file, using the premade includes and whatnot.... then you can add classes as you go.
Apr 9 '06 #2
On 9 Apr 2006 08:52:52 -0700, w8*******@yahoo.com wrote in
comp.lang.c++:
Has anybody downloaded the free Microsoft Visual C++ studio? If yes,
can some body tell me if it works?? I have a very short code (pasted
below) that compiles on my friend's computer but doesn't compile on
mine. I get the following errors:

Build started: Project: File Alpha, Configuration: Debug Win32 ------
Linking...
MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol
_main referenced in function ___tmainCRTStartup
C:\Documents and Settings\Lara\My Documents\Visual Studio
2005\Projects\Invest Alpha\Debug\Invest Alpha.exe : fatal error
LNK1120: 1 unresolved externals
Build log was saved at "file://c:\Documents and Settings\Lara\My
Documents\Visual Studio 2005\Projects\File Alpha\File
Alpha\Debug\BuildLog.htm"
File Alpha - 2 error(s), 0 warning(s)

Here is my code:
#include <iostream.h>;
/*Declaring a variable - matrix 4x10*/
float Start_Data[10][4] =
{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,2 0};
/*declaring a function that substracts the third column from the second
column*/
int Get_Range (Range)
{
int Range [10];
for (int i =0; i <=10; i++)
Range = Raw_Data [i][3] - Raw_Data [i][2];
return Range;
};

WHAT AM I MISSING?!?!


A complete standard C++ program begins with a function named main()
that returns an int and accepts either no arguments, or two arguments
if you want to accept and process command line arguments. Your
program does not contain a main() function that meets these
requirements, so the linker is complaining that it can't find this
function, and therefore can't put together a complete program.

Try adding a main() function.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://c-faq.com/
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
Apr 9 '06 #3
w8*******@yahoo.com wrote:
Has anybody downloaded the free Microsoft Visual C++ studio? If yes,
can some body tell me if it works?? I have a very short code (pasted
below) that compiles on my friend's computer but doesn't compile on
mine. I get the following errors:
I guess the following code as it is **probably will not** compile.

Build started: Project: File Alpha, Configuration: Debug Win32 ------
Linking...
MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol
_main referenced in function ___tmainCRTStartup
C:\Documents and Settings\Lara\My Documents\Visual Studio
2005\Projects\Invest Alpha\Debug\Invest Alpha.exe : fatal error
LNK1120: 1 unresolved externals
This complains about the fact that there is no main() function in your
code. You could have :

int main()
OR
int main(int argc, char **argv)
Build log was saved at "file://c:\Documents and Settings\Lara\My
Documents\Visual Studio 2005\Projects\File Alpha\File
Alpha\Debug\BuildLog.htm"
File Alpha - 2 error(s), 0 warning(s)

Here is my code:
#include <iostream.h>;
No need to have semicolons. I would prefer <iostream> against the
deprecated <iostream.h>
/*Declaring a variable - matrix 4x10*/
float Start_Data[10][4] =
{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,2 0};
/*declaring a function that substracts the third column from the second
column*/
int Get_Range (Range) What is range ? The parameters need a data type.

int Get_Range (<data_type> Range)
{
int Range [10];
Redeclaration of Range.
for (int i =0; i <=10; i++)
Range = Raw_Data [i][3] - Raw_Data [i][2];
What is Raw_Data ?
return Range;
};
No need to have semicolons (;) after closing curly braces.

WHAT AM I MISSING?!?!


Apr 10 '06 #4
Jaspreet <js***********@gmail.com> wrote:
w8*******@yahoo.com wrote:
#include <iostream.h>;
No need to have semicolons. I would prefer <iostream> against the
deprecated <iostream.h>


IIRC, this is a common misconception. <iostream.h> (and other C++-only
headers) are NOT deprecated but purely non-standard; their existence
came about before the standard, and many older compilers provided it.
AFAIK the newer versions of VS .NET do not even provide the old versions
anymore.
No need to have semicolons (;) after closing curly braces.


Unless you are declaring a struct or class.

--
Marcus Kwok
Apr 10 '06 #5
Marcus Kwok wrote:
IIRC, this is a common misconception. <iostream.h> (and other C++-only
headers) are NOT deprecated but purely non-standard; their existence
came about before the standard, and many older compilers provided it.
AFAIK the newer versions of VS .NET do not even provide the old versions
anymore.


Doesn't that mean they were deprecated (a real language-law term), and then
removed?

(Note that Herb Sutter makes such decisions for VC++ these days...)

Students of C++ need to be told two things:

- select modern tutorials that use <iostream>, not <iostream.h>

- to write the most portable possible code, you might find
yourself using <iostream.h>

If you don't need portable code, don't bother to wonder what happened to
<iostream.h>.

--
Phlip
http://www.greencheese.org/ZeekLand <-- NOT a blog!!!
Apr 10 '06 #6
Phlip <ph*******@gmail.com> wrote:
Marcus Kwok wrote:
IIRC, this is a common misconception. <iostream.h> (and other C++-only
headers) are NOT deprecated but purely non-standard; their existence
came about before the standard, and many older compilers provided it.
AFAIK the newer versions of VS .NET do not even provide the old versions
anymore.
Doesn't that mean they were deprecated (a real language-law term), and then
removed?


Well, after doing more research:
http://www.comeaucomputing.com/techtalk/#cname
http://groups.google.com/group/comp....6a8286c4de9e66

they can be considered "implicitly deprecated", though in terms of the
Standard, they are not deprecated since they never existed. Many
compilers include them *as an extension* for compatibility with
pre-Standard implementations (paraphrased from the Comeau link). The
headers that have been explicitly deprecated by the Standard are the
C-headers <xxx.h> in favor of the newer <cxxx> headers, though as Comeau
points out, this deprecation is somewhat controversial.
(Note that Herb Sutter makes such decisions for VC++ these days...)

Students of C++ need to be told two things:

- select modern tutorials that use <iostream>, not <iostream.h>
Yes, good advice, though obviously that shouldn't be the only criteria
:)
- to write the most portable possible code, you might find
yourself using <iostream.h>
This one's a little tricky, since older compilers may need <iostream.h>
but newer ones may not even provide it, so you may need some sort of
mechanism to decide which one to #include.
If you don't need portable code, don't bother to wonder what happened to
<iostream.h>.


I need code that is portable to "modern" implementations :)

--
Marcus Kwok
Apr 10 '06 #7
Phlip wrote:
Marcus Kwok wrote:
IIRC, this is a common misconception. <iostream.h> (and other
C++-only headers) are NOT deprecated but purely non-standard; their
existence came about before the standard, and many older compilers
provided it. AFAIK the newer versions of VS .NET do not even
provide the old versions anymore.


Doesn't that mean they were deprecated (a real language-law term),
and then removed?


In which C++ standard were they declared to be deprecated?

Brian
Apr 10 '06 #8

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

Similar topics

3
by: Steve Wark | last post by:
I have a Windows 2003 Web server on which I was debugging remotely with no problems. I then moved this server to a different domain and now remote debugging will not work, the error is; ...
5
by: Don Hans | last post by:
Gents, Have .Net2003 Enterprise architect installed on a Win2k Server with IIS. Even logged in as administrator, I cannot run any ASP.NET app with debugging. I always get the error "Unable to...
0
by: ZMan | last post by:
Scenario: This is about debugging server side scripts that make calls to middle-tier business DLLs. The server side scripts are legacy ASP 3.0 pages, and the DLLs are managed DLLs...
16
by: Serdar Kalaycý | last post by:
Hi everybody, My problem seems a bit clichè but I could not work around. Well I read lots of MSDN papers and discussions, but my problem is a bit different from them. When I tried to run the...
7
by: Frank | last post by:
I'm running a mixed ASP / ASP.NET environment. I can use the debugger in for the ASP.NET code, no problems. But when I turn on ASP Debugging for the project, I get the error message: "Error...
1
by: Michiel | last post by:
Hello, I use Visual Studio .Net 2003 Professional (Trial version) on Windows XP Professional (Dutch version). I have a Windows Server 2003 with IIS 6 (UK version). There is no domain, just a...
6
by: KevinGPO | last post by:
I am currently developing a website in ASP (VBScript) using MS Visual C#.NET IDE. I just create a new "ASP.NET Web Application" and point to my local webserver (IIS) of my website address. Then I...
5
by: phnimx | last post by:
Hi , We have developed a number of plug-in .NET Library Components that we typically deploy with our various applications by installing them into the GAC. Each of the applications contains an...
5
by: rn5a | last post by:
Can someone please suggest me a text editor especially for DEBUGGING ASP scripts apart from Microsoft Visual Interdev? I tried using Visual Interdev & created a project but Interdev generates...
2
jwwicks
by: jwwicks | last post by:
C/C++ Programs and Debugging in Linux This tutorial will give you a basic idea how to debug a program in Linux using GDB. As you are aware Visual Studio doesn’t run on Linux so you have to use...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.