# How can i compile nginx with specific lib linkage

**URL:** <https://www.ruby-forum.com/t/how-can-i-compile-nginx-with-specific-lib-linkage/238697>\
**Category:** NGINX\
**Created:** [January 24, 2014, 5:36am UTC](https://www.ruby-forum.com/t/how-can-i-compile-nginx-with-specific-lib-linkage/238697 "2014-01-24T05:36:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![musicdenotation](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea666f/32.png) [@musicdenotation](https://www.ruby-forum.com/u/musicdenotation)\
**Post date:** [January 24, 2014, 5:36am UTC](https://www.ruby-forum.com/t/how-can-i-compile-nginx-with-specific-lib-linkage/238697/1 "2014-01-24T05:36:23Z")

</div>

I have customized a new nginx add on module,and the module use an  
external  
lib ( mytest.so).  
The method i called in mytest.so is kimtest method.  
How can i configure the ./configure file and Makefile to prevent the  
error "  
undefined reference to `kimtest’ "

Here is the configure file…

auto/configure --with-debug --with-ld-opt=“-L/usr/local/lib64”  
–add-module=./src/my\_nginx\_module

while configuring … everything seems ok, no error occurs.  
but while making … " undefined reference to `kimtest’ "

Posted at Nginx Forum:

> **[How can i compile nginx with specific lib linkage](https://forum.nginx.org/read.php?2,246770,246770#msg-246770)**
>
> I have customized a new nginx add on module,and the module use an external lib ( mytest.so). The method i called in mytest.so is kimtest method. How can i configure the ./configure file and Makefile to prevent the error " undefined reference to...

---

<div class="post-metadata">

**Author:** ![humank](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/c4cdca/32.png) [@humank](https://www.ruby-forum.com/u/humank)\
**Post date:** [January 24, 2014, 4:49pm UTC](https://www.ruby-forum.com/t/how-can-i-compile-nginx-with-specific-lib-linkage/238697/2 "2014-01-24T16:49:40Z")

</div>

Hello!

On Thu, Jan 23, 2014 at 11:35:44PM -0500, humank wrote:

> while configuring … everything seems ok, no error occurs.  
> but while making … " undefined reference to `kimtest’ "

Something like

CORE\_LIBS=“$CORE\_LIBS -lmytest”

in your module config file should do the trick.

–  
Maxim D.  
[http://nginx.org/](http://nginx.org/)

---

<div class="post-metadata">

**Author:** ![humank](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/c4cdca/32.png) [@humank](https://www.ruby-forum.com/u/humank)\
**Post date:** [January 27, 2014, 11:59am UTC](https://www.ruby-forum.com/t/how-can-i-compile-nginx-with-specific-lib-linkage/238697/3 "2014-01-27T11:59:49Z")

</div>

## Maxim D. Wrote:

> > undefined reference to `kimtest’ "
> 
> removed\_email\_address@domain.invalid  
> [nginx Info Page](http://mailman.nginx.org/mailman/listinfo/nginx)

Hi Maxim D.,

```
i solved the problem as you provided solution.
But i face another problem, that is while starting the nginx server,

```

still lack of the library at runtime.  
I should set the LIBRARY\_PATH in order to start the nginx correctly.  
(  
export LD\_LIBRARY\_PATH)  
Is there any suggestion or setting to set the install config ?

BRs,  
Kim

Posted at Nginx Forum:

> **[Re: How can i compile nginx with specific lib linkage](https://forum.nginx.org/read.php?2,246770,246858#msg-246858)**
>
> I have customized a new nginx add on module,and the module use an external lib ( mytest.so). The method i called in mytest.so is kimtest method. How can i configure the ./configure file and Makefile to prevent the error " undefined reference to...
