# Something wrong with compiling Asterisk.



## krasi_d (Dec 28, 2010)

Hi guys!

I have a problem with compilation on my FreeBSD 8.1-RELEASE-p2. I allready wrote message to Asterisk, but still I don't have answear. If someone have some idea, please write here.
I find something in google but everything is the same.
The compiling stops with this message:


```
astobj2.o(.text+0x759): In function `internal_ao2_ref':
/usr/ports/asterisk-1.8.0/include/asterisk/lock.h:589: undefined reference to `__sync_fetch_and_add_4'
astobj2.o(.text+0xb36): In function `internal_ao2_iterator_next':
/usr/ports/asterisk-1.8.0/include/asterisk/lock.h:589: undefined reference to `__sync_fetch_and_add_4'
astobj2.o(.text+0xb8a):/usr/ports/asterisk-1.8.0/include/asterisk/lock.h:589: undefined reference to `__sync_fetch_and_add_4'
astobj2.o(.text+0xd3d): In function `internal_ao2_link':
/usr/ports/asterisk-1.8.0/include/asterisk/lock.h:589: undefined reference to `__sync_fetch_and_add_4'
astobj2.o(.text+0xd63):/usr/ports/asterisk-1.8.0/include/asterisk/lock.h:589: undefined reference to `__sync_fetch_and_add_4'
astobj2.o(.text+0x172c):/usr/ports/asterisk-1.8.0/include/asterisk/lock.h:589: more undefined references to `__sync_fetch_and_add_4' follow
utils.o(.text+0x1310): In function `ast_atomic_dec_and_test':
/usr/ports/asterisk-1.8.0/include/asterisk/lock.h:635: undefined reference to `__sync_sub_and_fetch_4'
utils.o(.text+0x1329): In function `ast_atomic_fetchadd_int':
/usr/ports/asterisk-1.8.0/include/asterisk/lock.h:589: undefined reference to `__sync_fetch_and_add_4'
gmake[1]: *** [asterisk] Error 1
gmake: *** [main] Error 2
*** Error code 2

Stop in /usr/ports/asterisk-1.8.0.
```

Thanks to everyone who give me some advice.


----------



## krasi_d (Dec 29, 2010)

The problem is resolved,when I download version asterisk-1.8.2-rc1.


----------



## SirDice (Dec 29, 2010)

Something tells me you're not using the ports system.

net/asterisk

Handbook: Chapter 4 Installing Applications: Packages and Ports


----------



## krasi_d (Dec 29, 2010)

SirDice said:
			
		

> Something tells me you're not using the ports system.
> 
> net/asterisk
> 
> Handbook: Chapter 4 Installing Applications: Packages and Ports



That's right. I'm scary how you said.


----------



## DutchDaemon (Dec 29, 2010)

You'll be even more scared when you need to deinstall or upgrade installed software outside of the ports system.


----------



## krasi_d (Dec 30, 2010)

DutchDaemon said:
			
		

> You'll be even more scared when you need to deinstall or upgrade installed software outside of the ports system.



I had problems with installation from ports system. 
OK! I'll take your words and put in my thinks.


----------

