Simple I know, but could use some help compiling with make

Roderick Gibson kniteli at gmail.com
Thu Sep 29 12:28:56 PDT 2011


On 9/29/2011 11:52 AM, Andrej Mitrovic wrote:
> On 9/29/11, Steven Schveighoffer<schveiguy at yahoo.com>  wrote:
>> On Thu, 29 Sep 2011 14:32:28 -0400, Andrej Mitrovic
>> <andrej.mitrovich at gmail.com>  wrote:
>>
>>> No it's not the same for Windows. On Windows you have to use -L+, e.g.:
>>>
>>> dmd myfile.d -L+path/to/libs mylib.lib
>>
>> That's because +path/to/libs is the search-path parameter for OPTLINK.  -L
>> goes before all linker parameters.  The same is for Linux.
>>
>> See here: http://www.digitalmars.com/d/2.0/dmd-windows.html
>>
>> -Steve
>>
>
> Right, I misinterpreted the "same for Windows" part, you were
> referring to -L and you're right.
>
> DMD could do some magic and replace -L-L with -L+ on Windows to
> simplify cross-platform development. I know it sends everything after
> -L to the linker, but it could make one special case for this.


Thanks so much guys, it worked, although it looks like a mutated 
wildebeest.  For the interested:

IMPORT = -IC:\Dlang\dmd2\src\ext\Derelict2\import
LIB_PATHS = -L+C:\Dlang\dmd2\src\ext\Derelict2\lib\\

LIB_INCLUDES = DerelictSDL.lib DerelictGL.lib DerelictUtil.lib 
DerelictGLU.lib

all:
	dmd src/main.d src/display.d src/renderdata.d src/vector2d.d $(IMPORT) 
$(LIB_PATHS) $(LIB_INCLUDES)

Yes, that is TWO backslashes and the empty line between paths and 
includes is required. Could probably fix it but couldn't figure out how 
to escape the backslash (to prevent it from escaping the newline).


More information about the Digitalmars-d-learn mailing list