boggle / gozero

Very early attempt at libzmq bindings for the Go language
Other
30 stars 3 forks source link

not compiling #1

Closed temoto closed 1 year ago

temoto commented 14 years ago

I get bizarre error on compilation. Looks like missing header, but i'm not expert here.

ØMQ version (Ubuntu package from Chris Lea PPA): 2.0.7beta-1chl1~lucid1 libmq-dev package with headers is installed as well. Go version: 34c94d05958c gozero version: 7b78b4

$ make install CGOPKGPATH= /home/temoto/bin/cgo -I. -I "/home/temoto/src/go/include" zmq.go gcc failed:

:13: error: 'ZMQ_POLL' undeclared here (not in a function) cc1: warnings being treated as errors :13: error: type defaults to 'int' in declaration of '__cgo__3' :26: error: 'zmq_sleep' undeclared here (not in a function) :26: error: type defaults to 'int' in declaration of '__cgo__16' :27: error: 'ZMQ_LWM' undeclared here (not in a function) :27: error: type defaults to 'int' in declaration of '__cgo__17' :29: error: 'zmq_flush' undeclared here (not in a function) :29: error: type defaults to 'int' in declaration of '__cgo__19' :31: error: 'zmq_stopwatch_start' undeclared here (not in a function) :31: error: type defaults to 'int' in declaration of '__cgo__21' :35: error: 'ZMQ_P2P' undeclared here (not in a function) :35: error: type defaults to 'int' in declaration of '__cgo__25' :37: error: 'ZMQ_NOFLUSH' undeclared here (not in a function) :37: error: type defaults to 'int' in declaration of '__cgo__27' :43: error: 'zmq_stopwatch_stop' undeclared here (not in a function) :43: error: type defaults to 'int' in declaration of '__cgo__33' on input: typedef struct { char *p; int n; } _GoString_; _GoString_ GoString(char *p); char *CString(_GoString_); # include # include # include extern void free_mem_coffer(uintptr p0, uintptr p1); typeof(zmq_recv) *__cgo__0; typeof(zmq_socket) *__cgo__1; typeof(CString) *__cgo__2; typeof(ZMQ_POLL) *__cgo__3; typeof(zmq_msg_close) *__cgo__4; typeof(int) *__cgo__5; typeof(zmq_msg_init) *__cgo__6; typeof(zmq_init) *__cgo__7; typeof(zmq_msg_size) *__cgo__8; typeof(size_t) *__cgo__9; typeof(zmq_term) *__cgo__10; typeof(zmq_msg_t) *__cgo__11; typeof(zmq_poll) *__cgo__12; typeof(zmq_msg_data) *__cgo__13; typeof(free_mem_coffer) *__cgo__14; typeof(zmq_errno) *__cgo__15; typeof(zmq_sleep) *__cgo__16; typeof(ZMQ_LWM) *__cgo__17; typeof(zmq_connect) *__cgo__18; typeof(zmq_flush) *__cgo__19; typeof(zmq_msg_copy) *__cgo__20; typeof(zmq_stopwatch_start) *__cgo__21; typeof(zmq_msg_init_size) *__cgo__22; typeof(zmq_msg_init_data) *__cgo__23; typeof(zmq_close) *__cgo__24; typeof(ZMQ_P2P) *__cgo__25; typeof(long) *__cgo__26; typeof(ZMQ_NOFLUSH) *__cgo__27; typeof(zmq_msg_move) *__cgo__28; typeof(zmq_version) *__cgo__29; typeof(zmq_send) *__cgo__30; typeof(short) *__cgo__31; typeof(GoString) *__cgo__32; typeof(zmq_stopwatch_stop) *__cgo__33; typeof(zmq_strerror) *__cgo__34; typeof(zmq_pollitem_t) *__cgo__35; typeof(zmq_bind) *__cgo__36; make: **\* [_cgo_defun.c] Error 2
temoto commented 14 years ago

Copy of output w/o github markdown processing here: http://paste.ly/3Hm

sustrik commented 14 years ago

There were some API changes introduced in version 2.0.7. The Go binding looks stuck with 2.0.6 version:

boggle commented 14 years ago

Thank's for reporting this. I haven't touched the code in a while - it is quite alpha. BTW I did develop this on mac snow leo against zmq 2.0.6 - no testing with 2.0.7 or under linux has been done so far! I'll likely come around to look into pushing it to compile against 2.0.07. sometime next week. In the mean time, please send patches ;-)

boggle commented 14 years ago

I found the time to make it build on 2.0.9 again; and figured out how to pass a cleanup function pointer to C (quite tricky with cgo but needed by zmq_init_msg_data)

boggle commented 14 years ago

still mostly untested and far from complete

temoto commented 1 year ago

stale