# Building Device Agent mender on Fedora

**URL:** <https://hub.mender.io/t/building-device-agent-mender-on-fedora/6330>\
**Category:** General Discussions\
**Tags:** mender-client\
**Created:** [November 10, 2023, 9:35am UTC](https://hub.mender.io/t/building-device-agent-mender-on-fedora/6330 "2023-11-10T09:35:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pei.cei](https://avatars.discourse-cdn.com/v4/letter/p/77aa72/32.png) [@pei.cei](https://hub.mender.io/u/pei.cei)\
**Post date:** [November 10, 2023, 9:35am UTC](https://hub.mender.io/t/building-device-agent-mender-on-fedora/6330/1 "2023-11-10T09:35:14Z")

</div>

Hi,

I am trying to build mender device agent on a Fedora or Alamlinux container… I have installed libzma and openssl-1.1.1k … but getting the bellow error, the libraries libpthread.so libdl.so and libc.so are present at /usr/lib64 directory. I did export LD\_LIBRARY\_PATH. I’m still getting the error.  
Appreciate your input.

-pei

/usr/lib/golang/pkg/tool/linux\_amd64/link: running gcc failed: exit status 1  
/usr/bin/ld: cannot find -lpthread  
/usr/bin/ld: cannot find -ldl  
/usr/bin/ld: cannot find -ldl  
/usr/bin/ld: cannot find -lc  
collect2: error: ld returned 1 exit status

---

<div class="post-metadata">

**Author:** ![TheYoctoJester](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/theyoctojester/32/1444_2.png) [@TheYoctoJester](https://hub.mender.io/u/TheYoctoJester)\
**Post date:** [November 10, 2023, 11:14am UTC](https://hub.mender.io/t/building-device-agent-mender-on-fedora/6330/2 "2023-11-10T11:14:18Z")

</div>

Hi @pei.cei,

the `LD_LIBRARY_PATH` does not affect the linking stage of a build process. The right place to start should be the `-ldflags` parameter, which can be passed to `go build`. [This stackoverflow post](https://stackoverflow.com/questions/74522713/what-are-possible-go-build-ldflags-options) might give you some ideas on how to proceed.

Greetz,  
Josef
