folly undefined reference to `folly::init(int*, char***, bool)'

411 views
Skip to first unread message

张义飞

unread,
Aug 30, 2016, 5:43:46 AM8/30/16
to Folly: the Facebook Open-source LibrarY
Hi,After I in install the folly,I compile test/common/TestMain.cpp file ,but above follow error 

[root@localhost common]# pwd
/root/folly/folly/test/common
[root@localhost common]# g++ -std=c++11 TestMain.cpp -lgtest -lfolly
/tmp/ccje8Tp8.o: In function `main':
TestMain.cpp:(.text+0x36): undefined reference to `folly::init(int*, char***, bool)'
collect2: error: ld returned 1 exit status

[root@localhost common]# ldconfig -v|grep folly

        libfollybenchmark.so.57 -> libfollybenchmark.so.57.0.0
        libfolly.so.57 -> libfolly.so.57.0.0


My linux version is centos7.1

Wu Cong

unread,
Sep 8, 2016, 2:58:36 AM9/8/16
to Folly: the Facebook Open-source LibrarY
Clearly your linker cannot locate the libfolly to link. I see you specified -lfolly, can you also specify -L to your folly install directory? For me it is /usr/local/lib.
Reply all
Reply to author
Forward
0 new messages