0

i have installed hypertable in /opt/hypertable/current/ and i run an example program from hypertable...

#include <Common/Compat.h>

#include <iostream>
#include <fstream>
#include <string>

#include <Common/System.h>
#include <Common/Error.h>

#include <Hypertable/Lib/Client.h>
#include <Hypertable/Lib/KeySpec.h>

using namespace Hypertable;

int main(int argc, char* argv[]) {
        ClientPtr client_ptr;
        TablePtr table_ptr;
        TableMutatorPtr mutator_ptr;
        KeySpec key;

        const char* install_dir = "/opt/hypertable/current/";

        client_ptr = new Client( System::locate_install_dir(install_dir) );

}

i got this error

g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/testes.d" -MT"src/testes.d" -o"src/testes.o" "../src/testes.cpp"
../src/testes.cpp:1: fatal error: Common/Compat.h: No such file or directory

i used eclipse CDT for my development and i linked using project Properties->c/c++build->setting->Libraries->LibrarySetPath(-L) and i have inked the HyperCommon also in -l this i set it as /opt/hypertable/current/include/ can any one tell me y i am getting this error...

raagavan
  • 951
  • 3
  • 12
  • 16

2 Answers2

0

There are two different paths you need to set when building software: the include path and the library path. You seem to be confusing them.

The include path is the path to find all the .h files. If you have an include path problem, it will manifest at compile time (when building each individual .o file), which is what you are seeing. "Common/Compat.h: No such file or directory" means you are likely missing an include path.

The library path is the path to find the DLL/shared object files at link time. If you have a library path problem, it will manifest at link time (when creating the final executable from the .o files). You are not up to that stage of compilation.

So doing LibrarySetPath and setting -l or -L is a linker/library thing; you want to fix the include path.

Most likely, you want to add /opt/hypertable/current/include/ to the include path (in Eclipse). On the GCC command line, this will be done with -I /opt/hypertable/current/include/, NOT with -L.

mgiuca
  • 20,958
  • 7
  • 54
  • 70
  • how can i add -I option in eclipse – raagavan Mar 21 '11 at 04:14
  • I don't use Eclipse, sorry. There should be somewhere in the C++ build settings called "include path" (similar to where you found "library path"), and that is where you should put it. – mgiuca Mar 22 '11 at 10:49
-1

you want to add /opt/hypertable/current/include/ThriftBroker/gen-cpp to the include path 你还得一起编译/opt/hypertable/current/include/ThriftBroker/gen-cpp下的cpp文件

Bise
  • 1