FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Windows API
Goto page 1, 2  Next
 
Post new topic   Reply to topic     Forum Index -> Bindings
View previous topic :: View next topic  
Author Message
Raedwulf



Joined: 21 Jan 2007
Posts: 9

PostPosted: Sun Mar 18, 2007 1:24 am    Post subject: Windows API Reply with quote

I tried compiling the winsamp.d with the Windows API headers supplied in bindings.

Code:
import win32.windows;

rather than the phobos:
Code:
import std.c.windows.windows;


Im sure I must be doing something wrong, because I keep getting a linker error:
Code:
dmd.exe -O -inline  -IC:\dmd\projects\irrlichtd\src\lib -IC:\dmd\src\phobos -IC:\dmd\tango -IC:\dmd\dm\lib -IC:\dm\lib  -c main.d -ofobj\Release\main.obj
dmd.exe -O -inline  -IC:\dmd\projects\irrlichtd\src\lib -IC:\dmd\src\phobos -IC:\dmd\tango -IC:\dmd\dm\lib -IC:\dm\lib  -c gc.d -ofobj\Release\gc.obj
dmd.exe bin\Release\jpegread.exe jpegread.def  obj\Release\main.obj obj\Release\gc.obj  user32.lib kernel32.lib gdi32.lib phobos.lib
C:\dmd\bin\..\..\dm\bin\link.exe obj\Release\main+obj\Release\gc,bin\Release\jpegread.exe,,user32.lib+kernel32.lib+gdi32.lib+phobos.lib+user32+kernel32,jpegread.def/noi;
OPTLINK (R) for Win32  Release 7.50B1
Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved
   
obj\Release\main.obj(main)
 Error 42: Symbol Undefined _D5win326windef6LOWORDFkZt
obj\Release\main.obj(main)
 Error 42: Symbol Undefined _D5win326windef6HIWORDFkZt
obj\Release\main.obj(main)
 Error 42: Symbol Undefined _D5win327winuser13CreateWindowAFPaPakiiiiT5win325winnt6HANDLET5win325winnt6HANDLET5win325winnt6HANDLEPvZT5win325winnt6HANDLE
C:\dm\bin\..\lib\SNN.lib(winstart)
 Error 42: Symbol Undefined _WinMain@16
--- errorlevel 4


Cheers
_________________
Raedwulf
Back to top
View user's profile Send private message MSN Messenger
jcc7



Joined: 22 Feb 2004
Posts: 657
Location: Muskogee, OK, USA

PostPosted: Mon Mar 19, 2007 7:08 am    Post subject: Re: Windows API Reply with quote

Raedwulf wrote:
Code:
dmd.exe bin\Release\jpegread.exe jpegread.def  obj\Release\main.obj obj\Release\gc.obj  user32.lib kernel32.lib gdi32.lib phobos.lib
C:\dmd\bin\..\..\dm\bin\link.exe obj\Release\main+obj\Release\gc,bin\Release\jpegread.exe,,user32.lib+kernel32.lib+gdi32.lib+phobos.lib+user32+kernel32,jpegread.def/noi;
OPTLINK (R) for Win32  Release 7.50B1
Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved
   
obj\Release\main.obj(main)
 Error 42: Symbol Undefined _D5win326windef6LOWORDFkZt
obj\Release\main.obj(main)
 Error 42: Symbol Undefined _D5win326windef6HIWORDFkZt
obj\Release\main.obj(main)
 Error 42: Symbol Undefined _D5win327winuser13CreateWindowAFPaPakiiiiT5win325winnt6HANDLET5win325winnt6HANDLET5win325winnt6HANDLEPvZT5win325winnt6HANDLE
C:\dm\bin\..\lib\SNN.lib(winstart)
 Error 42: Symbol Undefined _WinMain@16
--- errorlevel 4


Cheers
It looks like you might have multiple problems, but one problem seems to be that you need to include windef.d (or windef.obj if you want to compile it in a separate step) in the last call to DMD. Also, winuser.d and/or winnt.d seems to be needed in the same way.

I don't know what's causing the "_WinMain@16" error.
Back to top
View user's profile Send private message AIM Address
Raedwulf



Joined: 21 Jan 2007
Posts: 9

PostPosted: Mon Mar 19, 2007 7:16 am    Post subject: Reply with quote

I think I see what the problem is Smile. I'm using Codeblocks IDE, and it likes to compile each source file separately and only linking the files finally at the end. So i guess I should compile the win32 files into object/lib files?

Cheers.
_________________
Raedwulf
Back to top
View user's profile Send private message MSN Messenger
WeirdCat



Joined: 29 Apr 2007
Posts: 19

PostPosted: Fri May 11, 2007 1:35 am    Post subject: Reply with quote

Raedwulf wrote:
So i guess I should compile the win32 files into object/lib files?


I've recently added a makefile for this purpose. At the moment (changeset #185) you only have to remove 4 files (iprtrmib1.d, mswsock.d, vfw.d and winsock.d) from the directory for a successfull build.

LLAP,
Sascha
Back to top
View user's profile Send private message
sleets



Joined: 29 Jun 2007
Posts: 27

PostPosted: Fri Jun 29, 2007 6:57 pm    Post subject: Reply with quote

i got this with make.
Code:

Error on line 1: '=' is not a valid filename char
Back to top
View user's profile Send private message
sleets



Joined: 29 Jun 2007
Posts: 27

PostPosted: Fri Jun 29, 2007 7:02 pm    Post subject: Reply with quote

my make is
Code:

Digital Mars Make Version 5.05
Copyright (C) Digital Mars 1985-2004.  All Rights Reserved.
Written by Walter Bright  www.digitalmars.com
Documentation: www.digitalmars.com/ctg/make.html

   MAKE {target} {macro=text} {-dilnqst} [-fmakefile] {@file}

