I'm trying to install the cccfiles library for Eclipse, but I keep getting the following error:
11:24:49 **** Incremental Build of configuration Debug for project Test ****
Info: Internal Builder is used for build
g++ -o Test.exe hello.o practice.o "-lC:\\C++\\cccfiles"
c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64 w64-mingw32/bin/ld.exe: cannot find -lC:\C++\cccfiles
collect2.exe: error: ld returned 1 exit status
11:24:49 Build Finished (took 777ms)
I've googled every possible thing I could think of for the last two days and nothing has helped me.
Related
I just installed Eclipse on my new PC (using Mint 17.1) and run into this error with almost every Project so far. The problem is that when I want to launch my project I get the error:
"Launch Failed. Binary not found."
I already tried to Build the project but then I get 2 errors:
./src/main.o: undefined reference to symbol 'glEnable'
make: *** [OpenGL] Fehler 1
Here is the console log:
01:49:45 **** Incremental Build of configuration Debug for project OpenGL ****
make all
Building target: OpenGL
Invoking: GCC C++ Linker
g++ -L/usr/lib/ -L/usr/lib/x86_64-linux-gnu/mesa/ -o "OpenGL" ./src/main.o -lglut -lGLU
/usr/bin/ld: ./src/main.o: undefined reference to symbol 'glEnable'
//usr/lib/x86_64-linux-gnu/mesa/libGL.so.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [OpenGL] Fehler 1
01:49:45 Build Finished (took 127ms)
I already searched the web for solutions but I can't seem to find a solution that works.
Based on your error log, you haven't linked -lGL. Try adding it to your libraries in the Linker Settings
I am getting a link error when trying to build the sdc tutorial file. I've installed the gnat gpl using the install script. And the .o files exist in /usr/lib/x86_64-linux-gnu.
How do I configure to get the linker to see? I've tried adding to the path.
here's the output:
gnatmake -d -P/home/steve/workspace/ada/tutorial/sdc.gpr -XBuild=DEBUG sdc.adb
gnatbind -static -x /home/steve/workspace/ada/tutorial/obj/sdc.ali
gnatlink /home/steve/workspace/ada/tutorial/obj/sdc.ali -g -o /home/steve/workspace/ada/tutorial/obj/sdc
/usr/gnat/libexec/gcc/x86_64-pc-linux-gnu/4.7.4/ld: cannot find crt1.o: No such file or directory
/usr/gnat/libexec/gcc/x86_64-pc-linux-gnu/4.7.4/ld: cannot find crti.o: No such file or directory
/usr/gnat/libexec/gcc/x86_64-pc-linux-gnu/4.7.4/ld: cannot find -lc
/usr/gnat/libexec/gcc/x86_64-pc-linux-gnu/4.7.4/ld: cannot find crtn.o: No such file or directory
collect2: error: ld returned 1 exit status
gnatlink: error when calling /usr/gnat/bin/gcc
gnatmake: *** link failed.
[2013-11-29 08:47:55] process exited with status 4 (elapsed time: 00.21s)
This is in general a sign that there was a problem during the installation. Removing your install (/usr/gnat) and reinstalling might fix the issue.
The answer comes late, but hopefully will be useful to someone else seeing the same issue later on.
I am running a simple gtest sample in eclipse CDT using cygwin, initially i was getting error as
make***multiple target pattern
Then I changed the library path from D:/ to /cygdrive/d/ and the error is gone but now it is telling
undefined reference to blah blah files
collect2: ld returned 1 exit status
make: *** [sample_gmock.exe] Error 1
I checked the makefile and objects.mk all the things are proper there
g++ -L"/cygdrive/D/Project/gmock-1.6.0/gtest/make" -o "sample_gmock.exe"
./src/sample1.o ./src/sample1_unittest.o /cygdrive/D/Project/gmock-1.6.0/gtest
/make/gtest_main.a -lpthread
What should I do to resolve and make it work, so that I am able to run gmock and gtest in eclipse using cygwin
At first I was working on Linux environment and had gmock_main.a and gtest_main.a generated over there. Same files I was using in Windows environment in Eclipse, so it was giving error.
To get rid of the error I compiled the gmock and gtest code in cygwin terminal to generate gmock_main.a and gtest_main.a, and its working fine.
I am trying to learn the CPPUNIT i looked at the following link:
CPPUNIT
although the selected language here is c i have selected c++ while creating this application and have added the
C:\cppunit\cppunit-1.12.1\include to the include directories i have also added cppunitd,cppunit in the linker options however i still the errors as while i try to test the cppunit.
Errors:
c:/mingw/bin/../lib/gcc/mingw32/4.6.1/../../../../mingw32/bin/ld.exe: cannot find
-lcppunitd
c:/mingw/bin/../lib/gcc/mingw32/4.6.1/../../../../mingw32/bin/ld.exe: cannot find -lcppunit
c:/mingw/bin/../lib/gcc/mingw32/4.6.1/../../../../mingw32/bin/ld.exe: cannot find -lcppunit
collect2: ld returned 1 exit status
make[1]: *** [build/Debug/MinGW_1-Windows/tests/TestFiles/f1] Error 1
make: *** [.build-tests-impl] Error 2
BUILD TESTS FAILED (exit value 2, total time: 4s)
Need to use the -L flag and have a path to the library.
I experienced the same linker error and found that I only had 64-bit version of CppUnit installed while building 32-bit application. I solved it by installing 32-bit version of the library.
I am following the instructions on
http://tayefeh.wordpress.com/2009/07/06/creating-and-using-a-c-shared-library-with-eclipse-cdt-galileo-and-gnu-c-compiler-and-linker/
to build a shared library.
I have got to Step II, bullet point 16 but my attempts to build the project fail with the following error:
**** Build of configuration Debug for project UseDLL ****
make all
Building target: UseDLL
Invoking: GCC C++ Linker
g++ -L"/home/ken/workspace/testlib/Debug" -o"UseDLL" ./src/UseDLL.o -ltestlib -l/home/ken/workspace/testlib/Debug
/usr/bin/ld: cannot find -l/home/ken/workspace/testlib/Debug
collect2: ld returned 1 exit status
make: *** [UseDLL] Error 1
Can anyone advise why the build is failing? The directory does exist and ls shows
[ken#localhost Debug]$ ls /home/ken/workspace/testlib/Debug/
libtestlib.so TestClass.o
If it helps, I am running CentOS 6.3.
Thanks,
Ken
You should remove this:
-l/home/ken/workspace/testlib/Debug
It makes g++ look for a library of that name.