Skip to content

cgo: invalid #cgo line: CXXFLAGS, pkg-config #4765

Open
@mappu

Description

@mappu

Hi! TinyGo is super interesting, thank you for all your work on this project.

I have a large CGO package that i'm interested to try with TinyGo, to reduce binary size and perform dead code elimination across Go/C/C++ boundaries. But, I hit some missing features so far.

$ cd miqt/examples/helloworld

$ tinygo build
# github.com/mappu/miqt/qt
../../qt/cflags.go:4:6: invalid #cgo line: CXXFLAGS
../../qt/cflags.go:6:6: invalid #cgo line: pkg-config

Go with CGO uses these directives:

  • Any .cpp files in the same package directory are compiled using the $(go env CXX) compiler, using these #cgo CXXFLAGS
  • #cgo pkg-config declares the .pc file to use with $(go env PKG_CONFIG) --cflags/--libs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    cgoCGo and libc related issuesenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions