-
Notifications
You must be signed in to change notification settings - Fork 17
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
Makefile:5: recipe for target 'install' failed #10
Comments
@vbmade2000 Hey! Sorry for the delay in replying. Github didn't ping me, strangely. Feel free to gmail me directly if you need assistance or file a new issue. The transcript doesn't tell me why If that doesn't let you fix it immediately, try |
Also, what operating system are you building on? |
Sure. The OS is Ubuntu 17. |
Perfect. This should work. I just verified on a linux box I have, and it built. Though it was centos7.3. What does |
Ah. For developing, you will definitely want to install LuaJIT. So just |
Correct. Now I am going to build |
Tried building after pulling latest changes but still facing same issue. Following is an output of
|
So you can follow along, here are the details: This is a link command that is failing:
The libraries libm.so (the math library) and libdl.so (the dynamic loading library) are linked in with the However, the linker cannot locate those libraries on your system. That's what is meant by "undefined reference". The header files where there, just fine, to compile against. But when it came time to link against the actual libraries, the dynamic linker couldn't find them. That's what this lines means:
The above line refers to a
The above errors and the others about Now both these libraries probably exist on your system. It's just a small matter of telling the linker where to find them. This is typically controlled on a linux system by the ld.so.conf file, somewhere in the /etc directory. Step 1, locate the libraries:
Step 2 Then add directories to the ld.so.conf Step 3 Then try again. |
There is one other possibility, that the link line is out of order. Since
If that builds cleanly, then it was an order problem, the flags came in the wrong order. |
As you are adjusting the linker, a quick test would be to try and compile and link a small C program. This will give you an independent test that the linker is now working. Make a test.c file:
compile and link and run it
If it doesn't find the math library (libm.so), then keep changing the ld.so.conf file until it does. Remember to run |
I grabbed a docker container from dockerhub of Ubuntu17, ubuntu:artful-20180112 It looks like /etc/ld.so.conf is right there in
when I look at the ld.so.conf it points me to the /etc/ld.so.conf.d:
and I see that Let's get the test.c building, then we'll be on solid ground. |
Here's a link to installing gcc on Ubuntu. https://gist.github.com/application2000/73fd6f4bf1be6600a2cf9f56315a2d91 If nothing else works, might try re-installing gcc per that gist. |
hmm... okay, I can reproduce the issue in the docker container. Troubleshooting it now. |
It is an order of flags issue. If I manually move the -lm and -ldl to the end of the link line, then it builds. Example:
versus the orignal that CGO is generating fails:
So now to figure out how to make CGO put the -l flags at the end... |
I put in additional -lm -ldl flags in the CGO for golua, and that fixes the problem at tip. PS I hate how Ubuntu changed the default linker options. It got super finicky and broke tons of stuff. Not such a great idea really. Background is here [1][2]. |
@vbmade2000 I'm glad you reported this, and I'm glad it was such an easy fix once the diagnosis was clear. Ubuntu users everywhere will be much happier. |
@glycerine It worked :). Thanks. |
I am trying to build
gi
.Steps I followed:
I am getting
Following are logs of
make
The text was updated successfully, but these errors were encountered: