Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[COMPILE] fails + fixes #16

Open
Ewael opened this issue Nov 22, 2020 · 0 comments
Open

[COMPILE] fails + fixes #16

Ewael opened this issue Nov 22, 2020 · 0 comments

Comments

@Ewael
Copy link

Ewael commented Nov 22, 2020

Hi,

I've cloned the repo today (22.11.2020) and it does not compile.

 /opt/pkt2flow git:(master) scons
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
gcc -o flow_db.o -c -I. flow_db.c
gcc -o pkt2flow.o -c -I. pkt2flow.c
pkt2flow.c: In function 'resemble_file_path':
pkt2flow.c:150:8: warning: implicit declaration of function 'asprintf'; did you mean 'vsprintf'? [-Wimplicit-function-declaration]
  150 |  ret = asprintf(&outputpath, "%s/%s", outputdir, type_folder);
      |        ^~~~~~~~
      |        vsprintf
gcc -o utilities.o -c -I. utilities.c
utilities.c: In function 'new_file_name':
utilities.c:62:9: warning: implicit declaration of function 'asprintf'; did you mean 'vsprintf'? [-Wimplicit-function-declaration]
   62 |   ret = asprintf(&fname, "%s_%"PRIu16"_%s_%"PRIu16"_%lu.pcap",
      |         ^~~~~~~~
      |         vsprintf
gcc -o pkt2flow flow_db.o pkt2flow.o utilities.o -L/usr/local/lib -L/usr/lib -lpcap
/bin/ld: pkt2flow.o:(.bss+0x0): multiple definition of `pairs'; flow_db.o:(.bss+0x0): first defined here
collect2: error: ld returned 1 exit status
scons: *** [pkt2flow] Error 1
scons: building terminated because of errors.

I've fixed both errors by adding

#define _GNU_SOURCE

in both pkt2flow.c and utilities.c.
I've also removed the pairs struct definition in flow_db.c because it already includes the one defined in pkt2flow.h.

I will make a pull request with the fixes, you should check it out.

Thank's!

EDIT: I can not PR the fixes because I do not have the permissions to do so, you might also check this out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant