LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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-27-2005, 04:40 PM   #1
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 53
gcc 3.4.1 and c implicit declaration


this must be simple but i can't figure it out

main has
#include <jack/jack.h>
then later
Code:
 while ((opt = getopt_long (argc, argv, options, long_options, NULL)) != -1)
    {
      switch (opt)
      {
      case 'h':
        print_help ();
        exit (0);
        break;
      case 'D':
        jack_set_server_dir (optarg);
        break;
jack/jack.h has
void jack_set_server_dir (const char *path);

the object compiles with the warning
main.c:112: warning: implicit declaration of function `jack_set_server_dir'

the the link fails with
ladccad-main.o(.text+0x20d): In function `main':
: undefined reference to `jack_set_server_dir'
collect2: ld returned 1 exit status
make[2]: *** [ladccad] Error 1

how do i fix ?
 
Old 01-27-2005, 04:49 PM   #2
deiussum
Member
 
Registered: Aug 2003
Location: Santa Clara, CA
Distribution: Slackware
Posts: 895

Rep: Reputation: 32
Not familiar with those functions, but I'd check to see if the declaration of jack_set_server_dir is within any sort of #ifdefs in jack/jack.h...

Also, when you are compiling do you link the appropriate libraries?
 
  


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
warning: implicit declaration of function liguorir Linux - Software 5 10-22-2012 03:20 PM
Implicit declaration means alaios Programming 7 03-09-2009 06:20 AM
warning: incompatible implicit declaration of built-in function ‘exit’ xzotech Programming 1 08-14-2005 05:43 AM
implicit declaration of function 'getdelim' MicahCarrick Programming 2 05-02-2005 11:03 AM
Implicit typename warning (gcc 3.3.4) ta0kira Programming 1 10-12-2004 03:45 AM

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

All times are GMT -5. The time now is 02:15 PM.

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