Watchman: Cannot Build

Created on 6 Aug 2017  路  16Comments  路  Source: facebook/watchman

watchman-ContentHash.o: In function watchman::ContentHashCache::computeHashImmediate(watchman::ContentHashCacheKey const&) const': /home/akhan/watchman/ContentHash.cpp:65: undefined reference toSHA1_Init'
/home/akhan/watchman/ContentHash.cpp:78: undefined reference to SHA1_Update' /home/akhan/watchman/ContentHash.cpp:81: undefined reference toSHA1_Final'
collect2: error: ld returned 1 exit status
Makefile:1566: recipe for target 'watchman' failed
make[1]: * [watchman] Error 1
make[1]: Leaving directory '/home/akhan/watchman'
Makefile:1101: recipe for target 'all' failed
make: *
[all] Error 2

Most helpful comment

After installing libssl-dev I did ./autogen.shand ./configure again.make is now working without error.

All 16 comments

You need libcrypto; this is typically installed as part of the openssl development package for your system. Different linux distributions call this different things, so it's hard to suggest what to install without knowing which distribution you are running. Redhat systems call this something like openssl-devel and debian/ubuntu systems are something like libssl-dev but it may be in a separate package.

I'm on Ubuntu 16.04 x64 and am unable to build Watchman.

I've installed libssl-dev and libcrypto++-dev as per other suggestions and I'm getting an error identical to @khansamad47 above, with references to SHA1_Init, SHA1_Update, and SHA1_Final. Not sure what I'm missing...

me too

Same problem on Ubuntu 17.04 (Zesty Zapus)

Same problem (Ubuntu 17.04)
I've installed libssl-dev, too.
In the 4.7.0 version there was not this problem.

UPDATE
I installed libcrypto++-dev and it works.
I cloned the repository in /opt so I ran all commands as super user.

I am also using Ubuntu 16.04 x64 and when try to run $ make on my terminal
I get the errors as

watchman-ContentHash.o: In function `watchman::ContentHashCache::computeHashImmediate(watchman::ContentHashCacheKey const&) const':
/home/anshulmittal/watchman/ContentHash.cpp:65: undefined reference to `SHA1_Init'
/home/anshulmittal/watchman/ContentHash.cpp:78: undefined reference to `SHA1_Update'
/home/anshulmittal/watchman/ContentHash.cpp:81: undefined reference to `SHA1_Final'
collect2: error: ld returned 1 exit status
Makefile:1566: recipe for target 'watchman' failed
make[1]: *** [watchman] Error 1
make[1]: Leaving directory '/home/anshulmittal/watchman'
Makefile:1101: recipe for target 'all' failed
make: *** [all] Error 2

Please help

After installing libssl-dev I did ./autogen.shand ./configure again.make is now working without error.

@excalliburbd Thank You

@excalliburbd Thank you

On Debian Jessie I needed to do all of the following

sudo apt-get install inotify-tools build-essential libssl-dev libcrypto++-dev pkg-config libtool python-dev automake autoconf
cd /tmp
git clone https://github.com/facebook/watchman.git
cd watchman
git checkout v4.9.0  # or whatever is now the latest stable release
./autogen.sh
./configure --enable-statedir=/tmp
sudo make
sudo make install
sudo mv watchman /usr/local/bin/watchman

On Fedora

Using it
sudo yum install libstdc++*

Following @samrose 's answer worked for me on Ubuntu 16.04 (xenial) (though I did not do the sudo mv watchman /usr/local/bin/watchman step) (see https://github.com/facebook/watchman/issues/514#issuecomment-363477072).

To install Watchman on Ubuntu 18.04 (Budgie) I did:

$ git clone https://github.com/facebook/watchman.git
$ cd watchman
$ git checkout v4.9.0
$ sudo apt-get install -y autoconf automake build-essential python-dev libtool m4 pkg-config libssl-dev libcrypto++-dev
$ ./autogen.sh
$ ./configure
$ make
$ sudo make install
$ echo 999999 | sudo tee -a /proc/sys/fs/inotify/max_user_watches && \
echo 999999 | sudo tee -a  /proc/sys/fs/inotify/max_queued_events && \
echo 999999 | sudo tee  -a /proc/sys/fs/inotify/max_user_instances && \
watchman shutdown-server

I am also using Ubuntu 16.04 x64 and when try to run $ make on my terminal
I get the errors as

watchman-ContentHash.o: In function `watchman::ContentHashCache::computeHashImmediate(watchman::ContentHashCacheKey const&) const':
/home/anshulmittal/watchman/ContentHash.cpp:65: undefined reference to `SHA1_Init'
/home/anshulmittal/watchman/ContentHash.cpp:78: undefined reference to `SHA1_Update'
/home/anshulmittal/watchman/ContentHash.cpp:81: undefined reference to `SHA1_Final'
collect2: error: ld returned 1 exit status
Makefile:1566: recipe for target 'watchman' failed
make[1]: *** [watchman] Error 1
make[1]: Leaving directory '/home/anshulmittal/watchman'
Makefile:1101: recipe for target 'all' failed
make: *** [all] Error 2

Please help

OMG are you the dude who made the pewdiepie vs t series counter?

@Jonyleo I am sorry, Didn't get you. Is there something I missed??

After installing libssl-dev I did ./autogen.shand ./configure again.make is now working without error.

Super.. Thanks a lot.

Was this page helpful?
0 / 5 - 0 ratings