Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Feb 2015 07:49:27 +0100
From:      Malcolm Matalka <mmatalka@gmail.com>
To:        "Sam Fourman Jr." <sfourman@gmail.com>
Cc:        freebsd-questions <freebsd-questions@freebsd.org>
Subject:   Re: Golang and GUI toolkits on FreeBSD
Message-ID:  <CAKziXDVuHW1HSHfR5N_m0wodWVErYQFVmPSuauSffcHV=E7oRw@mail.gmail.com>
In-Reply-To: <CAOFF%2BZ3jNXPFvUHvww=Q2zpqdYKXLgFAqBnYD=O_j2iZU41Okw@mail.gmail.com>
References:  <CAOFF%2BZ3jNXPFvUHvww=Q2zpqdYKXLgFAqBnYD=O_j2iZU41Okw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Have you installed gtk3 via ports or pkg?
Den 18 feb 2015 07:30 skrev "Sam Fourman Jr." <sfourman@gmail.com>:

> Hello list,
>
> I am trying to toy around with some sort of gui toolkit to build a X11 app
> it turns out that I cant compile anything, not wx or gtk3 etc..
>
> I am wondering if because clang is the default compiler on FreeBSD that is
> causing me issues.
> I would like to get to the bottom of how to fix this, so we can make a note
> in the FreeBSD port so that others know. so please ask questions lets
> figure out what is going on, it could be that I am missing something simple
> (Eg, FreeBSD has  everything in /usr/local )
>
>
> I really would appreciate any help at knowing how to fix this.
>
>
> here is a example below of yet another toolkit that wont compile
> when trying to build the sample code on this page:
>
> https://github.com/andlabs/ui/wiki/Getting-Started
>
>
> I get this:
>
> go build gui.go
> # github.com/andlabs/ui
> cc did not produce error at completed:1
> on input:
> #line 13 "/home/sfourman/go/src/github.com/andlabs/ui/area_unix.go"
>  #include "gtk_unix.h"
>  extern gboolean our_area_get_child_position_callback(GtkOverlay *,
> GtkWidget *, GdkRectangle *, gpointer);
>  extern void our_area_textfield_populate_popup_callback(GtkEntry *, GtkMenu
> *, gpointer);
>  extern gboolean our_area_textfield_focus_out_event_callback(GtkWidget *,
> GdkEvent *, gpointer);
>  extern gboolean our_area_draw_callback(GtkWidget *, cairo_t *, gpointer);
>  extern gboolean our_area_button_press_event_callback(GtkWidget *, GdkEvent
> *, gpointer);
>  extern gboolean our_area_button_release_event_callback(GtkWidget *,
> GdkEvent *, gpointer);
>  extern gboolean our_area_motion_notify_event_callback(GtkWidget *,
> GdkEvent *, gpointer);
>  extern gboolean our_area_enterleave_notify_event_callback(GtkWidget *,
> GdkEvent *, gpointer);
>  extern gboolean our_area_key_press_event_callback(GtkWidget *, GdkEvent *,
> gpointer);
>  extern gboolean our_area_key_release_event_callback(GtkWidget *, GdkEvent
> *, gpointer);
>  /* because cgo doesn't like ... */
>  static inline void gtkGetDoubleClickSettings(GtkSettings *settings, gint
> *maxTime, gint *maxDistance)
>  {
>   g_object_get(settings,
>   "gtk-double-click-time", maxTime,
>   "gtk-double-click-distance", maxDistance,
>   NULL);
>  }
>
>
> #include <stddef.h> /* for ptrdiff_t and size_t below */
>
> /* Define intgo when compiling with GCC.  */
> typedef ptrdiff_t intgo;
>
> typedef struct { char *p; intgo n; } _GoString_;
> typedef struct { char *p; intgo n; intgo c; } _GoBytes_;
> _GoString_ GoString(char *p);
> _GoString_ GoStringN(char *p, int l);
> _GoBytes_ GoBytes(void *p, int n);
> char *CString(_GoString_);
> void *_CMalloc(size_t);
> #line 1 "not-declared"
> void __cgo_f_1_1(void) { __typeof__(CAIRO_FORMAT_ARGB32)
> *__cgo_undefined__; }
> #line 1 "not-type"
> void __cgo_f_1_2(void) { CAIRO_FORMAT_ARGB32 *__cgo_undefined__; }
> #line 1 "not-const"
> void __cgo_f_1_3(void) { enum { __cgo__undefined__ =
> (CAIRO_FORMAT_ARGB32)*1 }; }
> #line 2 "not-declared"
> void __cgo_f_2_1(void) { __typeof__(CAIRO_STATUS_SUCCESS)
> *__cgo_undefined__; }
> #line 2 "not-type"
> void __cgo_f_2_2(void) { CAIRO_STATUS_SUCCESS *__cgo_undefined__; }
> #line 2 "not-const"
> void __cgo_f_2_3(void) { enum { __cgo__undefined__ =
> (CAIRO_STATUS_SUCCESS)*1 }; }
> #line 3 "not-declared"
> void __cgo_f_3_1(void) { __typeof__(FALSE) *__cgo_undefined__; }
> #line 3 "not-type"
> void __cgo_f_3_2(void) { FALSE *__cgo_undefined__; }
> #line 3 "not-const"
> void __cgo_f_3_3(void) { enum { __cgo__undefined__ = (FALSE)*1 }; }
> #line 4 "not-declared"
> void __cgo_f_4_1(void) { __typeof__(GCallback) *__cgo_undefined__; }
> #line 4 "not-type"
> void __cgo_f_4_2(void) { GCallback *__cgo_undefined__; }
>
>
> followed by a bunch more errors that I dont think are relevant.
>
> below is my config:
>
> sfourman@Sam ~/go/freebsd % go version
> go version go1.4.1 freebsd/amd64
>
>
> sfourman@Sam ~/go/freebsd % go env
> GOARCH="amd64"
> GOBIN=""
> GOCHAR="6"
> GOEXE=""
> GOHOSTARCH="amd64"
> GOHOSTOS="freebsd"
> GOOS="freebsd"
> GOPATH="/home/sfourman/go"
> GORACE=""
> GOROOT="/usr/local/go"
> GOTOOLDIR="/usr/local/go/pkg/tool/freebsd_amd64"
> CC="cc"
> GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
> CXX="g++"
> CGO_ENABLED="1"
>
> sfourman@Sam ~/go/freebsd % cc -v
> FreeBSD clang version 3.5.1 (tags/RELEASE_351/final 225668) 20150115
> Target: x86_64-unknown-freebsd11.0
> Thread model: posix
> sfourman@Sam ~/go/freebsd %
>
>  uname -a
> FreeBSD Sam 11.0-CURRENT FreeBSD 11.0-CURRENT #4 r277531: Thu Jan 22
> 11:47:53 CST 2015     sfourman@Sam:/usr/obj/usr/src/sys/GENERIC  amd64
>
> --
>
> Sam Fourman Jr.
> _______________________________________________
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "
> freebsd-questions-unsubscribe@freebsd.org"
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAKziXDVuHW1HSHfR5N_m0wodWVErYQFVmPSuauSffcHV=E7oRw>