r/adventofcode • • Dec 05 '16

SOLUTION MEGATHREAD --- 2016 Day 5 Solutions ---

--- Day 5: How About a Nice Game of Chess? ---

Post your solution as a comment or, for longer solutions, consider linking to your repo (e.g. GitHub/gists/Pastebin/blag/whatever).


STAYING ON TARGET IS MANDATORY [?]

This thread will be unlocked when there are a significant number of people on the leaderboard with gold stars for today's puzzle.

edit: Leaderboard capped, thread unlocked!

14 Upvotes

188 comments sorted by

View all comments

Show parent comment

1

u/Jean-Paul_van_Sartre Dec 05 '16

What did you run to compile this code? I can't seem to get it to work.

% gcc -g -lcrypto -lssl test.c
/tmp/ccoreWBs.o: In function `main':
/home/sartre/dev/Advent-of-Code/2016/c/test.c:13: undefined reference to `MD5_Init'
/home/sartre/dev/Advent-of-Code/2016/c/test.c:15: undefined reference to `MD5_Update'
/home/sartre/dev/Advent-of-Code/2016/c/test.c:16: undefined reference to `MD5_Final'
collect2: error: ld returned 1 exit status

I'm pretty sure I've installed anything that should be required.

% dpkg --get-selections | grep ssl
libgnutls-openssl27:amd64                       install
libio-socket-ssl-perl                           install
libnet-smtp-ssl-perl                            install
libnet-ssleay-perl                              install
libssl-dev:amd64                                install
libssl-doc                                      install
libssl1.0.0:amd64                               install
libsslcommon2:amd64                             install
libsslcommon2-dev:amd64                         install
openssl                                         install
python-openssl                                  install
ssl-cert                                        install

2

u/jcfs Dec 06 '16

Here it compiles with gcc -o p1 p1.c -lcrypto without any problems. Dunno what is causing your problem, sorry.

1

u/Jean-Paul_van_Sartre Dec 06 '16

Thanks for your response, I decided to move on to Java for that day instead.