<p>This was answered on <a href="https://gnusha.org/secp256k1/2022-09-25.log" rel="nofollow noreferrer">IRC</a>.</p>
<p>The error was resolved by compiling the <code>secp256k1.c</code> file, the <code>precomputed_ecmult.c</code> file and the <code>precomputed_ecmult_gen.c</code> file into object files and linking against that. You used to only need to compile the single file <code>secp256k1.c</code> into an object file.</p>
<p>Alternatively if that doesn't resolve your problem you could try <code>make clean</code> and <code>git clean -dfx</code>. Otherwise the bindings you are linking to MicroPython may need to be updated.</p>

CC BY-SA 4.0
2022-11-17T15:31:01.223Z
2022-11-17T15:31:01.223Z
Michael Folkson
<p>I have upgraded libsecp256k1 to the latest master but I'm having issues to link it properly now. What is the problem and how might I resolve it?</p>
<p>The error message is:</p>
<pre><code>collect2: error: ld returned 1 exit status
secp256k1/src/ecmult_impl.h:324: undefined reference to `secp256k1_pre_g'
</code></pre>
<p>I'm able to build libsecp256k1 as a standalone, this error happens when I try to link it to MicroPython.</p>
<p>This was asked by Guest6320 on <a href="https://gnusha.org/secp256k1/2022-09-25.log" rel="nofollow noreferrer">IRC</a>.</p>

<python><compiling><secp256k1><error>
I have upgraded libsecp256k1 to latest master but I'm having issues to link it properly now. How can I resolve this?
Michael Folkson
# I have upgraded libsecp256k1 to latest master but I'm having issues to link it properly now. How can I resolve this?

(Asked by: username_0 on 2022-11-17)

I have upgraded libsecp256k1 to the latest master but I'm having issues to link it properly now. What is the problem and how might I resolve it?

The error message is:

```
collect2: error: ld returned 1 exit status
secp256k1/src/ecmult_impl.h:324: undefined reference to `secp256k1_pre_g'

```

I'm able to build libsecp256k1 as a standalone, this error happens when I try to link it to MicroPython.

This was asked by Guest6320 on [IRC](https://gnusha.org/secp256k1/2022-09-25.log).

**Tags:** python, compiling, secp256k1, error


---

## 1 answers

### Answer by username_0 on 2022-11-17. Score: 0 | Accepted answer

This was answered on [IRC](https://gnusha.org/secp256k1/2022-09-25.log).

The error was resolved by compiling the `secp256k1.c` file, the `precomputed_ecmult.c` file and the `precomputed_ecmult_gen.c` file into object files and linking against that. You used to only need to compile the single file `secp256k1.c` into an object file.

Alternatively if that doesn't resolve your problem you could try `make clean` and `git clean -dfx`. Otherwise the bindings you are linking to MicroPython may need to be updated.


---

