Welcome to the most active Linux Forum on the web.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 01-27-2005, 04:40 PM   #1
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
 while ((opt = getopt_long (argc, argv, options, long_options, NULL)) != -1)
      switch (opt)
      case 'h':
        print_help ();
        exit (0);
      case 'D':
        jack_set_server_dir (optarg);
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
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?


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 > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:04 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration