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

I can't compile on Ubuntu 20.04 #82

Closed
Neflyte49 opened this issue Dec 27, 2022 · 6 comments
Closed

I can't compile on Ubuntu 20.04 #82

Neflyte49 opened this issue Dec 27, 2022 · 6 comments

Comments

@Neflyte49
Copy link

Hi I tried it but this error happens:
/bin/bash ../libtool --tag=CXX --mode=link g++ -g -O2 -std=c++98 -fomit-frame-pointer -fno-strict-aliasing -pipe -Wall -Wshadow -Wno-uninitialized -Wno-unused -Wundef -Wcast-qual -Wcast-align -Wpointer-arith -Wwrite-strings -o twtest test_stl_chars.o test_stl_fmt.o test_stl_utf8.o test_stl_vector.o test_main.o ../libs/libtstl/libtstl.la
libtool: link: g++ -g -O2 -std=c++98 -fomit-frame-pointer -fno-strict-aliasing -pipe -Wall -Wshadow -Wno-uninitialized -Wno-unused -Wundef -Wcast-qual -Wcast-align -Wpointer-arith -Wwrite-strings -o .libs/twtest test_stl_chars.o test_stl_fmt.o test_stl_utf8.o test_stl_vector.o test_main.o ../libs/libtstl/.libs/libtstl.so
/usr/bin/ld: ../libs/libtstl/.libs/libtstl.so: undefined reference to `dlerror'
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:446: twtest] Error 1
make[2]: Leaving directory '/home/israeru/twin/test'
make[1]: *** [Makefile:503: all-recursive] Error 1
make[1]: Leaving directory '/home/israeru/twin/test'
make: *** [Makefile:518: all-recursive] Error 1
uname -a
Linux israeru-Inspiron-5721 5.15.0-56-generic #62~20.04.1-Ubuntu SMP Tue Nov 22 21:24:20 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Can you help me?

@Mirppc
Copy link

Mirppc commented Dec 27, 2022

That is very odd as it is compiling just fine on Ubuntu 22.04.

Do you have all the dependencies installed? the development dependencies.

The last time i ran into an error like that i was missing a devel or dev package. So my suggestion would be to recheck your installed dependencies or figure out what package provides libstl.

@rogersavage
Copy link

rogersavage commented Dec 27, 2022

I'm on Debian 11 and I had the same problem, after installing the dependencies listed in the Twin readme.

When I started trying to track it down, grep revealed that dlerror() is only called once. I commented out line 44 of libs/libtstl/err.cpp and that allowed me to compile. I have Twin running apparently ok at the moment, but I'll chime in again if I can figure out how to actually fix the problem.

Edit: I've never had to use ldconfig before. I ran sudo ldconfig between configure and make, but maybe I need to pass it some arguments? Not sure what I'm doing here. Researching.

Edit 2: Ok, so after some searching, I found dlfcn.h in my /usr/include directory. I added /usr/include to my /etc/ld.so.conf.d/libc.conf, re-ran sudo ldconfig, then recompiled and now it works without the reference to dlerror commented out. I don't know if this is the correct solution, maybe someone more knowledgeable can comment, but it worked for me.

@dgbiotext
Copy link

@rogersavage

Thanks for your troubleshooting! FWIW, I found that commenting out that line allowed compilation, but the changes to libc.conf did not not help, though I do have dlfcn.h in the place you noted.

Tried on 2 computers -- both Debian 11.6, one i386 one AMD64. Exactly the same problems on both. Happy to have it working!

@cosmos72
Copy link
Owner

cosmos72 commented Jan 24, 2023

It looks like library libdl is missing during linking.
I will fix it ASAP.

@cosmos72
Copy link
Owner

Commit b6e4e4b should fix this issue.

@dgbiotext
Copy link

Happy to report vanilla build worked out of the box. Thanks so much!

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

5 participants