LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 05-11-2009, 01:41 AM   #1
ikasafitri
LQ Newbie
 
Registered: Apr 2009
Posts: 2

Rep: Reputation: 0
How to compile file with 4 library file?


Dear friends,

I want to compile a c file called read_pgm.c
It has more than 4 library files:
matrix.c
matrix.h
strfun.c
strfun.h
uchar_matrix.c
uchar_matrix.h
pgmio.c
pgmio.h
color.h

I successfully compiled 4 files which are
matrix.c
strfun.c
uchar_matrix.c
pgmio.c

and when i try to compile read_pgm.c, with this command:
gcc -o read_pgm1 read_pgm.c pgmio.o -lm
./read_pgm1
result:
segmentation fault
and then,
sudo ./read_pgm1
result:
segmentation fault

It should ask me password, isn't it?
Any suggestion?

Thanks for your help...

Best Regards,

Ika
 
Old 05-11-2009, 04:50 AM   #2
weibullguy
ReliaFree Maintainer
 
Registered: Aug 2004
Location: Kalamazoo, Michigan
Distribution: Slackware-current, Cross Linux from Scratch, Gentoo
Posts: 2,744
Blog Entries: 1

Rep: Reputation: 224Reputation: 224Reputation: 224
Use gdb to debug your program.
 
Old 05-12-2009, 03:17 AM   #3
ikasafitri
LQ Newbie
 
Registered: Apr 2009
Posts: 2

Original Poster
Rep: Reputation: 0
thx

Thks for your info.
 
  


Reply

Tags
file, library


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
missing Library File LinLove Linux - Software 3 11-27-2007 05:00 AM
Compiling library files into another library file. knobby67 Programming 3 04-10-2007 02:07 PM
how to know dependencies of library file? shamju Linux - Software 2 09-25-2006 12:53 PM
library file missing edgjerp Linux - Software 6 08-27-2006 03:42 AM
howto compile bin with my library using all-static and shared linked standart library stpg Programming 4 06-29-2004 04:20 AM


All times are GMT -5. The time now is 03:41 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration