digitalmars.D.learn - lambda alias import
- JN (12/12) Jan 17 2020 stuff.d:
- Petar Kirov [ZombineDev] (6/18) Jan 17 2020 I think the problem comes from the way you compile and link your
- Petar Kirov [ZombineDev] (3/5) Jan 17 2020 *If* you compile both modules ..
- =?UTF-8?Q?Ali_=c3=87ehreli?= (6/9) Jan 17 2020 If that's the solution, some people may find a relatively less known dmd...
- H. S. Teoh (8/21) Jan 17 2020 [...]
stuff.d: alias doStuff = () {}; main.d: import stuff; void main() { doStuff(); } DMD throws compile error: Error 42: Symbol Undefined __D5stuff9__lambda3FNaNbNiNfZv Is this expected behavior? It tripped me while trying to use DerelictVulkan :(
Jan 17 2020
On Friday, 17 January 2020 at 21:40:05 UTC, JN wrote:stuff.d: alias doStuff = () {}; main.d: import stuff; void main() { doStuff(); } DMD throws compile error: Error 42: Symbol Undefined __D5stuff9__lambda3FNaNbNiNfZv Is this expected behavior? It tripped me while trying to use DerelictVulkan :(I think the problem comes from the way you compile and link your code. I you compile both modules together like this it should work out: dmd -ofresult main.d stuff.d (I'm on the phone, so I can't verify if it works atm)
Jan 17 2020
On Friday, 17 January 2020 at 23:04:57 UTC, Petar Kirov [ZombineDev] wrote:[..]*If* you compile both modules ..[..]
Jan 17 2020
On 1/17/20 3:04 PM, Petar Kirov [ZombineDev] wrote:> On Friday, 17 January 2020 at 21:40:05 UTC, JN wrote:I think the problem comes from the way you compile and link your code. I you compile both modules together like this it should work out: dmd -ofresult main.d stuff.dIf that's the solution, some people may find a relatively less known dmd command line switch useful: -i: -i[=<pattern>] include imported modules in the compilation Ali
Jan 17 2020
On Fri, Jan 17, 2020 at 04:12:18PM -0800, Ali Çehreli via Digitalmars-d-learn wrote:On 1/17/20 3:04 PM, Petar Kirov [ZombineDev] wrote:> On Friday, 17 January 2020 at 21:40:05 UTC, JN wrote:[...] Yeah, -i has been a super-convenient thing to use. For unittesting individual modules, etc., I can just `dmd -i -unittest -main -run module.d` and it Just Works(tm). It's awesome. Highly recommended. T -- A programming language should be a toolbox for the programmer to draw upon, not a minefield of dangerous explosives that you have to very carefully avoid touching in the wrong way.I think the problem comes from the way you compile and link your code. I you compile both modules together like this it should work out: dmd -ofresult main.d stuff.dIf that's the solution, some people may find a relatively less known dmd command line switch useful: -i: -i[=<pattern>] include imported modules in the compilation
Jan 17 2020