LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   gcc 3.4.1 and c implicit declaration (https://www.linuxquestions.org/questions/programming-9/gcc-3-4-1-and-c-implicit-declaration-283022/)

foo_bar_foo 01-27-2005 04:40 PM

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 ?

deiussum 01-27-2005 04:49 PM

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?


All times are GMT -5. The time now is 06:16 PM.