From owner-freebsd-questions@FreeBSD.ORG Wed Feb 18 06:30:50 2015 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 75E1F4D7 for ; Wed, 18 Feb 2015 06:30:50 +0000 (UTC) Received: from mail-wg0-x22b.google.com (mail-wg0-x22b.google.com [IPv6:2a00:1450:400c:c00::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EE7F4657 for ; Wed, 18 Feb 2015 06:30:49 +0000 (UTC) Received: by mail-wg0-f43.google.com with SMTP id z12so26711200wgg.2 for ; Tue, 17 Feb 2015 22:30:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=HnpAaw2zCUQGI1JmomATq1fY3wQVmeJPlWpKD/g/LfI=; b=mDB5V+dczFRRawMhTK5p8iarEr7mBUyJdJ1uHNypfaNytuJ4+aztBgHgqilgy+M67Z 5SobdW1MGGNfqiK23DHgjHcOtd+hnathr4YirizI5RARmHdPcYHeF56+bMDxzST5UwGG 57LRKk2IwiYYmBIK1hEeQPUugsB+VdmvxqDiJhX/OXlYnRYOl97JwwyYGhe1Y633hlSR rR8N8LS40EOI3SWi1foGrLyI3qHxksWOIhh80xd8H9m3EblbnUZmGM3NVzQfcb7SRYSk /giKgI6RfD4VeJUYqKx9HdNSbo2Kr76lFL5hK6cNTMVFUU84CgqTQBV/MNKLkwvMqA3t ERog== MIME-Version: 1.0 X-Received: by 10.180.84.100 with SMTP id x4mr1566903wiy.89.1424241048375; Tue, 17 Feb 2015 22:30:48 -0800 (PST) Received: by 10.27.94.66 with HTTP; Tue, 17 Feb 2015 22:30:48 -0800 (PST) Date: Wed, 18 Feb 2015 00:30:48 -0600 Message-ID: Subject: Golang and GUI toolkits on FreeBSD From: "Sam Fourman Jr." To: freebsd general questions Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2015 06:30:50 -0000 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 /* 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.