Solved

BORLAND C++ 5.2

Posted on 1997-07-05
1
651 Views
Last Modified: 2012-06-22
I have a problem, when I try to compile a file, he saysError: Unresolved external '_main' referenced from H:\BC52\LIB\C0X32.OBJ(H: is my HDD)Can you help me ?
0
Comment
Question by:devil_
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 2

Accepted Solution

by:
sprinkmeier earned 40 total points
ID: 1164294
Disclaimer: I'm guessing!
The compiler thinks that you are trying to compile a program (as opposed to a library or DLL or somehting) and is looking for your main.
(H:\BC52\LIB\C0X32.OBJ contains that startup code that sets up argc and argv and then calls int main(int argc, char ** argv))

So,
a: Tell your compiler not to expect a main (option /C on command line for Compile only, no linking)
b: make sure your main is recognised. As far as I know, main has to be one of

int main()
int main(int argc, char ** argc)
int main(int argc, char ** argc, char ** envp)
(envp gives you the environment variables, NOT SUPPORTED EVERYWHERE!)

0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question