LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 02-25-2008, 02:59 PM   #1
itz2000
Member
 
Registered: Jul 2005
Distribution: Fedora fc4, fc7, Mandrake 10.1, mandriva06, suse 9.1, Slackware 10.2, 11.0, 12.0,1,2 (Current)]
Posts: 732

Rep: Reputation: 30
Help me compile something :S


I've downloaded a GPL project source and I can't compile it...
here's the project link :
http://home.hiwaay.net/~taylorc/gps/...1.03.00.tar.gz

when I'm trying to compile with
Code:
gcc main.c -o main
This is what i get...

Code:
uki @ LookBusy nmead-01.03.00] $ gcc -trigraphs main.c
/tmp/ccdohiKh.o: In function `main':
main.c:(.text+0x5ca): undefined reference to `gzopen'
main.c:(.text+0x69e): undefined reference to `newconnectionmgr'
main.c:(.text+0x6c3): undefined reference to `simtalk'
main.c:(.text+0x6cd): undefined reference to `pthread_create'
main.c:(.text+0x6de): undefined reference to `talk'
main.c:(.text+0x6e8): undefined reference to `pthread_create'
main.c:(.text+0x6fa): undefined reference to `multilisten'
main.c:(.text+0x712): undefined reference to `pthread_join'
collect2: ld returned 1 exit status
Maybe I'm doing something wrong... but it seems that i.e gzopen should be on zlib.h, which is included in main.c and does exist on my path at /usr/include/zlib.h

so I'm really not sure what is wrong and I would like your help.


Thanks!
 
Old 02-25-2008, 03:14 PM   #2
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Looks like you need to link the pthreads and zlib libraries then.
 
Old 02-25-2008, 03:33 PM   #3
itz2000
Member
 
Registered: Jul 2005
Distribution: Fedora fc4, fc7, Mandrake 10.1, mandriva06, suse 9.1, Slackware 10.2, 11.0, 12.0,1,2 (Current)]
Posts: 732

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by Nylex View Post
Looks like you need to link the pthreads and zlib libraries then.
hmm... how do I do it? :SS


sorry, I don't compile alot of open projects :S
 
Old 02-26-2008, 12:48 AM   #4
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
For zlib, you need to add "-lz" and for pthreads "-lpthread". You'll also need to link the libraries that provide "newconnectionmgr", "talk", "simtalk" and "multilisten".
 
Old 02-26-2008, 01:06 AM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Daft qn: does it not come with a make file (and/or configure)? Seems a bit odd.
 
Old 02-26-2008, 04:18 AM   #6
cicorino
Member
 
Registered: May 2006
Location: Italy
Distribution: Slackware, Slackware64
Posts: 31

Rep: Reputation: 16
There should be a file named 'Makefile', this implies that it would be very helpful for you to learn how to use a lovely program named 'make' (try 'info make'), then...you should just type 'make' and press the enter key...
 
Old 02-29-2008, 05:02 AM   #7
itz2000
Member
 
Registered: Jul 2005
Distribution: Fedora fc4, fc7, Mandrake 10.1, mandriva06, suse 9.1, Slackware 10.2, 11.0, 12.0,1,2 (Current)]
Posts: 732

Original Poster
Rep: Reputation: 30
I think I got noobiefied!


Code:
zuki @ LookBusy nmead-01.03.00] $ ls -l
total 1236
-rwxr-xr-x 1 zuki users    2519 2004-07-27 03:28 Makefile
-rw-r--r-- 1 zuki users    7645 2004-07-27 03:28 connection.c
-rw-r--r-- 1 zuki users    8022 2004-07-27 03:28 listeners.c
-rw-r--r-- 1 zuki users   10047 2008-02-25 22:47 main.c
-rw-r--r-- 1 zuki users   10043 2004-07-27 03:28 main.c~
-rw-r--r-- 1 zuki users    5336 2004-07-27 03:28 msgbuffer.c
-rw-r--r-- 1 zuki users    3071 2004-07-27 03:28 msgbuffer.h
-rw-r--r-- 1 zuki users    4852 2004-07-27 03:28 nmead.h
-rw-r--r-- 1 zuki users 1180568 2008-02-25 22:36 nmead.h.gch
-rw-r--r-- 1 zuki users    7971 2004-07-27 03:28 simtalk.c
-rw-r--r-- 1 zuki users    3264 2004-07-27 03:28 talk.c
zuki @ LookBusy nmead-01.03.00] $ make
Makefile:53: *** invalid syntax in conditional.  Stop.
zuki @ LookBusy nmead-01.03.00] $ make -f Makefile
Makefile:53: *** invalid syntax in conditional.  Stop.
Did check google+manual though, I guess I've missed something..
 
Old 02-29-2008, 09:00 AM   #8
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,781

Rep: Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081
Well changing line 53 from
Code:
 ifndef $(RM)
to
Code:
 ifndef RM
should work. It's possible that on the author's system the RM variable is set to something that makes the original statement work.
 
  


Reply



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
[Compile kernel] How to compile/install the modules ? frenchn00b Linux - General 1 09-06-2009 03:18 PM
Compile madwifi, ... compile error , how can i do. ERBRMN Linux - Networking 3 03-08-2006 07:56 PM
compile .c p4inkill4 Linux - Newbie 4 10-28-2005 03:26 PM
compile 2.6.13 jupiter3437 Linux - Software 3 09-09-2005 04:09 PM
ntop compile/post-compile problem? tjb Linux - Software 3 12-28-2004 04:22 PM

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

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