Pelles C forum

Pelles C => General discussions => Topic started by: CommonTater on August 21, 2012, 10:32:44 PM

Title: Documentaton .... headers and libs...
Post by: CommonTater on August 21, 2012, 10:32:44 PM
If you look at the attached screencap, you will see that Pelles C supplies only a small subset of the headers and libs available in the windows SDK... so 3 questions...
 
1) Is there any documentation available to show what is and isn't included?
2) Is there any effort made for translating/implementing the missing parts?
3) Can Pelles C use the windows sdk headers and libs directly?
Title: Re: Documentaton .... headers and libs...
Post by: frankie on August 22, 2012, 10:01:26 AM
The size is not a valid indication. Pelle removed tons of comments from headers, which become lighter. Moreover MS SDK contains libs and headers for MFC, ATL,  other C++ headers, etc .
I don't know if a detailed list of what is included and what is not exists. I'm sure that the almost everything related to C programming is included.
As general rule you can use SDK header directly at expense of some PellesC special or added functions.
Linking with MSVC library should remove other problems.
Title: Re: Documentaton .... headers and libs...
Post by: CommonTater on August 22, 2012, 11:19:42 AM
The size is not a valid indication. Pelle removed tons of comments from headers, which become lighter. Moreover MS SDK contains libs and headers for MFC, ATL,  other C++ headers, etc .

I was looking more at the file counts than sizes... 1,914 vs 516 includes... if we write half of that off to C++ headers, we still have almost 500 more headers in the SDK ... similar math applies for libs... leaving me to ponder exactly what isn't included.

Quote
I don't know if a detailed list of what is included and what is not exists. I'm sure that the almost everything related to C programming is included.

COM support is very limited. Direct X is not there. DShow (and related) is not there.  But what else?
A detailed list would be nice.

Quote
As general rule you can use SDK header directly at expense of some PellesC special or added functions.
Linking with MSVC library should remove other problems.

I'm going to have to give this a better try than I did... the first attempt was something of a failure, leaving me with the always enjoyable "More than 100 errors, please improve yourself" report from the compiler. :D

Thing is... It would be nice if people could upload any conversions they've done into the User Contributions area.  The upload limit has been increased to 1024K, so most things should fit.
 
Title: Re: Documentaton .... headers and libs...
Post by: TimoVJL on August 22, 2012, 12:46:24 PM
If you search words 'extern "C" {'

Windows SDK 6.0a 342 files
Windows SDK 7.0  366 files
Windows SDK 7.1  366 files
Title: Re: Documentaton .... headers and libs...
Post by: CommonTater on August 22, 2012, 03:45:16 PM
If you search words 'extern "C" {'

Windows SDK 6.0a 342 files
Windows SDK 7.0  366 files
Windows SDK 7.1  366 files


As I understood it, the "extern C" thing was so C++ would see them as "old style" headers... or am I missing the significance of it?

Title: Re: Documentaton .... headers and libs...
Post by: frankie on August 22, 2012, 03:52:26 PM
That are 'C' headers, or 'native programming API' as MS call it now.
 'extern "C" {' instructs C++ compiler about the plain 'C' content of the header.

DirectX has never been in the distribution, DShow is relatively recent   ::)
Anyway the direct include should work fine.
Title: Re: Documentaton .... headers and libs...
Post by: CommonTater on August 22, 2012, 04:04:34 PM
That are 'C' headers, or 'native programming API' as MS call it now.
 'extern "C" {' instructs C++ compiler about the plain 'C' content of the header.

DirectX has never been in the distribution, DShow is relatively recent   ::)
Anyway the direct include should work fine.

Maybe I'm jinxed or something but I just spent an hour trying to get "Hello Windows" to run using the SDK headers and libs... I'm still getting floods of errors ...  :o
 
Code: [Select]
#include <windows.h>

int WINAPI WinMain(HINSTANCE hinst, HINSTANCE pinst, LPTSTR cmdl, int show)
  {
    MessageBox(NULL,"HELLO from Windows","Wow",MB_OK);
    return 0;
  }

Seroiusly... It bombs out at the "more than 100 errors message" no matter what I do and all the errors originate in the headers...
 
FWIW... Direct Show has been around since at least Win2000 ... Maybe even before.  It became part of the SDK (instead of DirectX) about 6 or 7 years ago.
 
Title: Re: Documentaton .... headers and libs...
Post by: TimoVJL on August 22, 2012, 04:37:21 PM
With WDK 7600.16385.win7_wdk.100208-1538 you can compile this
http://www.microsoft.com/en-us/download/details.aspx?id=11800 (http://www.microsoft.com/en-us/download/details.aspx?id=11800)
Code: [Select]
#define WIN32_LEAN_AND_MEAN
#include <windows.h>

