public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* How to just print the output for -H without output anything else?
@ 2019-01-04  2:21 Peng Yu
  2019-01-04  2:41 ` Xi Ruoyao
  0 siblings, 1 reply; 10+ messages in thread
From: Peng Yu @ 2019-01-04  2:21 UTC (permalink / raw)
  To: gcc-help

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-01-04 16:46 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-04  2:21 How to just print the output for -H without output anything else? Peng Yu
2019-01-04  2:41 ` Xi Ruoyao
2019-01-04  3:19   ` Peng Yu
2019-01-04  6:42     ` Xi Ruoyao
2019-01-04  8:42       ` Alexander Monakov
2019-01-04 15:26       ` Peng Yu
2019-01-04 15:28         ` Jonathan Wakely
2019-01-04 15:32           ` Peng Yu
2019-01-04 15:33             ` Jonathan Wakely
2019-01-04 16:46               ` Peng Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).