Linker Error - Im unsure of how to proceed - c

I am trying to compile the code for dictionary.c so I can continue onto testing. The only problem is that each time I try to use the make command to compile it i keep on getting the error
speller/ $ make
/usr/bin/ld: cannot open output file speller: Is a directory
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Makefile:4: speller] Error 1
I can imagine that part of the problem is the name of the directory being speller but im overall not very sure of what all I need to do to resolve this error
Any assistance or tips would be greatly appreciated!
I am unsure of what to try to fix it since it seems to be a really broad error

Related

How to fix 'ld: library not found for -lglib-2.0'

I have to do a compiler with flex and bison for a school project.
They give to me example of new language but I can't compile them..
The code is working fine for other people so the problem come from my Mac. The problem appears when I try to compile with make command, he say "ld: library not found for -lglib-2.0".
I installed "Glib" already but this don't solve the problem.
make
[ 20%] Linking C executable facile
ld: library not found for -lglib-2.0
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [facile] Error 1
make[1]: *** [CMakeFiles/facile.dir/all] Error 2
make: *** [all] Error 2
I need to compile the code to work after on the project.
Thanks you

What does this linking error mean when installing portmidi?

After I configured the cmake file for portmidi, and proceeded to use make to make the necessary files, I encountered this error during compilation:
- Build files have been written to: /home/mycomputername
/Desktop/portmedia/portmidi
[ 2%] Linking C shared library /Release/libpmjni.so
/usr/bin/x86_64-linux-gnu-ld: cannot open output file /Release/libpmjni.so: No such file or directory
collect2: error: ld returned 1 exit status
pm_common/CMakeFiles/pmjni.dir/build.make:251: recipe for target '/Release/libpmjni.so' failed
make[2]: *** [/Release/libpmjni.so] Error 1
CMakeFiles/Makefile2:87: recipe for target 'pm_common/CMakeFiles/pmjni.dir/all' failed
make[1]: *** [pm_common/CMakeFiles/pmjni.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
I'm quite confused. I've tried to insert the flags -fpic in the cxx-flags section of ccmake and change the default java install paths to no avail. Quite frankly, I think it has to do with the messing up of execution order, but I don't know where.
Any help will be greatly appreciated.
Apparently, there was some configuring to do in the directories that CMake points to in ccmake configuration. I just redownloaded the files and unzipped it into a newly made portmedia directory. Also, to make sure that you don't get any hiccups in making pm_defaults, refer to Nate's answer. To quote:
Apparently, one of the Makefiles generated by ccmake is broken. I was able to fix the issue by running
sed -i 's/pm_java\/pm_java/pm_java/' build.make
in the pm_java/CMakeFiles/pmdefaults_target.dir/ subdirectory of the
project after running ccmake . (on Ubuntu, though). (The sed
command replaces all occurrences of pm_java/pm_java by pm_java.)
Everything compiles, and I can even run pmdefaults from the
Release directory using
java -Djava.library.path=. -jar pmdefaults.jar

error while statically building Haskell code

I have tried to build my code dynamically and it worked as expected, however when I try to statically build with the option --ghc-options '-optl-static -fPIC' I got the follow error
ld: library not found for -lcrt0.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)
`gcc' failed in phase `Linker'. (Exit code: 1)
any idea?
edit : I added the c tag since I though the gcc is somehow related to c and I guess the error related to c library

CMAKE DSO linking

I'm totally new to cmake. After an svn update (but also to binutils and I suspect this is causing the problem), I get an error (I successfully compiled and used the program before)
Linking CXX executable gmsh
/usr/bin/ld: /usr/local/lib/liblapack.a(dgesvd.o): undefined reference to symbol '_gfortran_concat_string##GFORTRAN_1.0'
/usr/bin/ld: note: '_gfortran_concat_string##GFORTRAN_1.0' is defined in DSO /usr/lib/libgfortran.so.3 so try adding it to the linker command line
/usr/lib/libgfortran.so.3: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
make[2]: *** [gmsh] Error 1
make[1]: *** [CMakeFiles/gmsh.dir/all] Error 2
make: *** [all] Error 2
Maybe it's related to this Fedoraproject DSO Change?
I have an up-to-date archlinux (binutils-2.23-1).
I tried to edit lines in the ccmake . menu. After hitting [c] the original options are restored (so I cannot add /usr/lib/libgfortran.so.3 to the GMSH_EXTERNAL_LIBRARIES variable in order [g] generate the new Makefiles).
I also tried adding some options which were recommended in the cmake irc chat, but it eventually didn't work.
cmake . -DCMAKE_LINK_FLAGS=-Wl,--add-needed
or
cmake . -DCMAKE_LINK_FLAGS=-lgfortran
Resulting in the same error. What can I do?
Additional information: make VERBOSE=1 pastebin link
To add a library to the link command, you can use target_link_libraries. Apparently in this case you want:
target_link_libraries(gmsh ${LINK_LIBRARIES} gfortran)

Systrace 1.6f Compliation error

I am trying to compile Systrace-1.6f on Ubuntu 12.04 32bit edition. I found below error.
root#sharma-VM:/home/sharma/Desktop/systrace-1.6f# make
make all-recursive
make[1]: Entering directory `/home/sharma/Desktop/systrace-1.6f'
Making all in .
make[2]: Entering directory `/home/sharma/Desktop/systrace-1.6f'
gcc -DHAVE_CONFIG_H -I. -Wall -c systrace-translate.c
In file included from systrace-translate.c:54:0:
linux_fcntl.h:90:2: error: unknown type name ‘linux_off_t’
linux_fcntl.h:91:2: error: unknown type name ‘linux_off_t’
linux_fcntl.h:92:2: error: unknown type name ‘linux_pid_t’
linux_fcntl.h:98:9: error: unknown type name ‘linux_loff_t’
linux_fcntl.h:99:9: error: unknown type name ‘linux_loff_t’
linux_fcntl.h:100:9: error: unknown type name ‘linux_pid_t’
make[2]: *** [systrace-translate.o] Error 1
make[2]: Leaving directory `/home/sharma/Desktop/systrace-1.6f'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/sharma/Desktop/systrace-1.6f'
make: *** [all] Error 2
Please kindly suggest me a solution for the above error.
This question about particular program is too specific to be asked on SO. However I came across the same problem and that is how I found it.
grep is your helper! You can grep -rsli linux_off_t to find out that it is in linux_types.h. Another question why it doesn't work, but if you just want to go further, insert the following lines
#undef _LINUX_TYPES_H
#include "linux_types.h"
somewhere in the beginning of linux_fcntl.h.
Then you'll come across yet another issue. Replace all references to cs with xcs. It took me a while since I used assembler last time. So I don't know if that is how this register is called these days but that is what I see for struct user_regs_struct in /usr/include/i386-linux-gnu/sys/user.h.
Even with all that it still does not pass the second regression test.
systrace has not been updated for quite a while and perhaps is not quite compatible with 3.x kernels as is. I am not a kernel expert though.

Resources