We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Be able to compile an executable in bytecode while linking with a library containing c++ foreign_archive.
To do so, the ocamlmklib should be invoked with -lstdc++.
-lstdc++
$ readelf -d _build/default/lib/dllhello_world.so Dynamic section at offset 0x2db0 contains 27 entries: Tag Type Name/Value 0x0000000000000001 (NEEDED) Shared library: [libstdc++.so.6] 0x0000000000000001 (NEEDED) Shared library: [libc.so.6] 0x000000000000000c (INIT) 0x1000 0x000000000000000d (FINI) 0x11bc 0x0000000000000019 (INIT_ARRAY) 0x3d98 0x000000000000001b (INIT_ARRAYSZ) 16 (bytes) 0x000000000000001a (FINI_ARRAY) 0x3da8 0x000000000000001c (FINI_ARRAYSZ) 8 (bytes) 0x000000006ffffef5 (GNU_HASH) 0x2f0 0x0000000000000005 (STRTAB) 0x420 0x0000000000000006 (SYMTAB) 0x318 0x000000000000000a (STRSZ) 309 (bytes) 0x000000000000000b (SYMENT) 24 (bytes) 0x0000000000000003 (PLTGOT) 0x3fa0 0x0000000000000002 (PLTRELSZ) 72 (bytes) 0x0000000000000014 (PLTREL) RELA 0x0000000000000017 (JMPREL) 0x6b0 0x0000000000000007 (RELA) 0x5c0 0x0000000000000008 (RELASZ) 240 (bytes) 0x0000000000000009 (RELAENT) 24 (bytes) 0x000000000000001e (FLAGS) BIND_NOW 0x000000006ffffffb (FLAGS_1) Flags: NOW 0x000000006ffffffe (VERNEED) 0x570 0x000000006fffffff (VERNEEDNUM) 2 0x000000006ffffff0 (VERSYM) 0x556 0x000000006ffffff9 (RELACOUNT) 4 0x0000000000000000 (NULL) 0x0
$ readelf -d _build/default/lib/dllhello_world.so Dynamic section at offset 0x2dc0 contains 26 entries: Tag Type Name/Value 0x0000000000000001 (NEEDED) Shared library: [libc.so.6] 0x000000000000000c (INIT) 0x1000 0x000000000000000d (FINI) 0x11bc 0x0000000000000019 (INIT_ARRAY) 0x3da8 0x000000000000001b (INIT_ARRAYSZ) 16 (bytes) 0x000000000000001a (FINI_ARRAY) 0x3db8 0x000000000000001c (FINI_ARRAYSZ) 8 (bytes) 0x000000006ffffef5 (GNU_HASH) 0x2f0 0x0000000000000005 (STRTAB) 0x420 0x0000000000000006 (SYMTAB) 0x318 0x000000000000000a (STRSZ) 268 (bytes) 0x000000000000000b (SYMENT) 24 (bytes) 0x0000000000000003 (PLTGOT) 0x3fa0 0x0000000000000002 (PLTRELSZ) 72 (bytes) 0x0000000000000014 (PLTREL) RELA 0x0000000000000017 (JMPREL) 0x658 0x0000000000000007 (RELA) 0x568 0x0000000000000008 (RELASZ) 240 (bytes) 0x0000000000000009 (RELAENT) 24 (bytes) 0x000000000000001e (FLAGS) BIND_NOW 0x000000006ffffffb (FLAGS_1) Flags: NOW 0x000000006ffffffe (VERNEED) 0x548 0x000000006fffffff (VERNEEDNUM) 1 0x000000006ffffff0 (VERSYM) 0x52c 0x000000006ffffff9 (RELACOUNT) 4 0x0000000000000000 (NULL) 0x0
$ dune build --root . File "_none_", line 1: Error: Error on dynamically loaded library: ./lib/dllhello_world.so: ./lib/dllhello_world.so: undefined symbol: _ZSt4cout
dune
dune --version
ocaml
ocamlc --version
foreign_library
library_flags
c_library_flags
(languages c cxx)
The text was updated successfully, but these errors were encountered:
@voodoos I'm moving you as assignee since you worked on #5185
Sorry, something went wrong.
voodoos
Successfully merging a pull request may close this issue.
Expected Behavior
Be able to compile an executable in bytecode while linking with a library containing c++ foreign_archive.
To do so, the ocamlmklib should be invoked with
-lstdc++
.Dynamique section
Actual Behavior
Dynamique section
Reproduction
Specifications
dune
(output ofdune --version
): 2.9ocaml
(output ofocamlc --version
): 4.08Additional notes
foreign_library
should supportlibrary_flags
andc_library_flags
in order to add other dependenciesforeign_library
mixing c and c++ files (e.g.(languages c cxx)
)The text was updated successfully, but these errors were encountered: