From owner-freebsd-questions@FreeBSD.ORG Wed Feb 18 08:36:39 2015 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BD4945C0 for ; Wed, 18 Feb 2015 08:36:39 +0000 (UTC) Received: from mail-wg0-x235.google.com (mail-wg0-x235.google.com [IPv6:2a00:1450:400c:c00::235]) (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 40F22334 for ; Wed, 18 Feb 2015 08:36:39 +0000 (UTC) Received: by mail-wg0-f53.google.com with SMTP id a1so24148747wgh.12 for ; Wed, 18 Feb 2015 00:36:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=nPe8/WqxZkt3RZdXZIcyxa4fZfpZKIZ2g5M2ZgaJs+M=; b=jzp8BQKLUIEMMD+YNg6cUM2C8VUMCW1OQ98zMhPdmYVF4CiF8yCg4q6E/WFDkXZ8oC DcPQ1nQ9alSD5SaKVntx471isnErINfHGbz6yGaPGSCchukE8ZKWnTZ/RNOubrY+eI8s 1JdmYuOXZ85ZK/u+ScG8zmTJ+4kTfQzN/XD+X5YW9l/omSHDPJKAAo9DXbuRv6yoPyuq Ioe8KsSSaJHP5jGZyZ0awxtEBzAvu0mP2WBri5rlgclqm8CjRKcUs5cPUevsfeD7PtY3 pSB5FKBbgtfAyRfjnyfuYCPVVrJOGBC0ZRNtnGhu5njHTbr9cVAwPMA+j2Y8lN72Wtzr NbQg== MIME-Version: 1.0 X-Received: by 10.194.93.134 with SMTP id cu6mr6467291wjb.79.1424248597581; Wed, 18 Feb 2015 00:36:37 -0800 (PST) Received: by 10.27.94.66 with HTTP; Wed, 18 Feb 2015 00:36:37 -0800 (PST) In-Reply-To: References: Date: Wed, 18 Feb 2015 02:36:37 -0600 Message-ID: Subject: Re: Golang and GUI toolkits on FreeBSD From: "Sam Fourman Jr." To: Waitman Gobble Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: freebsd general questions 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 08:36:39 -0000 This Worked!!! wow thank you much!! On Wed, Feb 18, 2015 at 2:22 AM, Waitman Gobble wrote: > On Tue, Feb 17, 2015 at 11:42 PM, Waitman Gobble > wrote: > > On Tue, Feb 17, 2015 at 11:25 PM, Waitman Gobble > wrote: > >> On Tue, Feb 17, 2015 at 11:20 PM, Sam Fourman Jr. > wrote: > >>> > >>> > >>>> Its curious that CXX is set to g++, but the c compiler is set to cc > >>>> defaulting to clang.. sounds yucky to me. > >>>> > >>>> is your include and lib path set right? > >>> > >>> > >>> I am not sure how to find the path settings, what command would I run? > >>> > >>> > >>> > >>> -- > >>> > >>> Sam Fourman Jr. > >> > >> # pkg info | grep gtk > >> gio-sharp-2.22.3_1 GIO bindings not available in gtk-sharp > >> gqview-2.0.4_15 Another gtk2-based graphic file viewer > >> gtk-engines2-2.20.2_2 Theme engine for the GTK+-2.0 toolkit > >> gtk-sharp-beans-2.14.1_1 Extensions on top of GTK-sharp > >> gtk-sharp20-2.12.10_3 GTK+ and GNOME interfaces for the .NET > runtime > >> gtk-update-icon-cache-2.24.25 Gtk-update-icon-cache utility from the > >> Gtk+ toolkit > >> gtk-xfce-engine-3.0.1_1 Xfce gtk theme engine > >> gtk12-1.2.10_24 Gimp Toolkit for X11 GUI (previous > >> stable version) > >> gtk2-2.24.25_1 Gimp Toolkit for X11 GUI (previous > >> stable version) > >> gtk3-3.14.7 Gimp Toolkit for X11 GUI (current stable > version) > >> gtkmm24-2.24.4_2 C++ wrapper for Gtk+ > >> gtkspell-2.0.16_5 GTK+ 2 spell checking component > >> libcanberra-gtk3-0.30_3 Implementation of the Freedesktop sound > >> theme spec > >> linux-f10-gtk2-2.14.7_5 GTK+ library, version 2.X (Linux Fedora > 10) > >> py27-gtk2-2.24.0_3 Set of Python bindings for GTK+ > >> webkit-gtk2-2.4.8 Opensource browser engine using the > >> GTK+ 2 toolkit > >> webkit-gtk3-2.4.8 Opensource browser engine using the > >> GTK+ 3 toolkit > >> wx28-gtk2-common-2.8.12_5 The wxWidgets GUI toolkit (common files) > >> wx28-gtk2-unicode-2.8.12_5 The wxWidgets GUI toolkit (Unicode) > >> > >> > >> # gtk-config --prefix --libs --cflags > >> /usr/local > >> -I/usr/local/include/gtk-1.2 -I/usr/local/include/glib-1.2 > >> -I/usr/local/lib/glib/include -I/usr/local/include > >> -L/usr/local/lib -L/usr/local/lib -lgtk -lgdk -lgmodule -lglib -lintl > >> -lXi -lXext -lX11 -lm > >> > >> > >> I would presume that gtk3-config would exist? but it's not there. :) > >> > >> let me try the go thingy and see what happens over here. > >> > >> > >> -- > >> Waitman Gobble > >> Los Altos California USA > >> 510-830-7975 > > > > oh, duh. i see. > > #pkgconf --cflags gtk+-3.0 > > > > I/usr/local/include/gtk-3.0 -I/usr/local/include/cairo > > -I/usr/local/include/pixman-1 -D_THREAD_SAFE > > -I/usr/local/include/gdk-pixbuf-2.0 -I/usr/local/include/libpng16 > > -I/usr/local/include/atk-1.0 -I/usr/local/include/at-spi2-atk/2.0 > > -I/usr/local/include/at-spi-2.0 -I/usr/local/include/dbus-1.0 > > -I/usr/local/include/dbus-1.0/include -I/usr/local/include/pango-1.0 > > -I/usr/local/include/freetype2 -I/usr/local/include/harfbuzz > > -I/usr/local/include/gio-unix-2.0/ -pthread > > -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include > > -I/usr/local/include > > > > # pkgconf --libs gtk+-3.0 > > -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject > > -lcairo -pthread -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 > > -L/usr/local/lib -lglib-2.0 -lintl > > > > -- > > Waitman Gobble > > Los Altos California USA > > 510-830-7975 > > > > > ok, maybe this is now working? can you try.. > > # setenv GOPATH /usr/local > # go get github.com/andlabs/ui > (barfs with errors as you mentioned) > > cd /usr/local/src/github.com/andlabs/ui > > take a look at the cgo specs in uitask_unix.go for example: > > // #cgo pkg-config: gtk+-3.0 > // #cgo CFLAGS: --std=c99 > // #include "gtk_unix.h" > // extern gboolean xdoissue(gpointer data); > import "C" > > it's using pkg-config to get the CFLAGS, LDFLAGS etc.. so it should work. > > I think there is an issue with cgo using 'cc' when it is undefined... try > this? > > # cd /usr/local/src/github.com/andlabs/ui > # setenv CC clang > # go build > (wait .. hey there are no more errors, YAY) > > # cd examples/basicwindow > # go build > # ./basicwindow > * a window pops up * > > OK so i think this is working with setenv CC clang (or use export > depending on your shell) > > { but I'd change your CXX to clang++ } > > -- > Waitman Gobble > Los Altos California USA > 510-830-7975 > -- Sam Fourman Jr.