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

undefined reference to `clock_gettime' #16

Open
isgroup-srl opened this issue Dec 6, 2016 · 3 comments
Open

undefined reference to `clock_gettime' #16

isgroup-srl opened this issue Dec 6, 2016 · 3 comments

Comments

@isgroup-srl
Copy link

With both the 0.5 package from https://nmap.org/ncrack/ and git clone https://github.com/nmap/ncrack on Ubuntu 14.04.5 LTS there is a compilation error:

g++ -Lnbase -Lnsock/src -Lopensshlib   -o ncrack ncrack.o utils.o TargetGroup.o Target.o targets.o NcrackOps.o Service.o ServiceGroup.o Connection.o services.o timing.o ncrack_error.o output.o ncrack_tty.o Buf.o NcrackOutputTable.o ncrack_input.o ncrack_resume.o crypto.o http.o http_digest.o modules/ncrack_ssh.o modules/ncrack_smb.o modules/ncrack_rdp.o modules/ncrack_sip.o modules/ncrack_psql.o modules/ncrack_mysql.o modules/ncrack_ftp.o modules/ncrack_telnet.o modules/ncrack_http.o modules/ncrack_pop3.o modules/ncrack_vnc.o modules/ncrack_redis.o modules/ncrack_winrm.o modules/ncrack_owa.o modules/ncrack_imap.o -lnsock -lnbase -lssl -lcrypto -lopenssh 
opensshlib/libopenssh.a(misc.o): In function `monotime':
ncrack/opensshlib/misc.c:918: undefined reference to `clock_gettime'
ncrack/opensshlib/misc.c:922: undefined reference to `clock_gettime'
collect2: ld returned 1 exit status
make[1]: *** [ncrack] Error 1
make[1]: Leaving directory `bin/ncrack'
make: *** [all] Error 2

Changing Makefile as follows fix the issue:

LDFLAGS = -Lnbase -Lnsock/src -Lopensshlib -L $(DBGFLAGS) $(STATIC)
LDADD=-lrt

But then after a make clean and make I get:

g++ -Lnbase -Lnsock/src -Lopensshlib -L   -o ncrack ncrack.o utils.o TargetGroup.o Target.o targets.o NcrackOps.o Service.o ServiceGroup.o Connection.o services.o timing.o ncrack_error.o output.o ncrack_tty.o Buf.o NcrackOutputTable.o ncrack_input.o ncrack_resume.o crypto.o http.o http_digest.o modules/ncrack_ssh.o modules/ncrack_smb.o modules/ncrack_rdp.o modules/ncrack_sip.o modules/ncrack_psql.o modules/ncrack_mysql.o modules/ncrack_ftp.o modules/ncrack_telnet.o modules/ncrack_http.o modules/ncrack_pop3.o modules/ncrack_vnc.o modules/ncrack_redis.o modules/ncrack_winrm.o modules/ncrack_owa.o modules/ncrack_imap.o -lnsock -lnbase -lssl -lcrypto -lopenssh 
g++: error: ncrack: No such file or directory
make[1]: *** [ncrack] Error 1
make[1]: Leaving directory `bin/ncrack'
make: *** [all] Error 2

Thanks,
Francesco

@isgroup-srl
Copy link
Author

@vpnguy-zz
Copy link

LDFLAGS = -Lnbase -Lnsock/src -Lopensshlib $(DBGFLAGS) $(STATIC) -lrt

Did the trick for me

@bgqueengeek
Copy link

Thanks so much, the above LDFLAGS syntax worked for me as well!

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

3 participants