public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* RE: collect2: ld returned 1 exit status
@ 2004-09-13 16:20 lrtaylor
  0 siblings, 0 replies; 4+ messages in thread
From: lrtaylor @ 2004-09-13 16:20 UTC (permalink / raw)
  To: learning_c, gcc-help

It looks like you may have forgotten to define (provide an
implementation for) your destructor.

Thanks,
Lyle


-----Original Message-----
From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On
Behalf Of learning c++
Sent: Sunday, September 12, 2004 2:04 AM
To: gcc-help@gcc.gnu.org
Subject: collect2: ld returned 1 exit status

Hi, everyone:
I compiled a program and the result is:

Expr::~Expr [in-charge]()
collect2: ld returned 1 exit status

In my program, I defined the a class "Expr" and constructor "Expr"

class Expr
{
  int val1;
  int val2;
  char op;

  static int value(char c);

public:
  Expr(string const&);
  int operator () () const;
  void print(ostream& useStream) const;
  ~Expr();
};

_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*. 
http://join.msn.com/?page=features/featuredemail

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: collect2: ld returned 1 exit status
  2006-09-27 13:51 Yuen Sin Cheong
@ 2006-09-27 14:11 ` John Love-Jensen
  0 siblings, 0 replies; 4+ messages in thread
From: John Love-Jensen @ 2006-09-27 14:11 UTC (permalink / raw)
  To: Yuen Sin Cheong, MSX to GCC

Hi Yuen,

The problem is that you did not specify a main() function in your
program.cpp.

But, from your naming, it appears that you are attempting to make a shared
object library.  You should check the syntax for how to make a shared object
library on your platform.  You might need another switch, such as -shared
(the exact syntax can vary by platform).

HTH,
--Eljay

^ permalink raw reply	[flat|nested] 4+ messages in thread

* collect2: ld returned 1 exit status
@ 2006-09-27 13:51 Yuen Sin Cheong
  2006-09-27 14:11 ` John Love-Jensen
  0 siblings, 1 reply; 4+ messages in thread
From: Yuen Sin Cheong @ 2006-09-27 13:51 UTC (permalink / raw)
  To: gcc-help

Dear All,

I tried to compile a program but I got the following error message:

/usr/lib64/gcc/x86_64-suse-linux/4.0.2/../../../../lib64/crt1.o: In function 
`_start':
../sysdeps/x86_64/elf/start.S:109: undefined reference to `main'
collect2: ld returned 1 exit status

Any advice on what might be the cause of this error is greatly appreciated.

I did the compilation on SuSE 10 Linux as follows:

g++ program.cpp -o program.so

Many thanks for your help.

Regards,
Yuen.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* collect2: ld returned 1 exit status
@ 2004-09-12  8:03 learning c++
  0 siblings, 0 replies; 4+ messages in thread
From: learning c++ @ 2004-09-12  8:03 UTC (permalink / raw)
  To: gcc-help

Hi, everyone:
I compiled a program and the result is:

Expr::~Expr [in-charge]()
collect2: ld returned 1 exit status

In my program, I defined the a class "Expr" and constructor "Expr"

class Expr
{
  int val1;
  int val2;
  char op;

  static int value(char c);

public:
  Expr(string const&);
  int operator () () const;
  void print(ostream& useStream) const;
  ~Expr();
};

_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*. 
http://join.msn.com/?page=features/featuredemail

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-09-27 14:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-13 16:20 collect2: ld returned 1 exit status lrtaylor
  -- strict thread matches above, loose matches on Subject: below --
2006-09-27 13:51 Yuen Sin Cheong
2006-09-27 14:11 ` John Love-Jensen
2004-09-12  8:03 learning c++

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).