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

cmd/go: 'go run' ignores *.m files #7436

Closed
andlabs opened this issue Mar 1, 2014 · 2 comments
Closed

cmd/go: 'go run' ignores *.m files #7436

andlabs opened this issue Mar 1, 2014 · 2 comments

Comments

@andlabs
Copy link
Contributor

andlabs commented Mar 1, 2014

What steps will reproduce the problem?
If possible, include a link to a program on play.golang.org.
1. git clone https://gist.github.com/9282874.git darwintest
2. cd darwintest
3. go run *.go

What is the expected output?
The program running, just as if I had built it with go build and ran it manually.

What do you see instead?
# command-line-arguments
Undefined symbols for architecture x86_64:
  "__objc_msgSend_rect", referenced from:
      __cgo_4f956653181a_Cfunc__objc_msgSend_rect in bleh_darwin.cgo2.o
     (maybe you meant: __cgo_4f956653181a_Cfunc__objc_msgSend_rect, __cgo_4f956653181a_Cfunc__objc_msgSend_rect_uint_uint_bool )
  "__objc_msgSend_rect_uint_uint_bool", referenced from:
      __cgo_4f956653181a_Cfunc__objc_msgSend_rect_uint_uint_bool in bleh_darwin.cgo2.o
     (maybe you meant: __cgo_4f956653181a_Cfunc__objc_msgSend_rect_uint_uint_bool)
  "__objc_msgSend_uint", referenced from:
      __cgo_4f956653181a_Cfunc__objc_msgSend_uint in bleh_darwin.cgo2.o
     (maybe you meant: __cgo_4f956653181a_Cfunc__objc_msgSend_uint)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)


Which operating system are you using?
Mac OS X 10.8.5 running as a VirtualBox guest

Which version are you using?  (run 'go version' or 'gccgo --version')
go version devel +9d51d21e0ac6 Thu Feb 27 10:48:36 2014 -0800 darwin/amd64

Please provide any additional information below.
This affects both 32-bit and 64-bit builds. I checked the output of go run -n; the .m
file is missing.
@cookieo9
Copy link
Contributor

cookieo9 commented Mar 2, 2014

Comment 1:

Go run only builds the files passed on the command line (you have passed no *.m files),
and AFAIK never supported building C, C++, or the new Objective-C files used by CGO
packages.
Also the clone url doesn't allow you to see the gist in the browser. To do that goto
https://gist.github.com/andlabs/9282874

@rsc
Copy link
Contributor

rsc commented Mar 3, 2014

Comment 2:

'go run' may start running the package in the current directory. It will never accept
*.m files on the command line, nor will it second-guess what you've listed on the
command line by adding new files.

Status changed to WorkingAsIntended.

@golang golang locked and limited conversation to collaborators Jun 25, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants