How to compile for Win64 with Visual D? Optlink error?

2017-09-19 Thread Timothy Foster via Digitalmars-d-learn
I'm trying to compile my project as a Win64 application but this is happening: Building C:\Users\me\test\test.exe... OPTLINK (R) for Win32 Release 8.00.17 Copyright (C) Digital Mars 1989-2013 All rights reserved. http://www.digitalmars.com/ctg/optlink.html OPTLINK : Warning 183: Extension not

Re: extern(C) enum

2017-09-15 Thread Timothy Foster via Digitalmars-d-learn
On Friday, 15 September 2017 at 19:35:50 UTC, nkm1 wrote: On Friday, 15 September 2017 at 19:21:02 UTC, Timothy Foster wrote: I believe C enum size is implementation defined. A C compiler can pick the underlying type (1, 2, or 4 bytes, signed or unsigned) that fits the values in the enum.

Re: extern(C) enum

2017-09-15 Thread Timothy Foster via Digitalmars-d-learn
On Friday, 15 September 2017 at 15:35:48 UTC, bitwise wrote: On Friday, 15 September 2017 at 07:24:34 UTC, Jonathan M Davis wrote: On Friday, September 15, 2017 04:15:57 bitwise via Digitalmars-d-learn wrote: I translated the headers for FreeType2 to D, and in many cases, enums are used as

Re: Access Violation when passing the result of a C function directly to a D function?

2017-09-15 Thread Timothy Foster via Digitalmars-d-learn
On Friday, 15 September 2017 at 16:55:27 UTC, Kagamin wrote: On Friday, 15 September 2017 at 04:01:13 UTC, Timothy Foster wrote: am I required to save the result of a C function to variable before passing it into another function or? No. You probably have stack corruption. Does it crash if

Re: Access Violation when passing the result of a C function directly to a D function?

2017-09-15 Thread Timothy Foster via Digitalmars-d-learn
On Friday, 15 September 2017 at 10:33:55 UTC, Vadim Lopatin wrote: On Friday, 15 September 2017 at 04:01:13 UTC, Timothy Foster wrote: [...] Probably you have to use const char * msg when interfacing with C. string is a struct - size_t length and const char * value The string doesn't touch

Access Violation when passing the result of a C function directly to a D function?

2017-09-14 Thread Timothy Foster via Digitalmars-d-learn
I'm compiling on Windows 7 x64, DMD32 D Compiler v2.075.1 and I'm using Derelict Fmod to handle audio in my application. Every Fmod function returns an int telling me if the function ran okay, or if there was an error. I've written the following helper function that will print something for me

Is compiling for Android/iOS possible?

2017-09-06 Thread Timothy Foster via Digitalmars-d-learn
I'm just wondering if I made an application for Windows/Mac/Linux if I could get it to also work on mobile devices, or would I have to rewrite the application in another language to get it to work? If it's possible, what should I be looking at to get something like a "Hello World" example to

Re: writeln() sometimes double prints from main() if I run a thread checking for input?

2017-08-30 Thread Timothy Foster via Digitalmars-d-learn
On Wednesday, 30 August 2017 at 11:28:49 UTC, Stefan Koch wrote: On Wednesday, 30 August 2017 at 10:55:20 UTC, Timothy Foster wrote: On Wednesday, 30 August 2017 at 10:44:43 UTC, Ivan Kazmenko wrote: [...] import std.stdio, core.thread; void main(){ auto thread = new

Re: writeln() sometimes double prints from main() if I run a thread checking for input?

2017-08-30 Thread Timothy Foster via Digitalmars-d-learn
On Wednesday, 30 August 2017 at 10:44:43 UTC, Ivan Kazmenko wrote: On Wednesday, 30 August 2017 at 10:13:57 UTC, Timothy Foster wrote: I'm not sure if this is a known issue, or if I just don't understand how to use threads, but I've got writeln statements sometimes printing out twice in some

writeln() sometimes double prints from main() if I run a thread checking for input?

2017-08-30 Thread Timothy Foster via Digitalmars-d-learn
I'm not sure if this is a known issue, or if I just don't understand how to use threads, but I've got writeln statements sometimes printing out twice in some areas of my code. It seems to only happen when I start a thread that checks for input with stdin.byLineCopy (I'm not sure of the

Terminating a thread (which is blocking)

2017-08-24 Thread Timothy Foster via Digitalmars-d-learn
I've started a thread at the beginning of my program that waits for user input: `thread = new Thread().start;` `static void checkInput(){ foreach (line; stdin.byLineCopy) { ... } }` I need to stop checking for user input at some point in my program but I'm not sure how to kill this