pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Huxton <dev@archonet.com>
To: Louise Catherine <r1c4n@yahoo.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Make C file for create type
Date: Fri, 05 Aug 2005 11:48:06 +0100
Message-ID: <42F343E6.5020402@archonet.com> (raw)
In-Reply-To: <20050805085118.98162.qmail@web33411.mail.mud.yahoo.com>
References: <20050805085118.98162.qmail@web33411.mail.mud.yahoo.com>

Louise Catherine wrote:
> Hallo,
> I found a problem making new data type kata,expecially
> when make the C file ,can anyone help me solve it. 
> 
> This error occur when I'm compiling the C file :
> /usr/lib/gcc-lib/i586-suse-linux/3.3.1/../../../crt1.o(.text+0x18):
> In function `_start':
> ../sysdeps/i386/elf/start.S:98: undefined reference to
> `main'
> collect2: ld returned 1 exit status

You don't have a main() function. This is the function that gets called 
when you run an executable. Looking at your code, it seems like you want 
to produce a library rather than a standalone program.

This might help:
  http://www.tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html
Also, read the section on C-language functions in the manuals.

Also, you're clearly missing bound-checking on your various copy 
operations, and I think you're supposed to use palloc() rather than 
malloc() if this is supposed to sit inside PostgreSQL.

Bear in mind it's been 10 years since I wrote any C though, so use your 
own judgement on my advice.

--
   Richard Huxton
   Archonet Ltd



view thread (2+ messages)

Message-ID: <42F343E6.5020402@archonet.com>
Permalink:  ../42F343E6.5020402@archonet.com/
Also on:    postgresql.org/message-id/42F343E6.5020402@archonet.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: dev@archonet.com, r1c4n@yahoo.com
  Subject: Re: Make C file for create type
  In-Reply-To: <42F343E6.5020402@archonet.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox