linsalrob / fastq-pair

Match up paired end fastq files quickly and efficiently.
https://edwards.flinders.edu.au/sorting-and-paring-fastq-files/
MIT License
142 stars 32 forks source link

issues with compilation #18

Closed mshpak76 closed 3 years ago

mshpak76 commented 3 years ago

I am unable to run make3, so I followed the instructions suggested to another user who experienced a similar problem. However, when creating the /build directory and executing

sudo gcc  ../*.c -o fastq_pair

I get the following error which I can't make sense of:

/usr/bin/ld: /tmp/ccPYVGea.o: in function `main':
test_gzip.c:(.text+0x0): multiple definition of `main'; /tmp/ccSZ6ste.o:main.c:(.text+0x7d): first defined here
collect2: error: ld returned 1 exit status

Any suggestions on how to proceed?

linsalrob commented 3 years ago

Change the gcc command to

gcc -std=gnu99  -o fastq_pair fastq_pair.c main.c  robstr.c is_gzipped.c

There are two files that contain a method with the signature int main(int argc, char* argv[]) and so the compiler can't decide where to start. By explicitly naming the files, this problem is avoided.