-
Notifications
You must be signed in to change notification settings - Fork 276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
undefined reference when building a sharedlib #6
Comments
hi Yarf, (1) could you describe your system setting: e.g., OS and g++ version? (2) under libcuckoo/examples/ , could you successfully "make" and run Thanks,
On Sun, Mar 15, 2015 at 2:35 PM, yarf [email protected] wrote:
Computer Science Department |
Hi Bin, and thanks for responding
|
Hi yarf, It seems like we forgot to externally declare some static variables in the Thanks On Sun, Mar 15, 2015 at 2:53 PM, yarf [email protected] wrote:
|
That appears to have done the trick -- thanks! |
spoke too soon, though this is a different issue: #include <libcuckoo/cuckoohash_map.hh>
#include <libcuckoo/city_hasher.hh>
typedef cuckoohash_map<int, int> Map;
Map map;
static void _construct() __attribute__((constructor));
static void _construct()
{
printf ("{\n");
map[0] = 1010;
printf ("}\n");
} $ g++ -Wall -fPIC -std=c++11 -shared -o foo.so foo.cpp I'm suspecting this may be due to constructor ordering ... any idea how to resolve? |
I'm not sure this has to do with libcuckoo, it might be some weird c++ #include static void _construct() attribute((constructor)); $ g++-4.8 -Wall -fPIC -std=c++11 -shared -o test.so test.cpp But when I do #include <stdio.h> static void _construct() attribute((constructor)); $ g++-4.8 -Wall -fPIC -std=c++11 -shared -o test.so test.cpp On Mon, Mar 16, 2015 at 1:03 PM, yarf [email protected] wrote:
|
thanks Manu -- I see pain in my immediate future :) |
please advise?
foo.cpp:
$ g++ -Wall -fPIC -std=c++11 -shared -o foo.so foo.cpp
$ LD_PRELOAD=./foo.so someprocess
$ symbol lookup error: ./foo.so: undefined symbol: _ZN14cuckoohash_mapIiiSt4hashIiESt8equal_toIiEE6Bucket13key_allocatorE
The text was updated successfully, but these errors were encountered: