I'm having a big problem on Eclipse Kepler for Mac!!
Please, help me!!
**** Incremental Build of configuration Debug for project Working ****
make all
Building file: ../hello.cpp
Invoking: GCC C++ Compiler
g++ -O0 -g3 -Wall -c -fmessage-length=0 -std=c++11 -MMD -MP -MF"hello.d" -MT"hello.d" -o "hello.o" "../hello.cpp"
dyld: Library not loaded: /usr/local/lib/libmpc.3.dylib
Referenced from: /Users/Saulo/hpc-gcc/bin/../libexec/gcc/x86_64-apple-darwin13.1.0/4.9.0/cc1plus
Reason: image not found
g++: internal compiler error: Trace/BPT trap: 5 (program cc1plus)
My question is: How can i resolve this?
Thanks!!
Set the variable DYLD_LIBRARY_PATH to the location of libmpc library. To do this, you have to go to Run/Run Configurations and then select Environment tab, then add the variable DYLD_LIBRARY_PATH and finally set its value to the path to the required dylib.
Related
I am trying to include a library from Github (https://github.com/dcjones/hat-trie).
The installation worked fine and I was able to add the library
to the linker in Eclipse
but the problem is that I don't know how to use it.
I have added it as a header
#include <hat-trie.h>
but it's giving this error:
18:49:31 **** Incremental Build of configuration Debug for project test2 ****
make all
Building file: ../src/test2.cpp
Invoking: GCC C++ Compiler
g++ -std=c++1y -std=c++11 -I/home/use1/boost_1_58_0 -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/test2.d" -MT"src/test2.d" -o "src/test2.o" "../src/test2.cpp"
**../src/test2.cpp:28:22: fatal error: hat-trie.h: No such file or directory
#include <hat-trie.h>**
^
compilation terminated.
make: *** [src/test2.o] Error 1
18:49:33 Build Finished (took 2s.831ms)
Any idea how can I fix this?
i have a problem with eclipse CDT and cygwin, when i try to build a simple hello world project i have this error:
make all
Building file: ../src/test.cpp
Invoking: Cygwin C++ Compiler
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/test.d" -MT"src/test.d" -o "src/test.o" "../src/test.cpp"
C:\shell.w32-ix86\make.exe: *** [src/test.o] Error 1
14:37:48 Build Finished (took 178ms)
Cygwin is in the path and commands like 'g++' or 'make' works fine.
Thank in advance for your help.
Follow this tutorial to properly set up cygwin with Eclipse CDI. After completing all the steps, add one more path dependency on: Project Properties -> C/C++ General -> Paths and Symbols -> Includes GNU C++ with the value to : ${CYGWIN_HOME}/usr/i686-pc-cygwin/sys-root/usr/bin. This solved all the issues arising on Eclipse CDT with CYGWIN.
I can't get the following code to run:
#include <iostream>
int main()
{
std::cout << "Hello World" << std::endl;
return 0;
}
There are no compile errors.
The build output:
18:18:58 **** Incremental Build of configuration Debug for project First Project ****
Info: Internal Builder is used for build
g++ "-Ic:\\mingw\\lib\\gcc\\mingw32\\4.8.1\\include\\c++" "-Ic:\\mingw\\lib\\gcc\\mingw32\\4.8.1\\include\\c++\\mingw32" "-Ic:\\mingw\\lib\\gcc\\mingw32\\4.8.1\\include\\c++\\backward" "-Ic:\\mingw\\lib\\gcc\\mingw32\\4.8.1\\include" "-Ic:\\mingw\\include" "-Ic:\\mingw\\lib\\gcc\\mingw32\\4.8.1\\include-fixed" -O0 -g3 -Wall -c -fmessage-length=0 -o Hello.o "..\\Hello.cpp"
18:18:58 Build Finished (took 166ms)
I get the dreaded "Launch failed. Binary not found." dialog. I've been over google for hours now, but nothing works.
In my project folder, a debug or release folder are created (depending on what I set it to) but it's always empty. No 'binaries' folder is created, as some posts mentioned it should.
No proposed solution worked, and disabling the antivirus didn't solve it.
How do I fix this? Thank you.
EDIT
Eclipse Version Kepler Severive Release 1
Build id: 20130919-0819
CDT Version: 8.3.0.201402142303
I'm using MinGW
EDIT2
Changing the "current builder" in properties>c/c++ build>tool chain editor from CDT internal builder to Gnu Make Builder does generate a makefile.
Output:
13:57:41 ** Auto Build of configuration Debug for project First Project **
make all
Building file: ../Hello.cpp
Invoking: GCC C++ Compiler
g++ -I"c:\mingw\lib\gcc\mingw32\4.8.1\include\c++" - I"c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\mingw32" - I"c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\backward" -I"c:\mingw\lib\gcc\mingw32\4.8.1\include" -I"c:\mingw\include" -I"c:\mingw\lib\gcc\mingw32\4.8.1\include-fixed" -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"Hello.d" -MT"Hello.d" -o "Hello.o" "../Hello.cpp"
make: * [Hello.o] Error 1
13:57:42 Build Finished (took 881ms)
Which compiler are you using? It appears that you are only compiling your code, not linking it too. You must build and link in order for it to work.
The -c flag only compiles the source file. It doesn't link with the object file into an executable. Add this:
g++ -o "..\\Hello.exe" "..\\Hello.o" && "..\\Hello.exe"
Just remove -c flag from your compile line and change -o Hello.o to -o Hello.exe (guess you use Windows).
when I build my cpp project in cpp...this is the oupput.
**** Build of configuration Debug for project rtbCookieServer ****
make all
Building file: ../src/rtbCookieServer.cpp
Invoking: GCC C++ Compiler
g++ -I/home/cpp/mongo-cxx-driver-v2.0/mongo -I/home/cpp/mongo-cxx-driver-v2.0 -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/rtbCookieServer.d" -MT"src/rtbCookieServer.d" -o"src/rtbCookieServer.o" "../src/rtbCookieServer.cpp"
Finished building: ../src/rtbCookieServer.cpp
Building target: rtbCookieServer
Invoking: GCC C++ Linker
g++ -L/home/cpp/mongo-cxx-driver-v2.0 -lfcgi++ -lboost_system -lcgicc -lmongoclient -o"rtbCookieServer" ./src/rtbCookieServer.o
Finished building target: rtbCookieServer
W=hen I run the code..the is the error message I get.
/home/workspace/rtbCookieServer/Debug/rtbCookieServer: error while loading shared libraries: libmongoclient.so: cannot open shared object file: No such file or directory
The file is in home/cpp/mongo-cxx-driver-v2.0 so why cant if find it????
Thanks
Better than using LD_LIBRARY_PATH is to specify the runtime library search
-Wl,-rpath /home/cpp/mongo-cxx-driver-v2.0
For more information about why not using LD_LIBRARY_PATH look e.g. here.
Try the command
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/cpp/mongo-cxx-driver-v2.0
first, and try again.
The loader doesn't know the path to the library, so it has to be told where to look.
I have installed minGW and msys. In eclipse CDT I created c++ project that uses cross gcc toolchain.
Eclipse created make file which I can use through command line, so if I run make all project is correctly compiled, but if I use eclipse to build, it fails with following message
**** Build of configuration Debug for project cpp ****
make all
Building file: ../src/main.cpp
Invoking: Cross G++ Compiler
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/main.d" -MT"src/main.d" -o "src/main.o" "../src/main.cpp"
make: *** [src/main.o] Error 1
**** Build Finished ****
I have chosen wrong toolchain in project, changed to mingw gcc and now it works