Skip to content
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

findEmbeddedContent symbol missing #62

Closed
hoytech opened this issue Mar 7, 2017 · 12 comments
Closed

findEmbeddedContent symbol missing #62

hoytech opened this issue Mar 7, 2017 · 12 comments

Comments

@hoytech
Copy link
Contributor

hoytech commented Mar 7, 2017

After installing the latest version of seasocks, I'm having trouble building against libseasocks.a:

/usr/local/lib/libseasocks.a(Connection.cpp.o): In function `seasocks::Connection::sendError(seasocks::ResponseCode, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
Connection.cpp:(.text+0x4c2c): undefined reference to `findEmbeddedContent(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/local/lib/libseasocks.a(Connection.cpp.o): In function `seasocks::Connection::send404()':
Connection.cpp:(.text+0x52b5): undefined reference to `findEmbeddedContent(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/local/lib/libseasocks.a(Connection.cpp.o): In function `seasocks::Connection::processHeaders(unsigned char*, unsigned char*)':
Connection.cpp:(.text+0x6424): undefined reference to `findEmbeddedContent(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
collect2: error: ld returned 1 exit status
@offa
Copy link
Collaborator

offa commented Mar 7, 2017

Go to look for a Config.h in src/main/c/internal/ – if there's one, remove it.

@hoytech
Copy link
Contributor Author

hoytech commented Mar 7, 2017

No, there isn't one. It looks like the symbol is in ./src/main/web/libembedded.a but this file is not installed by make install.

@offa
Copy link
Collaborator

offa commented Mar 7, 2017

Can you build the embedded content (make embedded)?

@hoytech
Copy link
Contributor Author

hoytech commented Mar 7, 2017

Yes, that works fine. However it creates the file ./src/main/web/libembedded.a which isn't installed with make install

@offa
Copy link
Collaborator

offa commented Mar 7, 2017

The libembedded is finally included into the seasocks library.

@hoytech
Copy link
Contributor Author

hoytech commented Mar 7, 2017

You mean into libseasocks.so right? Yes I can link against that OK. If statically compiling seasocks into your app is not supported, maybe libseasocks.a should not be installed?

$ sudo make install
...
-- Installing: /usr/local/lib/libseasocks.a
-- Installing: /usr/local/lib/libseasocks.so

If libseasocks.a is deprecated that's fine, I'll just point out that this was working fine for me as of version 1.2.5.

@offa
Copy link
Collaborator

offa commented Mar 7, 2017

No, you can still use both (static and dynamic).

What's a bit curios to me: Do the tests compile on your system? The tests link seasocks (static) and even use the findEmbeddedContent() function.

@hoytech
Copy link
Contributor Author

hoytech commented Mar 7, 2017

Cool ya static is slightly easier for me at the moment.

Yes, make test succeeds:

doug@comet:~/tp/seasocks/build$ make test
Running tests...
Test project /home/doug/tp/seasocks/build
    Start 1: AllTests
1/1 Test #1: AllTests .........................   Passed    0.35 sec

100% tests passed, 0 tests failed out of 1

Total Test time (real) =   0.35 sec

If the nm output helps at all:

doug@comet:~/tp/seasocks/build$ nm -a ./src/main/web/libembedded.a|grep -i findEmbe
0000000000000000 T _Z19findEmbeddedContentRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
doug@comet:~/tp/seasocks/build$ nm -a ./src/main/c/libseasocks.a|grep -i findemb
                 U _Z19findEmbeddedContentRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE

@offa
Copy link
Collaborator

offa commented Mar 7, 2017

I'm able to reproduce it; I'll have a look on it.

Dynamic lib works, but static has the linker issue.

offa added a commit to offa/seasocks that referenced this issue Mar 7, 2017
@offa
Copy link
Collaborator

offa commented Mar 7, 2017

@hoytech can you checkout my issue62-static_lib branch and test again? Should be fixed there.

@hoytech
Copy link
Contributor Author

hoytech commented Mar 7, 2017

Yes, this seems to fix it. Thanks!

@offa
Copy link
Collaborator

offa commented Mar 7, 2017

Thanks for testing, I'll open a PR for it.

@offa offa mentioned this issue Mar 7, 2017
offa added a commit to offa/seasocks that referenced this issue Mar 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants