How to just print the output for -H without output anything else?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I just want to print the header information. Is there a way to
suppress the errors generated (Undefined symbols ...)? Thanks.

$ gcc -H -Iincdir main.c
. ./main.h
.. ./print.h
. incdir/print1.h
Undefined symbols for architecture x86_64:
  "_print", referenced from:
      _main in main-9c47c5.o
  "_print1", referenced from:
      _main in main-9c47c5.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)


==> main.c <==
// vim: set noexpandtab tabstop=2:

#include "main.h"
#include <print1.h>

int main() {
  print();
  print1();
}

==> print.c <==
#include <stdio.h>

void print() {
  puts("Hello World!");
}

==> incdir/print1.c <==
#include <stdio.h>

void print1() {
  puts("Hello World1!");
}

==> incdir/print1.h <==
// vim: set noexpandtab tabstop=2:

void print1();


-- 
Regards,
Peng



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux