LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to compile file with 4 library file? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-compile-file-with-4-library-file-725124/)

ikasafitri 05-11-2009 01:41 AM

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

weibullguy 05-11-2009 04:50 AM

Use gdb to debug your program.

ikasafitri 05-12-2009 03:17 AM

thx
 
Thks for your info.


All times are GMT -5. The time now is 05:56 PM.