www.digitalmars.com Home | Search | C & C++ | D | DMDScript | News Groups | index | prev | next
Archives

D Programming
D
D.gnu
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.DMDScript

c++ - winnt.h

↑ ↓ ← "Charles Sanders" <sanders-consulting comcast.net> writes:
Hey all,

Trying to get libcurl to compile with DMC, and in the source it includes
winnt.h.  I tried a simple sample program (listed below) and get these
errors ( below sample ).  These typedefs look ok to me, what am I missing ?

Sample:

#include <winnt.h>
#include <stdio.h>

int main () {
 puts("FOO");
}


Errors:

typedef CONST WCHAR *LPCWCH, *PCWCH;
                  ^
c:\dm\bin\..\include\win32\WINNT.H(86) : Error: missing ',' between
declaration
of 'CONST' and 'WCHAR'
typedef CONST WCHAR *LPCWSTR, *PCWSTR;
                    ^
c:\dm\bin\..\include\win32\WINNT.H(90) : Error: 'WCHAR' previously declared
as s
omething else
It was declared as: unsigned short
It is now declared: int
typedef CONST CHAR *LPCCH, *PCCH;
                   ^
c:\dm\bin\..\include\win32\WINNT.H(98) : Error: 'CHAR' previously declared
as so
mething else
It was declared as: char
It is now declared: int
typedef CONST CHAR *LPCSTR, *PCSTR;
                   ^
c:\dm\bin\..\include\win32\WINNT.H(101) : Error: 'CHAR' previously declared
as s
omething else
It was declared as: char
It is now declared: int
typedef LPCSTR LPCTSTR;
                     ^
c:\dm\bin\..\include\win32\WINNT.H(130) : Error: missing ',' between
declaration
 of 'LPCSTR' and 'LPCTSTR'
Fatal error: too many errors
--- errorlevel 1



Thanks,
Charles
Sep 20 2003
↑ ↓ "Gisle Vanem" <giva users.sourceforge.net> writes:
"Charles Sanders" <sanders-consulting comcast.net> wrote:

 Trying to get libcurl to compile with DMC, and in the source it includes
 winnt.h.  I tried a simple sample program (listed below) and get these
 errors ( below sample ).  These typedefs look ok to me, what am I missing ?

You must be using an old libcurl. My version (the latest 7.10.7) doesn't include <winnt.h>, but <winsock.h>.
 Sample:

 #include <winnt.h>
 #include <stdio.h>

Include <windows.h> before winnt.h. --gv
Sep 20 2003
→ "Charles Sanders" <sanders-consulting comcast.net> writes:
Great do you have a makefile for it ?

Thanks,
Charles
"Gisle Vanem" <giva users.sourceforge.net> wrote in message
news:bkideu$2lo8$1 digitaldaemon.com...
 "Charles Sanders" <sanders-consulting comcast.net> wrote:

 Trying to get libcurl to compile with DMC, and in the source it includes
 winnt.h.  I tried a simple sample program (listed below) and get these
 errors ( below sample ).  These typedefs look ok to me, what am I


 You must be using an old libcurl. My version (the latest 7.10.7) doesn't
 include <winnt.h>, but <winsock.h>.

 Sample:

 #include <winnt.h>
 #include <stdio.h>

Include <windows.h> before winnt.h. --gv

Sep 20 2003
→ "Charles Sanders" <sanders-consulting comcast.net> writes:
This is an old libcurl btw
"Gisle Vanem" <giva users.sourceforge.net> wrote in message
news:bkideu$2lo8$1 digitaldaemon.com...
 "Charles Sanders" <sanders-consulting comcast.net> wrote:

 Trying to get libcurl to compile with DMC, and in the source it includes
 winnt.h.  I tried a simple sample program (listed below) and get these
 errors ( below sample ).  These typedefs look ok to me, what am I


 You must be using an old libcurl. My version (the latest 7.10.7) doesn't
 include <winnt.h>, but <winsock.h>.

 Sample:

 #include <winnt.h>
 #include <stdio.h>

Include <windows.h> before winnt.h. --gv

Sep 20 2003
"Charles Sanders" <sanders-consulting comcast.net> writes:
Sorry for all the responses :), but Im also having to manually change the
CFINIT's and other initliazers by hand, what do you usually do ?

Thanks,
Charles
"Gisle Vanem" <giva users.sourceforge.net> wrote in message
news:bkideu$2lo8$1 digitaldaemon.com...
 "Charles Sanders" <sanders-consulting comcast.net> wrote:

 Trying to get libcurl to compile with DMC, and in the source it includes
 winnt.h.  I tried a simple sample program (listed below) and get these
 errors ( below sample ).  These typedefs look ok to me, what am I


 You must be using an old libcurl. My version (the latest 7.10.7) doesn't
 include <winnt.h>, but <winsock.h>.

 Sample:

 #include <winnt.h>
 #include <stdio.h>

Include <windows.h> before winnt.h. --gv

Sep 20 2003
↑ ↓ "Gisle Vanem" <giva users.sourceforge.net> writes:
"Charles Sanders" <sanders-consulting comcast.net> wrote:

 Sorry for all the responses :), but Im also having to manually change the
 CFINIT's and other initliazers by hand, what do you usually do ?

What's a CFINIT? No, I have only makefiles for MingW. --gv
Sep 20 2003
→ "Charles Sanders" <sanders-consulting comcast.net> writes:
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

They initiliaze all their options via a macro looks like this

#define CINIT(name,type,number) CURLOPT_ ## name =3D CURLOPTTYPE_ ## =
type + number


typedef enum {
  CURLOPT_NOTHING =3D 0,=20
 =20
  /* This is the FILE * or void * the regular output should be written =
to. */
  CINIT(FILE, OBJECTPOINT, 1),

  /* The full URL to get/put */
  CINIT(URL,  OBJECTPOINT, 2),

...
}

DMC seems not to like this with errors like :

  CINIT(FILE, OBJECTPOINT, 1),
                           ^
../include\curl/curl.h(305) : Error: '}' expected
  CFINIT(NOTHING),        /********* the first one is unused =
************/
               ^
../include\curl/curl.h(778) : Error: '}' expected
  CFINIT(COPYNAME),
                ^
../include\curl/curl.h(781) : Error: missing ',' between declaration of =
'CURLFO
M_' and 'COPYNAME'
        CURLformoption          option;
                                     ^
../include\curl/curl.h(809) : Error: ';' expected following declaration =
of stru
t member
CURLcode curl_easy_setopt(CURL *curl, CURLoption option, ...);
                                               ^
../include\curl/easy.h(30) : Error: ')' expected
Fatal error: too many errors
--- errorlevel 1

My solution was just to change them all by hand, emacs macros speed it =
up, I think ill write a simple prog in D to convert these, as they are =
unlikely to stop using this method and Ill need it  for the future.  If =
you want a build for DMC I should have one shortly.

P.S.  I included windows.h before winnt.h and it compiled fine.

Thanks

Charles

"Gisle Vanem" <giva users.sourceforge.net> wrote in message =
news:bkij2n$2t0c$1 digitaldaemon.com...
 "Charles Sanders" <sanders-consulting comcast.net> wrote:
=20
 Sorry for all the responses :), but Im also having to manually =


 CFINIT's and other initliazers by hand, what do you usually do ?

What's a CFINIT? No, I have only makefiles for MingW. =20 --gv =20

Sep 20 2003
→ "Charles Sanders" <sanders-consulting comcast.net> writes:
This is a hefty peice of code, in getdate.c they use YACC to do all their
work, hardcore C looks way different then hardcore C++!


"Gisle Vanem" <giva users.sourceforge.net> wrote in message
news:bkij2n$2t0c$1 digitaldaemon.com...
 "Charles Sanders" <sanders-consulting comcast.net> wrote:

 Sorry for all the responses :), but Im also having to manually change


 CFINIT's and other initliazers by hand, what do you usually do ?

What's a CFINIT? No, I have only makefiles for MingW. --gv

Sep 20 2003