@file   Get command args from environment or file
target   What targets to make       macro=text   Define macro to be text
-d   Output debugging info       -ffile   Use file instead of makefile
-f-   Read makefile from stdin    -i   Ignore errors from executing make rules
-l   List macro expansions       -n   Just echo rules that would be executed
-q   If rules would be executed  -s   Do not echo make rules
   then exit with errorlevel 1 -t   Just touch files

Predefined macros:
   $$   Expand to $
   $@   Full target name
   $?   List of dependencies that are newer than target
   $**   Full list of dependencies
   $*   Name of current target without extension
   $<   From name of current target, if made using an implicit rule
Rule flags:
   +   Force use of COMMAND.COM to execute rule
   -   Ignore exit status
   @   Do not echo rule
   *   Can handle environment response files
   ~   Force use of environment response file
Command error: undefined switch '-h'
Back to top
View user's profile Send private message
WeirdCat



Joined: 29 Apr 2007
Posts: 19

PostPosted: Fri Jun 29, 2007 11:44 pm    Post subject: Reply with quote

sleets wrote:
my make is
Code:
Digital Mars Make Version 5.05


The make tool from Digital Mars is to primitiv, you need a more advanced make like the make from GNU. For Windows you can download it as a part from UnxUtils (Sourceforge link).

LLAP,
Sascha
Back to top
View user's profile Send private message
sleets



Joined: 29 Jun 2007
Posts: 27

PostPosted: Wed Jul 04, 2007 9:31 pm    Post subject: Reply with quote

thanks for your help.
I use the GNU Make version 3.79.1 got this.
Code:

cl@NF /dlang/dmd/import/win32
$ make
dmd.exe d3d9.d -c -inline -I.. -O -release -w -version=Unicode -version=WindowsVista
warning - ..\win32\d3d9types.d(1117): Error: implicit conversion of expression (_Version >> 8 & 255u) of type uint to ubyte can cause loss of data
warning - ..\win32\d3d9types.d(1118): Error: implicit conversion of expression (_Version >> 0 & 255u) of type uint to ubyte can cause loss of data
make: *** [d3d9.obj] Error 1
Back to top
View user's profile Send private message
WeirdCat



Joined: 29 Apr 2007
Posts: 19

PostPosted: Thu Jul 05, 2007 12:22 am    Post subject: Reply with quote

sleets wrote:
thanks for your help.
I use the GNU Make version 3.79.1 got this.

That's only warnings in the file 'd3d9types.d'. I think Clw who commited them recently don't used the compiler switch '-w'. I've just fixed them in revision #192.

LLAP,
Sascha (aka WeirdCat)
Back to top
View user's profile Send private message
smjg



Joined: 29 Sep 2004
Posts: 41

PostPosted: Mon Aug 27, 2007 5:54 pm    Post subject: Reply with quote

WeirdCat wrote:
The make tool from Digital Mars is to primitiv, you need a more advanced make like the make from GNU. For Windows you can download it as a part from UnxUtils (Sourceforge link).

Why can't it be made compatible with either standard make or Digital Mars make? What does the GNU-specific := notation mean anyway?
Back to top
View user's profile Send private message
WeirdCat



Joined: 29 Apr 2007
Posts: 19

PostPosted: Mon Sep 03, 2007 4:11 am    Post subject: Reply with quote

smjg wrote:
Why can't it be made compatible with either standard make or Digital Mars make? What does the GNU-specific := notation mean anyway?


Is there a standard make? I thought GNU make is THE standard. Wink

No realy... it is no problem to make the makefile compatible with more make tools, the problem is that you can't use wildcards then. Therefore you have to maintain a list of every single file in the makefile. I think this is circumstantially in a project with so many contributors. It is much easier to use wildcards.

That doesn't mean we could not have more than one makefile, for different make tools.

LLAP,
Sascha (aka WeirdCat)
Back to top
View user's profile Send private message
WeirdCat



Joined: 29 Apr 2007
Posts: 19

PostPosted: Sun Oct 28, 2007 5:34 am    Post subject: Reply with quote

GMAKE for Windows can be downloaded from: http://www.mingw.org/

or direct link
Back to top
View user's profile Send private message
smjg



Joined: 29 Sep 2004
Posts: 41

PostPosted: Sun Oct 28, 2007 8:14 am    Post subject: Reply with quote

WeirdCat wrote:
No realy... it is no problem to make the makefile compatible with more make tools, the problem is that you can't use wildcards then.

Code:
dir *.d /b
can be used to generate a list of code files, but is there any way we could use the output from this in the makefile?
Back to top
View user's profile Send private message
WeirdCat



Joined: 29 Apr 2007
Posts: 19

PostPosted: Sun Oct 28, 2007 8:50 am    Post subject: Reply with quote

smjg wrote:
Code:
dir *.d /b
can be used to generate a list of code files, but is there any way we could use the output from this in the makefile?


I see only the way to manually include them with a text editor per copy 'n paste... at least with a makefile.
Back to top
View user's profile Send private message
bobef



Joined: 05 Jun 2005
Posts: 269

PostPosted: Wed Mar 05, 2008 11:34 am    Post subject: Tango Reply with quote

I don't know if this is the correct thread, but I see it is about Windows API. I compiled it today with Tango. It requires few minor modifications.

iptypes.d:

Code:
version(Tango) private import tango.stdc.time;
else private import std.c.time;


winldap.d@453:

Code:
int ldap_perror(LDAP* handle, char* message) {
   return 0;//printf("%s: %s\n", message, handle.ld_error);
}

(or include file with printf)

d3dx10math.d:

Quote:
version(Tango) import tango.stdc.math;
else import std.c.math;
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Bindings All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group