Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
serge-hulne opened this issue Sep 4, 2014 · 4 comments

Comments

@serge-hulne
Copy link

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.

@nsf
Copy link
Owner

nsf commented Sep 4, 2014

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

@nsf
Copy link
Owner

nsf commented Sep 4, 2014

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

@serge-hulne
Copy link
Author

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
#6 (comment).

@serge-hulne
Copy link
Author

---------- 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants