digitalmars.D.learn - DUB and pragma lib - OSX
- Joel (19/19) Apr 19 2016 How do I get this C stuff working with DUB? I tried putting the
- Edwin van Leeuwen (2/3) Apr 19 2016 Mind posting your dub configuration file?
- rikki cattermole (4/23) Apr 19 2016 Dub does separate compilation and linking.
- Joel (3/8) Apr 19 2016 Yay! Worked, thanks rikki cattermole!
How do I get this C stuff working with DUB? I tried putting the pragmas in the main source file. extern(C) char* readline(const(char)* prompt); extern(C) void add_history(const(char)* prompt); pragma(lib, "readline"); pragma(lib, "curses"); Linking... Undefined symbols for architecture x86_64: "_add_history", referenced from: _D5mmisc7getLineFAyaZAya in bookkeeping.o "_readline", referenced from: _D5mmisc7getLineFAyaZAya in bookkeeping.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) --- errorlevel 1 dmd failed with exit code 1. Joels-MacBook-Pro:BookKeeping joelcnz$ The C stuff works without DUB.
Apr 19 2016
On Wednesday, 20 April 2016 at 05:53:28 UTC, Joel wrote:How do I get this C stuff working with DUB?Mind posting your dub configuration file?
Apr 19 2016
On 20/04/2016 5:53 PM, Joel wrote:How do I get this C stuff working with DUB? I tried putting the pragmas in the main source file. extern(C) char* readline(const(char)* prompt); extern(C) void add_history(const(char)* prompt); pragma(lib, "readline"); pragma(lib, "curses"); Linking... Undefined symbols for architecture x86_64: "_add_history", referenced from: _D5mmisc7getLineFAyaZAya in bookkeeping.o "_readline", referenced from: _D5mmisc7getLineFAyaZAya in bookkeeping.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) --- errorlevel 1 dmd failed with exit code 1. Joels-MacBook-Pro:BookKeeping joelcnz$ The C stuff works without DUB.Dub does separate compilation and linking. Add them as "libs": ["readline", "curses"] for dub.json (sdl is a bit similar).
Apr 19 2016
On Wednesday, 20 April 2016 at 06:16:35 UTC, rikki cattermole wrote:On 20/04/2016 5:53 PM, Joel wrote:Yay! Worked, thanks rikki cattermole![...]Dub does separate compilation and linking. Add them as "libs": ["readline", "curses"] for dub.json (sdl is a bit similar).
Apr 19 2016