X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 61A82529C8 for ; Fri, 5 Aug 2005 08:00:45 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 73866-09 for ; Fri, 5 Aug 2005 11:00:38 +0000 (GMT) Received: from mail.metronet.co.uk (mail.metronet.co.uk [213.162.97.75]) by svr1.postgresql.org (Postfix) with ESMTP id 02E2C529B0 for ; Fri, 5 Aug 2005 08:00:37 -0300 (ADT) Received: from mainbox.archonet.com (84-51-143-99.archon037.adsl.metronet.co.uk [84.51.143.99]) by smtp.metronet.co.uk (MetroNet Mail) with ESMTP id B560D42285F; Fri, 5 Aug 2005 12:00:32 +0100 (BST) Received: from localhost (localhost.localdomain [127.0.0.1]) by mainbox.archonet.com (Postfix) with ESMTP id 40D4D15EDA; Fri, 5 Aug 2005 11:48:11 +0100 (BST) Received: from mainbox.archonet.com ([127.0.0.1]) by localhost (mainbox [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 13427-03; Fri, 5 Aug 2005 11:48:07 +0100 (BST) Received: from [192.168.1.17] (client17.office.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id 0A40315ED9; Fri, 5 Aug 2005 11:48:07 +0100 (BST) Message-ID: <42F343E6.5020402@archonet.com> Date: Fri, 05 Aug 2005 11:48:06 +0100 From: Richard Huxton User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Louise Catherine Cc: pgsql-sql@postgresql.org Subject: Re: Make C file for create type References: <20050805085118.98162.qmail@web33411.mail.mud.yahoo.com> In-Reply-To: <20050805085118.98162.qmail@web33411.mail.mud.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.058 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200508/26 X-Sequence-Number: 22254 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