title: ld returned 1 exit status - c file structure
body: <p>I am editing an open source C project to customize it for my usage. Basically it has the following file structure:</p>
  <pre><code>                  |--- /include ----- loremipsum.h
                    |
  /loremipsum ----- |--- /ex      ----- loremipsum.c and more
                    |
                    |--- /src     ----- other helpful functions
  </code></pre>
  <p>In loremipsum.h one can find a list of functions that are defined in /src, via</p>
  <pre><code>#ifdef __cplusplus
  extern &quot;C&quot; {
  #endif
  </code></pre>
  <p>but this has not been edited by me, so i suppose it should work.</p>
  <p>In loremipsum.c there are:</p>
  <ul>
  <li>#include &quot;loremipsum.h&quot;</li>
  <li>plenty of <code>extern void function_defined_in_ex()</code>(<em>1</em>)</li>
  <li>some more definitions.</li>
  <li>main</li>
  </ul>
  <p>After editing the c-files and trying to recreate a new exefile via</p>
  <pre><code>$ gcc  loremipsum.c -o customloremipsum.exe
  </code></pre>
  <p>first I got an error, that loremipsum.h was not found, so I changed the include to &quot;path/to/include/loremipsum.h&quot;, I did that in all .c files with that include.</p>
  <p>Then, all of the (<em>1</em>) had an error, namely
  &quot;/usr/lib/gcc/x86_64-pc-cygwin/9.3.0/../../../../x86_64-pc-cygwin/bin/ld: /tmp/ccBt2CkE.o:loremipsum.c:(.text+0x3745): undefined reference to function_defined_in_ex'
  ld returned 1 exit status&quot;.
  I really can't figure out, why.</p>
  <p>I think the first include error is already strange, in my understanding, there should be no problem to find the .h file. Also, I can't figure out, how to make clear where to find the functions in (<em>1</em>).</p>
  <p>I'm very sorry for that long post, I'm just afraid, I'm forgetting something fundamental.</p>
  <p>I am working on Windows 10 and compiling in a Cygwin shell.
  Thank you for your help.</p>