#pragma nodefaultlib
#pragma comment(lib, "msvcrt")

int WINAPI WinMain(HINSTANCE hinst, HINSTANCE pinst, LPTSTR cmdl, int show)
{
MessageBox(NULL, "HELLO from Windows", "Wow", MB_OK);
return 0;
}
Title: Re: Documentaton .... headers and libs...
Post by: CommonTater on August 22, 2012, 09:04:50 PM
With WDK 7600.16385.win7_wdk.100208-1538 you can compile this
http://www.microsoft.com/en-us/download/details.aspx?id=11800 (http://www.microsoft.com/en-us/download/details.aspx?id=11800)
Code: [Select]
#define WIN32_LEAN_AND_MEAN
#include <windows.h>

#pragma nodefaultlib
#pragma comment(lib, "msvcrt")

int WINAPI WinMain(HINSTANCE hinst, HINSTANCE pinst, LPTSTR cmdl, int show)
{
MessageBox(NULL, "HELLO from Windows", "Wow", MB_OK);
return 0;
}

Thanks Timo... I've got some free time tonight and will give it a try.
Title: Re: Documentaton .... headers and libs...
Post by: CommonTater on August 23, 2012, 03:50:35 PM
Well, I got some very basic 32 bit code to compile using the SDK's headers and libs. However 64 bit code still dumps a ton of errors as does anything more complex than the "hello windows" example.  It is apparent that considerable work has gone into the headers and libs included with Pelles C (Thank you Pelle!).

So... back to square one... trying to figure out what's what and puzzling what I have to do to get the missing stuff working...
Title: Re: Documentaton .... headers and libs...
Post by: TimoVJL on August 23, 2012, 05:24:17 PM
Quick test with SDK v7.0.
I just insert wchar.h before windows.h
Code: [Select]
#define WIN32_LEAN_AND_MEAN
#include <wchar.h> // from PellesC include
#include <windows.h>
#include <commctrl.h>
#include <commdlg.h>
...
or define __STRALIGN_H_
and build some projects both to 32 and 64 bit.
Title: Re: Documentaton .... headers and libs...
Post by: CommonTater on August 23, 2012, 06:19:00 PM
Quick test with SDK v7.0.
I just insert wchar.h before windows.h
Code: [Select]
#define WIN32_LEAN_AND_MEAN
#include <wchar.h> // from PellesC include
#include <windows.h>
#include <commctrl.h>
#include <commdlg.h>
...
or define __STRALIGN_H_
and build some projects both to 32 and 64 bit.

Ok, tried that and it seems to work on simple things but adding in networking and other functions just makes it bomb out again...

Title: Re: Documentaton .... headers and libs...
Post by: frankie on August 24, 2012, 11:14:59 AM
I don't have time to check myself, but I think that the problem is simply related to MS compiler predefined symbols.
To use SDK that symbols have to be defined.
PellesC defines its own symbols that are compatible with revised PellesC headers.
I don't see any other reason for which it should not work.
Title: Re: Documentaton .... headers and libs...
Post by: CommonTater on August 24, 2012, 04:49:21 PM
Hi Frankie...
The only thing I can find on preprocessor macros is this... http://msdn.microsoft.com/en-us/library/aa383745 (http://msdn.microsoft.com/en-us/library/aa383745) and it's not much help at all.

Quote
I don't see any other reason for which it should not work.

Neither did I when I first tried this...
 
Oh well... I've now spent most of a week on this and gotten no closer to a solution. 
 
I do hope my frustration hasn't been too apparent in all this...
I just seem to be running into roadblocks everwhere I go and to be honest it's starting to really piss me off.
 
It's like this... ... and just lately I've been thinking about packing the whole thing in.

I need a vacation!

 
Title: Re: Documentaton .... headers and libs...
Post by: frankie on August 24, 2012, 05:09:34 PM
Thanks God it's Friday!!!   ;D
Let talk about next monday......  8)
Title: Re: Documentaton .... headers and libs...
Post by: CommonTater on August 24, 2012, 09:51:37 PM
LOL... there's a song about that too...

http://www.youtube.com/watch?v=8yteMugRAc0
Title: Re: Documentaton .... headers and libs...
Post by: TimoVJL on August 25, 2012, 08:28:42 AM
Here is include file lists from PellesC 7 and SDK v7.0 in WinMerge report in html format.
Title: Re: Documentaton .... headers and libs...
Post by: CommonTater on August 25, 2012, 01:25:36 PM
Thanks Timo...
Title: Re: Documentaton .... headers and libs...
Post by: CommonTater on August 29, 2012, 04:55:17 PM
Ok... my solution to this problem, for the time being, is to decline the contract.  (Hey it happens   :'(  )
 
I would, still encourage anyone who's converted headers and libs of any kind for use with Pelles C to upload them in the User Contributions area.