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

Can't run examples #97

Open
bsmelo opened this issue Mar 21, 2018 · 2 comments
Open

Can't run examples #97

bsmelo opened this issue Mar 21, 2018 · 2 comments

Comments

@bsmelo
Copy link

bsmelo commented Mar 21, 2018

Hello,

First of all, I'm very new to go, so maybe that is my actual problem... But I can't get the examples to run.
The closer I got was by following the steps below:

 $ export GOPATH=/home/bruno/Dropbox/coap-apps/go
 $ cd /home/bruno/Dropbox/coap-apps/go/src/
 $ git clone https://github.com/zubairhamed/canopus zubairhamed/canopus
 $ ls
dustin  ibm-security-innovation  zubairhamed
 $ cd zubairhamed/canopus
 $ git submodule update --init --recursive
 $ cd openssl
 $ ./config && make
 $ /usr/lib/go-1.10/bin/go run examples/simple/server.go
# github.com/zubairhamed/canopus
In file included from _cgo_export.c:3:0:
./dtls.go: In function ‘init_session_bio_method’:
./dtls.go:63:43: warning: passing argument 2 of ‘BIO_meth_set_write’ from incompatible pointer type
  BIO_meth_set_write(go_session_bio_method,write_wrapper);
(...)
cgo-gcc-prolog: In function ‘_cgo_81a35f110302_Cfunc_DTLSv1_2_server_method’:
cgo-gcc-prolog:195:2: warning: ‘DTLSv1_2_server_method’ is deprecated (declared at ./openssl/include/openssl/ssl.h:1642) [-Wdeprecated-declarations]
cgo-gcc-prolog: At top level:
cc1: warning: unrecognized command line option "-Wno-incompatible-pointer-types"
/tmp/go-build995684464/b001/exe/server: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory
exit status 127

So I've tried the following, but still with no success:

 $ export LD_LIBRARY_PATH=./openssl/                                                 
 $ /usr/lib/go-1.10/bin/go get github.com/zubairhamed/canopus
# github.com/zubairhamed/canopus
In file included from _cgo_export.c:3:0:
./dtls.go: In function ‘init_session_bio_method’:
./dtls.go:63:43: warning: passing argument 2 of ‘BIO_meth_set_write’ from incompatible pointer type
  BIO_meth_set_write(go_session_bio_method,write_wrapper);
(...)
cgo-gcc-prolog: In function ‘_cgo_81a35f110302_Cfunc_DTLSv1_2_server_method’:
cgo-gcc-prolog:195:2: warning: ‘DTLSv1_2_server_method’ is deprecated (declared at ./openssl/include/openssl/ssl.h:1642) [-Wdeprecated-declarations]
cgo-gcc-prolog: At top level:
cc1: warning: unrecognized command line option "-Wno-incompatible-pointer-types"

What should I do? By the way, I don't even want to run the DTLS-enabled examples, just the plain CoAP ones will do...

Thanks!
Bruno Melo.

@bsmelo
Copy link
Author

bsmelo commented Mar 21, 2018

BTW, my go installation details:

 $ /usr/lib/go-1.10/bin/go version                           
go version go1.10 linux/amd64
 $ /usr/lib/go-1.10/bin/go env    
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/bruno/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/bruno/Dropbox/coap-apps/go"
GORACE=""
GOROOT="/usr/lib/go-1.10"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go-1.10/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build300198286=/tmp/go-build -gno-record-gcc-switches"

@bsmelo
Copy link
Author

bsmelo commented Mar 21, 2018

Well, as I said, the problem was indeed my inexperience with go...:

 $ /usr/lib/go-1.10/bin/go install
 $ /usr/lib/go-1.10/bin/go run examples/simple/server.go     
2018/03/21 15:13:33 Started CoAP Server  [::]:5683

Maybe we should add these detailed steps to the README file? LD_LIBRARY_PATH came to me due to my experience with Linux, but it's not obvious, as well as the go install step. Should I make a PR for that file?

And thanks anyway! This looks like an amazingly complete implementation of CoAP and related RFCs. :)

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

1 participant