I am fighting a week with this and right now I don't see it working fully
automatically. It needs manual work which is OK because it can be automated
.bash script. I need it working until you figure out how to work
There are a lot of details ad I doubt to can be automated 100%. This does
matter - I need it working.
I followed your recommendation for restructuring the code and I understand
better how go commands process is working. But still there some
missing steps to finish my task.
SWIG option for integer size prevents automatic code generation
using .swigxxx. I circumvented this by calling SWIG directly:
swig -v -Wall -go -intgosize 64 -gccgo -c++ geoconvert.i
This gives me:
if 1) is compiled directly returns errors - it need to be modified:
# edit geoconvert_wrap.cxx -> leave only:
#void SwigDoCgocall(void) __asm__("syscall.Cgocall");
#void SwigDoCgocallDone(void) __asm__("syscall.CgocallDone");
#void SwigDoCgocallBack(void) __asm__("syscall.CgocallBack");
#void SwigDoCgocallBackDone(void) __asm__("syscall.CgocallBackDone");
So it cannot be automated 100% because of SWIG code generation issue. Again
does not matter if I get the job done - it is one time task only
Then I compile all those C/C++ code:
g++ -c -g -O3 geoconvert.cpp -o geoconvert_impl.o # ==> geoconvert_impl.o
g++ -c -g -O3 geoconvert_wrap.cxx -o geoconvert_wrap.o # ==>
geoconvert.cpp is an interface I need to the library I am using.
gccgo -c geoconvert.go -o geoconvert.o # ==> geoconvert.o
Now I have:
Also I need two external libraries:
In order to have them in one place I combined them with archive:
ar cr *geoconvert.a* geoconvert.o geoconvert_wrap.o geoconvert_impl.o /usr
*geoconvert.a* is my final package as static library.
I suppose I have to copy it here manually:
*In order to call it from:*
*/* example.go */*
Will this work?
ar cr geoconvert.a geoconvert.o geoconvert_wrap.o geoconvert_impl.o /usr
On Tuesday, January 29, 2013 9:09:17 PM UTC-8, Ian Lance Taylor wrote:
On Tue, Jan 29, 2013 at 8:32 PM, Constantine Vasil wrote:
got these files:
how to link them and install them as a package?
e.g. how to use this command, I have three object files:
go install -gccgoflags '-v' -compiler=gccgo myproject/mypackage
The idea is that the go command should handle the details of creating
and using the package for you.
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to email@example.com.
For more options, visit https://groups.google.com/groups/opt_out.