LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-13-2006, 09:35 AM   #1
krmane
Member
 
Registered: May 2006
Posts: 49

Rep: Reputation: 15
how to create static applications with ncurses?


hello,
I have a library specific question,
cound not figure out where to put this question so first of all I am sorry if this is the wrong place.
I am ready to be flaimed if this is the case but this is very urgent.
I am developing a customised slackware distro for my device. the device is a single board computer with samual c3 processor (intel compatible), 128 mb ddr ram and via chipset.
well, the problem is this.
I have used ncursis library to develop my program.
I will need to statically link my application with ncursis so that I don't need to coppy all that include files and the lib files.
I want to have a single executable in which the ncursis library is included.
it is going to be very difficult for me and tedious to copy all the headers and libraries.
if any one has done a similar thing please let me know how ncursis can be statically linked into my custom program.
thanks,
Krishnakant.
 
Old 07-13-2006, 10:06 AM   #2
patrokov
Member
 
Registered: Jan 2006
Location: Riviera Beach
Distribution: Slackware -current, ArchLinux
Posts: 59

Rep: Reputation: 15
From the ncurses programming guide: http://www.apmaths.uwo.ca/~xli/ncurses.html
Using ncurses library
To compile your C/C++ programs using ncurses/curses library you need to include the curses header file <curses.h>. For ncurses, you may include either <curses.h> or <ncurses.h>. In some systems, you must include <ncurses.h>.
Code:
#include <curses.h>
To link the programs you need to use the -lcurses or -lncurses option, like
Code:
gcc -lncurses prog.c
This way the program is dynamically linked to the ncurses library. To run it in another computer, the system must have the ncurses library installed. If you want to avoid the trouble, you may have it statically linked. To do that, find the file libncurses.a in /usr/lib and do
Code:
gcc prog.c libncurses.a
 
  


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
How do I create a static lib with g++? BrianK Programming 1 05-27-2005 07:30 PM
How to Create a Static IP? raid517 Linux - Networking 6 04-16-2005 01:58 AM
how to create static ls? sawoy Programming 7 04-20-2004 01:20 AM
Static Bind Applications to Kernel; cross compilation Alybyzrp Linux - Newbie 0 11-25-2003 01:38 PM
ncurses-5.2-28 conflicts with file from package ncurses-5.2-12 tubby Linux - Software 4 06-16-2002 12:00 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:49 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