Update readme

This commit is contained in:
bloeys
2021-11-13 10:27:52 +04:00
parent 91ae6da694
commit 61f6cfc30f
4 changed files with 13147 additions and 13138 deletions

View File

@ -2,11 +2,22 @@
## Developing assimp-go
`#cgo LDFLAGS: -L ./staticLibs -l zlibstatic -l IrrXML -l assimp`
We link against static assimp libraries that are built for each platform and added to the `aig/lib` package.
We link against static assimp libraries that are built for each platform and added to the `aig/libs` package.
Depending on the platform we select one of them and link against it when doing `go build`.
The general steps are:
- Copy assimp includes into `aig/assimp`
- Copy `zlib.h`, `zconf.h` and `irrXML.h` into `aig/zlib` and `aig/irrxml` respectively.
- Copy static libraries into `aig/libs`
- Generate the wrappers using `swig -go -c++ -intgosize 64 aig/aig.i`
- Add `#cgo LDFLAGS: -L ./staticLibs -l zlibstatic -l IrrXML -l assimp` at the top of the 'C' import in `aig.go`
> Note: When dealing with static libraries the compiler will probably (e.g. MinGW does this) ignore `lib` suffixes and `.a`/`.lib` suffixes.
So if your lib name is `libassimp.a` you need to pass it to CGO as `-l assimp`, otherwise you will get an error about library not found.
For platform specific steps:
**Windows**:
> Note: You must compile with the same C/C++ compiler you use with Go (e.g. if you use MinGW with Go, then compile assimp with MinGW by sepcifying the correct `-G` option)