ntamas / plfit

Fitting power-law distributions to empirical data, according to the method of Clauset, Shalizi and Newman
GNU General Public License v2.0
47 stars 17 forks source link

can not compile by gcc with your instruction #10

Closed zlfccnu closed 10 years ago

zlfccnu commented 10 years ago

if I compile the code with "gcc -o plfit -I../src -lm ../src/.c" it will through out errors below: gcc -o plfit -I ./src -lm ./src/.c /tmp/cctYgdqz.o:in function ‘show_version’: plgen.c:(.text+0x0): multiple definition of show_version' /tmp/ccn93Qkq.o:main.c:(.text+0x0):first definition here /tmp/cctYgdqz.o:in function ‘usage’: plgen.c:(.text+0x2a): multiple definition ofusage' /tmp/ccn93Qkq.o:main.c:(.text+0x2a):first definition here /tmp/cctYgdqz.o:in function ‘parse_cmd_options’: plgen.c:(.text+0x86): multiple definition of parse_cmd_options' /tmp/ccn93Qkq.o:main.c:(.text+0x86):first definition here /tmp/cctYgdqz.o:in function ‘main’: plgen.c:(.text+0x829): multiple definition ofmain' /tmp/ccn93Qkq.o:main.c:(.text+0xdfd):first definition here collect2: error: ld returned 1 exit status really appreciate your reply!

ntamas commented 10 years ago

Ah, this issue has crawled in when I added plgen as an executable to the project. If you don't need plgen (which generates power-law distributed numbers), just remove src/plgen.c and try to recompile. Otherwise, replace ../src/*.c with the list of every single *.c file in src except plgen.c to compile plfit.