<p>The root cause of the error is likely related to the Qt <strong>Resource Compiler</strong> (rcc), which is generally called earlier as part of the bitcoin compilation process. The rcc generates the <code>src/qt/qrc_bitcoin.cpp</code> file from the <code>src/qt/bitcoin.qrc</code> resource file.</p>
<p>Unfortunately, the compilation process is not halted, if the rcc encounters an error when operating on the resource file. Instead an empty <code>src/qt/qrc_bitcoin.cpp</code> file is created. <code>qInitResources_bitcoin()</code> is never defined and hence will be missing during the linking process.</p>
<p>A common source of errors are missing assets in the qt makefile (ensure listed assets in <code>src/qt/bitcoin.qrc</code> are also included in <code>src/Makefile.qt.include</code>.</p>

CC BY-SA 4.0
2020-12-17T10:30:39.813Z
2020-12-17T10:30:39.813Z
Riku
<p>I have built the Bitcoin source code, created my own genesis block and everything was working great! Now that I have changed the word <code>bitcoin</code> to <code>GELF</code> in some places of the program to suit my own software's name, I am running into plenty of issues with undefined references. I cannot seem to work out why I am having this undefined particular undefined reference when I run <code>make</code>. Here is my error output:</p>

<pre><code>make
make[1]: Entering directory '/home/q/Desktop/GELF-master/src'
make[2]: Entering directory '/home/q/Desktop/GELF-master'
make[2]: Leaving directory '/home/q/Desktop/GELF-master'
  OBJCXXLD qt/GELF-qt
qt/qt_GELF_qt-bitcoin.o: In function `main':
/home/q/Desktop/GELF-master/src/qt/bitcoin.cpp:548: undefined reference to `qInitResources_bitcoin()'
collect2: error: ld returned 1 exit status
Makefile:3701: recipe for target 'qt/GELF-qt' failed
make[1]: *** [qt/GELF-qt] Error 1
make[1]: Leaving directory '/home/q/Desktop/GELF-master/src'
Makefile:9475: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1
</code></pre>

<p>I can't find anywhere in the code where this function is defined! Here is the line that is breaking:</p>

<p><code>Q_INIT_RESOURCE(bitcoin);</code></p>

<p>What does this function do? It isn't anywhere to be seen in the developer reference. How can I resolve this error?</p>

CC BY-SA 3.0
2018-01-03T15:27:35.037Z
I can't remember how I fixed this but it might have been that I forgot the QT dependencies
Barney Chambers
<bitcoin-core><bitcoind><development><bitcoin-core-development>
Bitcoin QT - why do I have an undefined reference to `qInitResources_bitcoin() error
Barney Chambers
# Bitcoin QT - why do I have an undefined reference to `qInitResources_bitcoin() error

(Asked by: username_0 on 2017-11-22)

I have built the Bitcoin source code, created my own genesis block and everything was working great! Now that I have changed the word `bitcoin` to `GELF` in some places of the program to suit my own software's name, I am running into plenty of issues with undefined references. I cannot seem to work out why I am having this undefined particular undefined reference when I run `make`. Here is my error output:

```
make
make[1]: Entering directory '/home/q/Desktop/GELF-master/src'
make[2]: Entering directory '/home/q/Desktop/GELF-master'
make[2]: Leaving directory '/home/q/Desktop/GELF-master'
  OBJCXXLD qt/GELF-qt
qt/qt_GELF_qt-bitcoin.o: In function `main':
/home/q/Desktop/GELF-master/src/qt/bitcoin.cpp:548: undefined reference to `qInitResources_bitcoin()'
collect2: error: ld returned 1 exit status
Makefile:3701: recipe for target 'qt/GELF-qt' failed
make[1]: *** [qt/GELF-qt] Error 1
make[1]: Leaving directory '/home/q/Desktop/GELF-master/src'
Makefile:9475: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

```

I can't find anywhere in the code where this function is defined! Here is the line that is breaking:

`Q_INIT_RESOURCE(bitcoin);`

What does this function do? It isn't anywhere to be seen in the developer reference. How can I resolve this error?

**Tags:** bitcoin-core, bitcoind, development, bitcoin-core-development

> **Comments:**
> **username_0**: I can't remember how I fixed this but it might have been that I forgot the QT dependencies  

---

## 1 answers

### Answer by username_1 on 2020-12-17. Score: 0

The root cause of the error is likely related to the Qt **Resource Compiler** (rcc), which is generally called earlier as part of the bitcoin compilation process. The rcc generates the `src/qt/qrc_bitcoin.cpp` file from the `src/qt/bitcoin.qrc` resource file.

Unfortunately, the compilation process is not halted, if the rcc encounters an error when operating on the resource file. Instead an empty `src/qt/qrc_bitcoin.cpp` file is created. `qInitResources_bitcoin()` is never defined and hence will be missing during the linking process.

A common source of errors are missing assets in the qt makefile (ensure listed assets in `src/qt/bitcoin.qrc` are also included in `src/Makefile.qt.include`.


---

