xtaci / algorithms

Algorithms & Data structures in C++.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

I think it needs a make file. Compilation keeps failing on different files every time.

rks92 opened this issue · comments

i need more details.. there exists a Makefile.... make is ok under my linux box.

I'm running eclipse. And the compilation keeps failing due to headers being included in the implementation files. The error persists in a different file everytime. Any ideas?

I'm waiting someone to report this bug and it comes now. Actually, I dont
think this is a pure header library. Here are two possible solutions, 1.
using templates like STL, 2. introducing cpp files.
在 2013-6-15 上午2:11,"rks92" notifications@github.com写道:

I'm running eclipse. And the compilation keeps failing due to headers
being included in the implementation files. The error persists in a
different file everytime. Any ideas?


Reply to this email directly or view it on GitHubhttps://github.com//issues/1#issuecomment-19472802
.

i added 'static' keyword to utils dir, maybe i missed some 'static' declarations...

need more details for eclipse error output

here is an example of compiling 2-cpp files , and including the same header file -- hash_string.h
due to the 'static' keyword, the program links..

xtaci@ubuntu:~/algorithms/include$ cat test1.cpp 
#include 
#include 
#include "hash_string.h"
int fn() {
    const char *s = "test1";
    printf("%d\n", alg::hash_fnv1a(s, strlen(s)));
}
xtaci@ubuntu:~/algorithms/include$ cat test2.cpp 
#include 
#include 
#include "hash_string.h"
void fn();
int main() {
    fn();
    const char *s = "test2";
    printf("%d\n", alg::hash_fnv1a(s, strlen(s)));
}
xtaci@ubuntu:~/algorithms/include$ g++ -c test1.cpp  
xtaci@ubuntu:~/algorithms/include$ g++ -c test2.cpp  
xtaci@ubuntu:~/algorithms/include$ g++ -o test test1.o test2.o 
xtaci@ubuntu:~/algorithms/include$ ./test 
-1725747012
-1675414155