FAQ
Here's my project
https://bitbucket.org/Diericx/chipmunktest/src
On Sunday, March 13, 2016 at 10:03:58 PM UTC-7, zachary...@gmail.com wrote:

Hi!

I'm trying to use Chipmunk's C library in GO to get some physics going but
i ran into this issue where I'm not able to access any functions or
variables. Here's where I'm at.

I compiled Chipmunk using XCode, put it in my project and imported it
which works fine. The only issue is that I can't seem to access a LOT of
the functions. I can use C.cpv(0, 0) to create a vector but I can't use
functions like C.cpSpaceNew(). Here's my main:

package main

// #cgo CFLAGS: -IChipmunk/include
// #cgo CFLAGS: -IChipmunk/src
// #cgo CFLAGS: -DNDEBUG -std=gnu99
// #cgo linux LDFLAGS: -lm
//
// #define CP_USE_CGTYPES 0
// #include "chipmunk/chipmunk.h"
import "C"

func main() {
var space = C.cpSpaceNew()
var test = C.cpv(0, 0)
println(test.x)
}

And here's the error I get:

Zacs-MacBook-Pro:CTest Zac$ go run main.go

*# command-line-arguments*

*Undefined symbols for architecture x86_64:*

* "_cpSpaceNew", referenced from:*

* __cgo_39cd38e24839_Cfunc_cpSpaceNew in main.cgo2.o*

* (maybe you meant: __cgo_39cd38e24839_Cfunc_cpSpaceNew)*

*ld: symbol(s) not found for architecture x86_64*

*clang: error: linker command failed with exit code 1 (use -v to see
invocation)*


I can't figure out what this error means. Does anyone know whats up?


I suspect it's something to do with the way I set up my project so I'll
attach it as a zip.
--
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 golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 2 of 6 | next ›
Discussion Overview
groupgolang-nuts @
categoriesgo
postedMar 14, '16 at 5:03a
activeMar 14, '16 at 7:00a
posts6
users2
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase