title: libcheck test fails to link
body: <p>I'm trying to build a simple example using <a href="https://github.com/libcheck/check" rel="nofollow">libcheck</a> but it fails to build while using the flags reported by pkg-config.</p>
  
  <p>My file: tests/test.c</p>
  
  <pre><code>#include &lt;stdlib.h&gt;
  #include &lt;check.h&gt;
  
  START_TEST(zero)
  {
          int z = 0;
          ck_assert_int_eq(0, z);
  }
  END_TEST
  
  Suite* suite_zero(void)
  {
      Suite* s;
      TCase* tc;
      s = suite_create("suite_zero");
      tc = tcase_create("zero");
      tcase_add_test(tc, zero);
  
      suite_add_tcase(s, tc);
      return s;
  }
  
  int main(void)
  {
      int number_failed;
      SRunner* sr;
  
      Suite* s_zero = suite_zero();
  
      sr = srunner_create(s_zero);
  
      srunner_run_all(sr, CK_NORMAL);
      number_failed = srunner_ntests_failed(sr);
      srunner_free(sr);
      return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
  }
  </code></pre>
  
  <p>My system:</p>
  
  <pre><code>$ cat /etc/lsb-release 
  DISTRIB_ID=Ubuntu
  DISTRIB_RELEASE=16.04
  DISTRIB_CODENAME=xenial
  DISTRIB_DESCRIPTION="Ubuntu 16.04 LTS"
  $ gcc --version
  gcc (Ubuntu 5.4.0-6ubuntu1~16.04.2) 5.4.0 20160609
  
  $ pkg-config --version
  0.29.1
  </code></pre>
  
  <p>When I try to build my test using the flags and libs reported by pkg-config:</p>
  
  <pre><code>$ pkg-config --cflags --libs check
  -pthread -lcheck_pic -pthread -lrt -lm -lsubunit
  $ gcc -pthread -lcheck_pic -pthread -lrt -lm -lsubunit  -g tests/test.c -o tests/zero
  /tmp/ccRV2kLw.o: In function `zero':
  Code/tests/test.c:4: undefined reference to `tcase_fn_start'
  /Code/tests/test.c:7: undefined reference to `_mark_point'
  /Code/tests/test.c:7: undefined reference to `_ck_assert_failed'
  /tmp/ccRV2kLw.o: In function `suite_zero':
  /Code/tests/test.c:15: undefined reference to `suite_create'
  /Code/tests/test.c:16: undefined reference to `tcase_create'
  /Code/tests/test.c:17: undefined reference to `_tcase_add_test'
  /Code/tests/test.c:19: undefined reference to `suite_add_tcase'
  /tmp/ccRV2kLw.o: In function `main':
  /Code/tests/test.c:30: undefined reference to `srunner_create'
  /Code/tests/test.c:32: undefined reference to `srunner_run_all'
  /Code/tests/test.c:33: undefined reference to `srunner_ntests_failed'
  /Code/tests/test.c:34: undefined reference to `srunner_free'
  collect2: error: ld returned 1 exit status
  </code></pre>
  
  <p>Libcheck was installed by apt and the library and headers are in the typical locations, /usr/lib and /usr/include respectively. Yet it appears it can't be found. I'm a bit stumped as why. Any ideas?</p>
  
  <p>Thanks.</p>