7 Commits

Author SHA1 Message Date
6b65d26014 Update README.md 2024-12-16 17:54:55 +04:00
4e56ab3c9b Merge pull request #4 from BhaumikTalwar/fix-linux-linking
Fix: Linux Linking Error
2024-12-16 17:53:47 +04:00
38aa4923bc fix:Linux-Linking-Error README UPDATE 2024-12-16 13:17:24 +05:30
c8ec2b30b5 fix: Linux Linking Error 2024-12-15 04:10:21 +05:30
41995b60bb Update README.md 2024-12-12 11:52:04 +04:00
e6f5dca6da Update README.md 2024-12-12 11:51:33 +04:00
0bc81ac5ba Fix bug in parseNodes 2022-10-01 06:35:29 +04:00
3 changed files with 41 additions and 11 deletions

View File

@ -38,7 +38,7 @@ download from the GitHub releases page.
### Installing on Windows
Download the **.dll** of the release you want, and place it in the **root** of your Go project.
Download the **.dll** of the [release you want](https://github.com/bloeys/assimp-go/releases), and place it in the **root** of your Go project.
### Installing on MacOS
@ -47,6 +47,27 @@ Next you will need to rename the lib to `libassimp.5.dylib` and move it to `/usr
You can use this command to do it: `sudo mkdir -p /usr/local/lib && sudo cp libassimp_darwin*.dylib /usr/local/lib/libassimp.5.dylib`
### Installing on Linux
Download the the AssImp package for your distro, or build from source and add it to your path.
> NOTE: Insatall assimp >= 3.1 for bindings to work as expected.
> Though getting the latest version is always recommended.
#### Installing on Ubuntu
You can install the Asset-Importer-Lib via apt:
```
sudo apt-get update
sudo apt-get install libassimp-dev
```
#### Installing on Arch
You can install the Asset-Importer-Lib via pacman
```
sudo pacman -S assimp
```
#### Building From Source
To build the Asset Importer Package from sorce read the [sorce build guide](https://github.com/assimp/assimp/blob/master/Build.md)
### Running assimp-go
Use `go run .` to run the simple example in `main.go` ;)

View File

@ -1,11 +1,15 @@
package asig
/*
#cgo CFLAGS: -I .
#cgo LDFLAGS: -L libs
#cgo windows,amd64 LDFLAGS: -l assimp_windows_amd64
#cgo darwin,amd64 LDFLAGS: -l assimp_darwin_amd64
#cgo darwin,arm64 LDFLAGS: -l assimp_darwin_arm64
#cgo linux CFLAGS:
#cgo windows,amd64 CFLAGS: -I .
#cgo darwin,amd64 CFLAGS: -I .
#cgo darwin,arm64 CFLAGS: -I .
#cgo linux LDFLAGS: -lassimp
#cgo windows,amd64 LDFLAGS: -L libs -l assimp_windows_amd64
#cgo darwin,amd64 LDFLAGS: -L libs -l assimp_darwin_amd64
#cgo darwin,arm64 LDFLAGS: -L libs -l assimp_darwin_arm64
#include "wrap.c"
#include <stdlib.h>
@ -215,7 +219,7 @@ func parseNodes(cNodesIn **C.struct_aiNode, parent *Node, parentChildrenCount ui
}
//Parse node's children
nodes[i].Children = parseNodes(n.mChildren, nodes[i], parentChildrenCount)
nodes[i].Children = parseNodes(n.mChildren, nodes[i], uint(n.mNumChildren))
}
return nodes

View File

@ -1,10 +1,15 @@
package asig
/*
#cgo CFLAGS: -I .
#cgo LDFLAGS: -L libs
#cgo windows,amd64 LDFLAGS: -l assimp_windows_amd64
#cgo darwin,arm64 LDFLAGS: -l assimp_darwin_arm64
#cgo linux CFLAGS:
#cgo windows,amd64 CFLAGS: -I .
#cgo darwin,amd64 CFLAGS: -I .
#cgo darwin,arm64 CFLAGS: -I .
#cgo linux LDFLAGS: -lassimp
#cgo windows,amd64 LDFLAGS: -L libs -l assimp_windows_amd64
#cgo darwin,amd64 LDFLAGS: -L libs -l assimp_darwin_amd64
#cgo darwin,arm64 LDFLAGS: -L libs -l assimp_darwin_arm64
#include "wrap.c"
#include <stdlib.h>