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?
Related
I am trying to include boost in building C++ projects on Ubuntu. The g++ version is 4.8.1 and the boost version is 1.57.0. I followed these instructions to use boost (header only libraries). I put the boost library into ~/opt/lib, and when I try to compile the project I get the following error output:
15:19:47 **** Incremental Build of configuration Debug for project TEST ****
make all
Building file: ../src/test.cpp
Invoking: GCC C++ Compiler
g++ -include/home/alexander/opt/lib/boost_1_57_0 -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/test.d" -MT"src/test.d" -o "src/test.o" "../src/test.cpp"
In file included from <command-line>:0:0:
/usr/include/stdc-predef.h:39:1: fatal error: /home/alexander/opt/lib/boost_1_57_0: No such file or directory
#endif
^
compilation terminated.
make: *** [src/test.o] Error 1
15:19:48 Build Finished (took 1s.31ms)
What have I made wrong?
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.
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
Hello I am getting the following error when trying to compile a c++ project under Eclipse Indigo in windows:
mingw32-make all
'Building file: ../src/testing.cpp'
'Invoking: GCC C++ Compiler'
g++ -I"c:\MinGW\lib\gcc\mingw32\4.5.0\include\c++\tr1\" -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/ testing.d" -MT"src/testing.d" -o "src/testing.o" "../src/testing.cpp"
g++: no input files
mingw32-make: *** [src/testing.o] Error 1
What could be the problem?
There must be some extra spaces somewhere before the name of the file, because you have a very strange file name in the arguments:
-MF"src/ testing.d"
Should be
-MF"src/testing.d"
The wrong path somehow must break the compile line and g++ doesn't understand what the input file is.