Downloads  |  Buy

Linux golang inegration of TA looks not working

Linux golang inegration of TA looks not working

Postby Peter W » May 14th, 2019, 12:31 pm

Hi, I used your example for go version to compile my program in Ubuntu x64.
First I needed to make some changes to your files turboactivate.go and turboactivate_unix.go, because files didn't compiled. It requried to add 2 include statements:
#include <stdlib.h>
#include <stdio.h>
and to change line " type TAStrPtrType *C.CHAR "
to
" type TAStrPtrType *C.char "

Then I added just simple lines from example to my program (main.go):
"import (
"golang.wyday.com/turboactivate"
)
var isGenuine = false
const daysBetweenChecks = 14
const gracePeriodDays = 7

func main() {
ta, err := turboactivate.NewTurboActivate("db2h7lwdqsrwnjvbfgj2rdr474$
if err != nil {
panic(err)
}

isGr, err := ta.IsGenuineEx(daysBetweenChecks, gracePeriodDays, true,$
if err != nil {
panic(err)
}
if isGr == turboactivate.IGRGenuine ||
isGr == turboactivate.IGRGenuineFeaturesChanged ||
isGr == turboactivate.IGRInternetError {
isGenuine = true
}

//my program
cmd.Execute(version)
}

Compiled it to binary, added 'libTurboActivate.so' file to the same directory and run it.

And it fails to find 'libTurboActivate.so' with error: " error while loading shared libraries: libTurboActivate.so: cannot open shared object file: No such file or directory"

This looks like the 'libTurboActivate.so' file you put into package is wrong version and not for x64 linux. Could you please check this.
Peter W
 

Re: Linux golang inegration of TA looks not working

Postby Wyatt » May 15th, 2019, 3:00 pm

Hey Peter,

We'll look into those changes.

Regardin the libTurboActivate.so not being loaded, you'll have to modify the LDFLAGS in turboactivate.go like so:

#cgo LDFLAGS: -L . -L .. -Wl,-rpath=\$ORIGIN -lTurboActivate


We'll see if we can update the examples / article to make this clearer.
User avatar
Wyatt
Site Admin
 
Posts: 5865
Joined: July 11th, 2007, 10:30 pm
Location: New Hampshire

Re: Linux golang inegration of TA looks not working

Postby Peter W » May 16th, 2019, 12:59 pm

Hi Wyatt, this helped, thank you!
Yes, this info should be in example. I continue to set up TA. Should be working soon :)
Peter W
 


Return to LimeLM, TurboActivate, & TurboFloat Support