# Problem Building PushPoold



## tuaris (Oct 10, 2012)

I am running into a problem with argp.h:


```
server.o: In function `parse_opt':
/root/pushpoold/work/jgarzik-pushpool-4d959b8/server.c:142: undefined reference to `argp_usage'
/root/pushpoold/work/jgarzik-pushpool-4d959b8/server.c:125: undefined reference to `argp_usage'
server.o: In function `main':
/root/pushpoold/work/jgarzik-pushpool-4d959b8/server.c:1206: undefined reference to `argp_parse'
*** Error code 1
```

I've installed devel/argp-standalone from ports so that the argp.h file is included.

I'm not sure what the error message means.  I looked in argp.h and I see that the functions are defined.  Do I need to do something else?


----------



## SirDice (Oct 10, 2012)

You probably have to add /usr/local/lib/ and /usr/local/include/ to the compiler/linker, they are not searched by default.


----------



## tuaris (Oct 10, 2012)

This is a port I am trying to create (my first one), I have the following in my Makefile:


```
CONFIGURE_ENV= \
		CFLAGS="-O2 -Wall -g -I${LOCALBASE}/include" \
		LDFLAGS="-L${LOCALBASE}/lib"

CXXFLAGS+=	-I${LOCALBASE}/include
CXXFLAGS+=	-L${LOCALBASE}/lib
```


----------



## tuaris (Oct 10, 2012)

I changed the above to:


```
CFLAGS+=	-I${LOCALBASE}/include
LDFLAGS+=	-L${LOCALBASE}/lib
```

Still the same issue.


----------



## tuaris (Oct 11, 2012)

Fixed it by looking at another port that used the same header file (emulators/hugo).

I added "-largp" to Makefile.am


```
pushpoold_LDADD	= @LIBCURL@ @EVENT_LIBS@ @PTHREAD_LIBS@ @JANSSON_LIBS@ \
 		  @CRYPTO_LIBS@ @Z_LIBS@ @LIBMEMCACHED_LIBS@ \
-		  @SQLITE3_LDFLAGS@ @MYSQL_LDFLAGS@ @POSTGRESQL_LDFLAGS@
+		  @SQLITE3_LDFLAGS@ @MYSQL_LDFLAGS@ @POSTGRESQL_LDFLAGS@ -largp
```

It builds.


----------

