oath-toolkit-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[OATH-Toolkit-help] Compilation linking problem


From: Alan Markus
Subject: [OATH-Toolkit-help] Compilation linking problem
Date: Sun, 26 May 2013 16:13:54 -0300

Hi,

I am trying to use the oath-toolkit lib to test totp but i am having a problem when i try to compile my "test" program with the liboath library. Sorry for asking this here but i am sutcked for the last 2 days.

here is the information:
Library is installed from oath-toolkit source, compilation and installation without problems.
address@hidden:~/totp$ sudo ldconfig -v | grep liboath
liboath.so.0 -> liboath.so.0.1.3

My main.cpp "test" program:

#include <stdio.h>
#include <string.h>
#include <time.h>
#include <liboath/oath.h>

int main(int argc, char *argv[]){
int rc=1;
const char* secret="001122";
size_t secretlen=0;
size_t window=0;
unsigned digits=6;
char resultado[10];
time_t now, when, t0,time_step_size;

        rc=oath_init();   // THE ONLY TEST TO CHECK LIBOATH LINK

if (rc == 0)
   printf("liboath: %i\n",OATH_OK);

return 0;
}

Compilation command:
address@hidden:~/totp$ g++ main.cpp -loath -o teste
/tmp/ccXbve8u.o: In function `main':
main.cpp:(.text+0x45): undefined reference to `oath_init()'
collect2: error: ld returned 1 exit status

Checking library, oath_init() function is at the library as expected:

address@hidden:~/totp$ strings /usr/local/lib/liboath.so | grep oath_init
oath_init

Oathtool is also working
address@hidden:~/totp$ oathtool 0011 -v
Hex secret: 0011
Base32 secret: AAIQ====
Digits: 6
Window size: 0
Start counter: 0x0 (0)

325473


I have tried everything I know to find the problem, but i had no success.

I am using Ubuntu 13 and oathtoolkit version 2.0.2

Any help will be very much appreciated.

Alan Jorge Markus


reply via email to

[Prev in Thread] Current Thread [Next in Thread]