# Build error curl/libssh2

**URL:** <https://discourse.slicer.org/t/build-error-curl-libssh2/12809>\
**Category:** Development\
**Created:** [July 31, 2020, 5:20pm UTC](https://discourse.slicer.org/t/build-error-curl-libssh2/12809 "2020-07-31T17:20:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![gcsharp](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/gcsharp/32/863_2.png) [@gcsharp](https://discourse.slicer.org/u/gcsharp)\
**Post date:** [July 31, 2020, 5:20pm UTC](https://discourse.slicer.org/t/build-error-curl-libssh2/12809/1 "2020-07-31T17:20:11Z")

</div>

Hi, I am getting the following build error:

```
[23%] Linking CXX shared library ../../bin/libRemoteIO.so
/usr/bin/ld: /PHShome/gcs6/build/slicer-4/Slicer-build/curl-install/lib/libcurl.a(libssh2.c.o): in function `ssh_statemach_act':
libssh2.c:(.text+0x322): undefined reference to `libssh2_session_handshake'
/usr/bin/ld: libssh2.c:(.text+0x363): undefined reference to `libssh2_hostkey_hash'
/usr/bin/ld: libssh2.c:(.text+0x40b): undefined reference to `libssh2_session_hostkey'
<and many more>

```

Missing symbols are defined in /usr/lib/x86\_64-linux-gnu/libssh2.so, but libssh2 is not specified in the link command for building target libRemoteIO. Any idea how to fix?

---

<div class="post-metadata">

**Author:** ![hherhold](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/hherhold/32/12199_2.png) [@hherhold](https://discourse.slicer.org/u/hherhold)\
**Post date:** [July 31, 2020, 6:14pm UTC](https://discourse.slicer.org/t/build-error-curl-libssh2/12809/2 "2020-07-31T18:14:25Z")

</div>

This was mentioned in [Build fails in VTK : many undefined references](https://discourse.slicer.org/t/build-fails-in-vtk-many-undefined-references/12150). You can see my fix at the bottom, as discussed in the thread, I’m not sure it’s the _correct_ fix.

@jcfr - any update/opinions on this?

Thanks!!

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [July 31, 2020, 6:33pm UTC](https://discourse.slicer.org/t/build-error-curl-libssh2/12809/3 "2020-07-31T18:33:58Z")

</div>

@RafaelPalomar does your [new linux build instructions page](https://github.com/Slicer/Slicer/pull/5050) include description of this solution/workaround? It would be great if you could add it and finalize the page soon (we can always improve it as needed). Thank you!

---

<div class="post-metadata">

**Author:** ![hherhold](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/hherhold/32/12199_2.png) [@hherhold](https://discourse.slicer.org/u/hherhold)\
**Post date:** [July 31, 2020, 6:47pm UTC](https://discourse.slicer.org/t/build-error-curl-libssh2/12809/4 "2020-07-31T18:47:42Z")

</div>

Is the addition of ssh2 as a library a reasonable fix? or just a workaround?

I’m happy to submit a pull request if it’s an actual fix.

---

<div class="post-metadata">

**Author:** ![gcsharp](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/gcsharp/32/863_2.png) [@gcsharp](https://discourse.slicer.org/u/gcsharp)\
**Post date:** [July 31, 2020, 8:27pm UTC](https://discourse.slicer.org/t/build-error-curl-libssh2/12809/5 "2020-07-31T20:27:02Z")

</div>

Thanks HH. This works great! (Slicer crashes, but it does compile.)
