Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>More often than not, "undefined reference" means that your build is misconfigured. For example, an unintended line break in the <code>Android.mk</code> file could cause the <strong>make</strong> tool choose a wrong link command for your project.</p> <p>Usually the error message includes the name of the missing function or global variable, and the module (file) which was looking for this reference. If the name is not self-explanatory, you can often find this name called in your source code, and then track it back to one of the external libraries you use, because it is likely to be <strong>declared</strong> in some header (<strong>.h</strong> or <strong>.hpp</strong>) files included in your source.</p> <p>It is not likely that you unintentionally use some external library which you have to download, because usually such mistakes manifest themselves earlier, when the compiler cannot find the necessary include (header) files.</p> <p>One particular case for Android native projects to display "undefined reference" errors is when the project uses non-official Android APIs, e.g. OpenMax/stagefreight. In such cases, the header files are found in the Android source tree, but compiled libraries needed for the link phase are not there. The usual workaround is to pull the binaries from your development device, e.g. </p> <pre><code>adb pull /system/lib/libstagefreight.so . </code></pre> <p>Anyways, it often helps to run <code>ndk-build</code> with <strong>V=1</strong> to see exactly what build commands are executed.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload