LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-18-2003, 11:23 PM   #1
Red Guy
Member
 
Registered: May 2002
Location: Tampico, Tamaulipas, México
Distribution: Mandrake 9.0
Posts: 42

Rep: Reputation: 15
Unhappy I can't build static programs


I want to put a program into a CD and need build a program without shared libraries, I try with the command:

gcc -o myprogram myprogram.c -lncurses -static

but show the next message error

/usr/bin/ld: cannot find -lc
collect2: ld returned 1 exit status

I try with another programs that uses another libraries and get the same error (with another libraries) but if compiles dinamically the program is succesfully

Should I link separately???

How can do it???
 
Old 01-18-2003, 11:32 PM   #2
niknah
Member
 
Registered: Dec 2002
Location: In front of a computer
Distribution: UPS, DHL, FedEx
Posts: 466

Rep: Reputation: 38
you need the libc.a file
it should be on most installations, trying installing glibc again.
 
Old 01-18-2003, 11:47 PM   #3
Red Guy
Member
 
Registered: May 2002
Location: Tampico, Tamaulipas, México
Distribution: Mandrake 9.0
Posts: 42

Original Poster
Rep: Reputation: 15
How can build this (any .a) file???

Last edited by Red Guy; 01-19-2003 at 01:10 AM.
 
Old 01-19-2003, 01:43 AM   #4
niknah
Member
 
Registered: Dec 2002
Location: In front of a computer
Distribution: UPS, DHL, FedEx
Posts: 466

Rep: Reputation: 38
you probably don't want to compile libc.a, you have to rebuild glibc which takes forever.

on my computer it came from the glibc-devel package

check that it's not at /lib or /usr/lib first, that's where it normally is.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
g++ static build problem Joe-E Programming 7 10-21-2004 01:05 AM
FC2 Overriding static if in favor of dhcp system set for static pkraus109 Linux - Networking 8 09-21-2004 11:13 AM
How can I use gcc to build a static library? vtluu Red Hat 1 04-12-2004 10:45 AM
static compilation of Qt programs tb_4js Linux - Software 0 04-25-2003 08:13 AM
Glibc 2.3.1 build causes segfaults with static bash mdh Linux From Scratch 2 11-12-2002 06:08 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration