# Link error: magic\_open

**URL:** <https://community.zeek.org/t/link-error-magic-open/3330>\
**Category:** Zeek\
**Created:** [October 27, 2014, 3:22pm UTC](https://community.zeek.org/t/link-error-magic-open/3330 "2014-10-27T15:22:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_Donnelly](https://avatars.discourse-cdn.com/v4/letter/j/3ec8ea/32.png) [@John\_Donnelly](https://community.zeek.org/u/John_Donnelly)\
**Post date:** [October 27, 2014, 3:22pm UTC](https://community.zeek.org/t/link-error-magic-open/3330/1 "2014-10-27T15:22:50Z")

</div>

Hi,

Do I need another package other than libmagic-dev ?

Linking CXX executable bro  
CMakeFiles/bro.dir/util.cc.o: In function `bro_init_magic(magic_set**, int)': /work/jpd/dyn/src/dynect2/edge_processing/bro/src/util.cc:1705: undefined reference to `magic\_open’  
/work/jpd/dyn/src/dynect2/edge\_processing/bro/src/util.cc:1712: undefined reference to `magic_error' /work/jpd/dyn/src/dynect2/edge_processing/bro/src/util.cc:1717: undefined reference to `magic\_load’  
/work/jpd/dyn/src/dynect2/edge\_processing/bro/src/util.cc:1719: undefined reference to `magic_error' /work/jpd/dyn/src/dynect2/edge_processing/bro/src/util.cc:1722: undefined reference to `magic\_close’  
CMakeFiles/bro.dir/util.cc.o: In function `bro_magic_buffer(magic_set*, void const*, unsigned long)': /work/jpd/dyn/src/dynect2/edge_processing/bro/src/util.cc:1729: undefined reference to `magic\_buffer’  
/work/jpd/dyn/src/dynect2/edge\_processing/bro/src/util.cc:1732: undefined reference to `magic\_error’

---

<div class="post-metadata">

**Author:** ![Seth\_Hall3](https://avatars.discourse-cdn.com/v4/letter/s/d6d6ee/32.png) [@Seth\_Hall3](https://community.zeek.org/u/Seth_Hall3)\
**Post date:** [October 27, 2014, 4:15pm UTC](https://community.zeek.org/t/link-error-magic-open/3330/2 "2014-10-27T16:15:35Z")

</div>

What version of Bro is this you're building? As of 2.3 we don't use libmagic anymore.

&nbsp;&nbsp;.Seth

---

<div class="post-metadata">

**Author:** ![John\_Donnelly](https://avatars.discourse-cdn.com/v4/letter/j/3ec8ea/32.png) [@John\_Donnelly](https://community.zeek.org/u/John_Donnelly)\
**Post date:** [October 27, 2014, 6:03pm UTC](https://community.zeek.org/t/link-error-magic-open/3330/3 "2014-10-27T18:03:57Z")

</div>

I see where the libmagic version 5.16 was manually added to the build:

[https://github.com/bro/bro/commit/c48c5316299898d05533ee9f5b0273b575391a1f](https://github.com/bro/bro/commit/c48c5316299898d05533ee9f5b0273b575391a1f)

Then at a later point this was removed.

Ubuntu 14.04 currently uses: libmagic-dev:amd64 1:5.14-2ubuntu3.2

Any insight appreciated .

---

<div class="post-metadata">

**Author:** ![John\_Donnelly](https://avatars.discourse-cdn.com/v4/letter/j/3ec8ea/32.png) [@John\_Donnelly](https://community.zeek.org/u/John_Donnelly)\
**Post date:** [October 27, 2014, 6:56pm UTC](https://community.zeek.org/t/link-error-magic-open/3330/4 "2014-10-27T18:56:37Z")

</div>

I see libmagic was pulled out and new plug module was added:

[https://github.com/bro/bro/commit/bbd409d274fa36fe66f0ac3a6d43bc56d2e0d67f](https://github.com/bro/bro/commit/bbd409d274fa36fe66f0ac3a6d43bc56d2e0d67f)

---

<div class="post-metadata">

**Author:** ![Siwek\_Jon](https://avatars.discourse-cdn.com/v4/letter/s/90db22/32.png) [@Siwek\_Jon](https://community.zeek.org/u/Siwek_Jon)\
**Post date:** [October 27, 2014, 9:38pm UTC](https://community.zeek.org/t/link-error-magic-open/3330/5 "2014-10-27T21:38:43Z")

</div>

> I see where the libmagic version 5.16 was manually added to the build:
> 
> [Integrate libmagic 5.16 via CMake ExternalProject. · bro/bro@c48c531 · GitHub](https://github.com/bro/bro/commit/c48c5316299898d05533ee9f5b0273b575391a1f)
> 
> Then at a later point this was removed.

Yes, IIRC, this method of integrating libmagic never made it in to a release version of Bro, so it’s probably not something you need to worry about.

> Ubuntu 14.04 currently uses: libmagic-dev:amd64 1:5.14-2ubuntu3.2

If you are using a version of Bro older than 2.3, that libmagic-dev should work fine — at least I don’t have a problem with it when compiling Bro 2.2.

As mentioned, Bro 2.3 and later won’t require libmagic, so if you can use that instead, it would sidestep whatever your issue is. Else, we’ll need more details: best if you can give step-by-step instructions to reproduce your problem, including which Bro version and any non-default configuration flags used.

- Jon

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/zeek/original/1X/f09d732bc2cc7c7cc7e35db67cf4e1d5233ce7a7.png) [@system](https://community.zeek.org/u/system)\
**Post date:** [May 6, 2022, 3:42pm UTC](https://community.zeek.org/t/link-error-magic-open/3330/6 "2022-05-06T15:42:11Z")

</div>


