gothic icon indicating copy to clipboard operation
gothic copied to clipboard

When trying to install on Mac : interpreter.go: bad #cgo option: darwin tcl85 CFLAGS

Open serge-hulne opened this issue 9 years ago • 4 comments

Hi,

I have now been able to use your "gothic" library successfully under Linux, however when attempting to install it on a Mac, I got the error message:

"interpreter.go: bad #cgo option: darwin tcl85 CFLAGS"

Although the version of tcl / tk is indeed the 8.5 one (I checked).

Is there a way around this ?

Thanks,

Serge.

serge-hulne avatar Sep 04 '14 07:09 serge-hulne

What version of the go compiler are you using? (run: go version)

nsf avatar Sep 04 '14 08:09 nsf

Okay with help from @dominikh on irc, I've found the source of that error, it comes from an old Go version:

14:10:03   dominikh | nsf: from Go 1.0.x
14:10:11   dominikh | go1.0.2/src/cmd/cgo/gcc.go:fatalf("%s: bad #cgo option: %s", srcfile, fields[0])

Try updating Go toolchain to a more recent version.

P.S. Thanks again, @dominikh

nsf avatar Sep 04 '14 08:09 nsf

Thank you !

Serge.

On Thu, Sep 4, 2014 at 10:15 AM, nsf [email protected] wrote:

Okay with help from @dominikh https://github.com/dominikh on irc, I've found the source of that error, it comes from an old Go version:

14:10:03 dominikh | nsf: from Go 1.0.x 14:10:11 dominikh | go1.0.2/src/cmd/cgo/gcc.go:fatalf("%s: bad #cgo option: %s", srcfile, fields[0])

Try updating Go toolchain to a more recent version.

P.S. Thanks again, @dominikh https://github.com/dominikh

— Reply to this email directly or view it on GitHub https://github.com/nsf/gothic/issues/6#issuecomment-54428656.

serge-hulne avatar Sep 04 '14 08:09 serge-hulne

---------- Forwarded message ---------- From: Serge Hulne [email protected] Date: Fri, Sep 5, 2014 at 12:13 PM Subject: [go-nuts] Pb using nsf's "gothic" (tcl/tk go binding) libary under Mac To: [email protected]

Hi,

I have been using nsf "gothic" (tcl/tk go binding) libary under Linux for a while now : it works very well and is very convenient for adding a tcl/tck-based graphical interface to a Go application.

However I experienced a few problems installing it under Mac.

In an attempt to solve that problem, I made the following modifications to my Mac development environment:

  • Installed the latest version of Xcode.
  • Removed "port" (port of the Linux tools for Mac) entirely and installed it from scratch to the latest version.
  • Upgraded to the latest stable version of Go.

Now at least I can install "gothic" under Mac and it compiles without complaining.

I had to make the following changes to the "interpreter.go" file, so that the header directives point to the correct library location:

5 #cgo !tcl85 LDFLAGS: -L/opt/local/lib 6 #cgo !tcl85 LDFLAGS: -ltcl8.6 -ltk8.6 7 #cgo !tcl85 CFLAGS: -I/opt/local/include/tcl8.6 8 #cgo darwin tcl85 CFLAGS: -I/opt/local/include 9 #cgo darwin tcl85 CFLAGS: -I/opt/local/include/tcl8.6

instead of the original:

#cgo !tcl85 LDFLAGS: -ltcl8.6 -ltk8.6 #cgo !tcl85 CFLAGS: -I/usr/include/tcl8.6 #cgo tcl85 LDFLAGS: -ltcl8.5 -ltk8.5 #cgo tcl85 CFLAGS: -I/usr/include/tcl8.5 #cgo darwin tcl85 CFLAGS: -I/opt/X11/include So that is points to the correct libraries.

The current situation is that the examples do compile, without any warnings or error messages.

The problem is that the resulting executables run correctly only once, after reboot and cannot be started a second time (they only display a blank interface).

Has anybody had more success in using "gothic" on a mac ?

I yes, would be very grateful for some help on how to proceed.

Thanks,

Serge.

You received this message because you are subscribed to a topic in the Google Groups "golang-nuts" group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/golang-nuts/Rwc91CmBMNs/unsubscribe. To unsubscribe from this group and all its topics, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.

serge-hulne avatar Sep 05 '14 10:09 serge-hulne