Skip to content

error with pkg-config example "unknown option -ocamlc" #3399

@travisbrady

Description

@travisbrady

Expected Behavior

Successful compilation using the pkg-config instructions in the dune quickstart.
Relevant quickstart section: https://dune.readthedocs.io/en/stable/quick-start.html#defining-a-library-with-c-stubs-using-pkg-config

Actual Behavior

Using the instructions that show this rule for discover:

(action  (run %{discover} -ocamlc %{ocamlc})))

I get this error:

$ dune build examples/simple.exe                                                                                                                      Mon Apr 20 13:10:30 2020
    discover lib/c_flags.sexp,lib/c_library_flags.sexp (exit 2)
(cd _build/default/lib && config/discover.exe -ocamlc /Users/tbrady/.opam/4.09.0/bin/ocamlc.opt)
config/discover.exe: unknown option '-ocamlc'.
discover.exe [OPTIONS]
  -verbose      be verbose
  -dest-dir DIR save temporary files to this directory
  -help         Display this list of options
  --help        Display this list of options

Reproduction

  1. Visit this branch in my repo: https://github.com/travisbrady/ocaml-vw/tree/todune
  2. Run $ dune build examples/simple.exe
  3. View error shown above

Specifications

  • Version of dune (output of dune --version): 2.5.0
  • Version of ocaml (output of ocamlc --version): 4.09.0
  • Operating system (distribution and version): Darwin AUSC02QRF6FG8WP 19.3.0 Darwin Kernel Version 19.3.0: Thu Jan 9 20:58:23 PST 2020; root:xnu-6153.81.5~1/RELEASE_X86_64 x86_64

Additional information

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions