jeroend / wxgo Goto Github PK
View Code? Open in Web Editor NEWGo Wrapper for the wxWidgets GUI
Go Wrapper for the wxWidgets GUI
This is the source code for wxGo a Go wrapper of the wxWidgets library. The actuall wxWidgets source code is not included and will need to be downloaded separately. The wrappers are created using the SWIG tool. There are currenly still some patches/tricks required to get a propper build going. Mostly releasted to SWIG support on windows. Read support/Building.txt for information on how to get it all going on windows. Jeroen Dirks June 2011
Hi, I don't habe ${GOROOT}/src/Make.inc or ${GOROOT}/src/Make.pkg. What are these?
$ make -f Makefile.windows
g++ -m32 -I . -g -fPIC -O2 -o obj/wx_wrapcxx.o -c obj/wx_wrap.cxx -I/extra/wx/
lib/wx/include/msw-unicode-release-2.8 -I/extra/wx/include/wx-2.8 -D_IODBC -DWX
USINGDLL -D__WXMSW_ -mthreads
obj/wx_wrap.cxx:1:0: warning: -fPIC ignored for target (all code is position in
dependent)
obj/wx_wrap.cxx: In function 'void wrap_wxGetOsDescription(void)':
obj/wx_wrap.cxx:2299:79: error: cannot convert 'const wxChar' to 'const char*'
for argument '1' to 'gostring swig_makegostring(const char, size_t)'
obj/wx_wrap.cxx: In function 'void wrap_wxCommandEvent_GetString(void)':
obj/wx_wrap.cxx:5465:79: error: cannot convert 'const wxChar' to 'const char'
for argument '1' to 'gostring swig_makegostring(const char, size_t)'
obj/wx_wrap.cxx: In function 'void wrap_wxNotifyEvent_GetString(void)':
obj/wx_wrap.cxx:5704:79: error: cannot convert 'const wxChar' to 'const char'
for argument '1' to 'gostring swig_makegostring(const char, size_t)'
obj/wx_wrap.cxx: In function 'void wrap_wxTreeEvent_GetLabel(void)':
obj/wx_wrap.cxx:5997:75: error: cannot convert 'const wxChar' to 'const char'
for argument '1' to 'gostring swig_makegostring(const char, size_t)'
obj/wx_wrap.cxx: In function 'void wrap_wxTreeEvent_GetToolTip(void)':
obj/wx_wrap.cxx:6017:79: error: cannot convert 'const wxChar' to 'const char'
for argument '1' to 'gostring swig_makegostring(const char, size_t)'
obj/wx_wrap.cxx: In function 'void wrap_wxTreeEvent_GetString(void)':
obj/wx_wrap.cxx:6148:79: error: cannot convert 'const wxChar' to 'const char'
obj/wx_wrap.cxx:6148:79: error: cannot convert 'const wxChar' to 'const char'
for argument '1' to 'gostring swig_makegostring(const char, size_t)'
obj/wx_wrap.cxx: In function 'void wrap_wxMenu_Append__SWIG_0(void)':
obj/wx_wrap.cxx:6851:51: error: call of overloaded 'wxString(char&, int&)' is
ambiguous
D:/MinGW/msys/1.0/extra/wx/include/wx-2.8/wx/string.h:1283:3: note: candidates a
re: wxString::wxString(const void, const void)
D:/MinGW/msys/1.0/extra/wx/include/wx-2.8/wx/string.h:694:3: note:
wxString::wxString(size_t, wxChar)
D:/MinGW/msys/1.0/extra/wx/include/wx-2.8/wx/string.h:692:3: note:
wxString::wxString(wxChar, size_t)
obj/wx_wrap.cxx:6855:51: error: call of overloaded 'wxString(char&, int&)' is
ambiguous
D:/make: *** wait: No children. Stop.
make: *** Waiting for unfinished jobs....
make: *** wait: No children. Stop.
CTRL+C
What's the problem?
thanks.
When compiled wx in Linux or Mingw It'll generate a wx-config executable.
SWIG_CXXFLAGS=$(shell wx-config --cxxflags)
SWIG_LDFLAGS=$(shell wx-config --libs)
include ${GOROOT}/src/Make.inc
SWIGOPT+=${WXDEFS}
TARG = wx
SWIGFILES=
wx.swigcxx
CXXFILES=
wxwrap.cxx
GOFILES=wxwrap.go
CXXOBJS=$(patsubst %.cxx,_obj/%.o,$(CXXFILES))
include ${GOROOT}/src/Make.pkg
%: install %.go
$(LD) $(SWIG_RPATH) -o $@ $.$0
_obj/%.o: %.cxx $(HFILES)
@mkdir -p _obj
I installed the latest Mingw/MSYS (as of yesterday - choosing all of the packages for development) using their installer. I grabbed the latest 2.8.12 series wxwidgets and successfully compiled it (ansi style) and several sample programs - which worked. I grabbed swig from svn and applied the patch (and successfully got a executable - after grabbing and compiling pcre as well). I have all the various projects go, pcre, swig, wx and wxGo under /home/ but have done make install for wx, pcre and swig and ./all.bash for go. So wx, pcre and swig show up in the correct places under /usr/local (lib, bin and include). All SHOULD be well (I'm on Windows 7 64 bit btw). So I go to /home//wxGo/wx and enter:
$ make
swig -go -c++ -module wx -soname wx-wx.so -o _obj/wx_wrap.cxx -outdir _obj wx.swigcxx
wx.swigcxx(228) : Error: Syntax error in input(1).
make: *** [_obj/wx.go] Error 1
I've tried setting environment variables trying to follow one of the other issues entered here, but I've been unable to get anywhere. While I'm FAR from a gcc/go/bash guru (and I know nothing about swig) I have been able to get go-gtk compiled in the same environment. Do you have any pointers or suggestions I could try? Thanks!
David
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.