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: 5995
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
 

Re: Linux golang inegration of TA looks not working

Postby inkflow » August 14th, 2019, 2:59 am

I also had to change the 2 occurrences of "C.STRTYPE" in turboactivate.go to "*C.char".

It seems that golang support isn't that great...
inkflow
 

Re: Linux golang inegration of TA looks not working

Postby Wyatt » August 14th, 2019, 6:23 am

>> "It seems that golang support isn't that great..."

We've created articles, a subdomain on wyDay, example source code, etc. The support is pretty darn good. We've made extra efforts to make TurboActivate fit the "golang way of doing things".

The Unix example worked on the golang version when we first released it. Golang is a shifting language with good(ish) backwards compatibility. Unfortunately they broke something in one of the releases they made since we first released the example.

We'll fix the Unix example in an upcoming update.
User avatar
Wyatt
Site Admin
 
Posts: 5995
Joined: July 11th, 2007, 10:30 pm
Location: New Hampshire


Return to LimeLM, TurboActivate, & TurboFloat Support