News:

Download Pelles C here: http://www.smorgasbordet.com/pellesc/

Main Menu

mingw64 headers

Started by TimoVJL, April 08, 2014, 07:31:25 AM

Previous topic - Next topic

TimoVJL

mingw-w64 headers and libs are here
Quote/**
* This file has no copyright assigned and is placed in the Public Domain.
* This file is part of the w64 mingw-runtime package.
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
*/
def-files for import libraries are in folder mingw-w64-crt\lib32\ or mingw-w64-crt\lib64\
leading undescore is missing in 32-bit  def-files.

Addition to end of _mingw.h
#ifdef __POCC__
#ifdef _WIN64
  #define __x86_64__
  #define _AMD64_
  #define __unaligned
#else
  #define __i386__
  #define _X86_
#endif
#include <wchar.h>
#include <intrin.h>
#define __buildmemorybarrier() {unsigned char Barrier;__asm {}};
#endif /* __POCC__ */
__buildmemorybarrier() is still broken.
32 bit def-files need to modify.
Helper program here:#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <io.h>

int main(int argc, char **argv)
{
FILE *fi, *fo;
char buf[4096];

if (argc < 2)
{
printf("Usage:\n%s file\n", argv[0]);
return 1;
}

struct _finddata_t info;
intptr_t hf;
if ((hf = _findfirst(argv[1], &info)) != -1)
{
do
{
strcpy(buf, info.name);
strcat(buf, ".bak");
rename(info.name, buf);
if ((fi = fopen(buf, "r")) == NULL)
//if ((fi = fopen(info.name, "r")) == NULL)
{
fprintf(stderr, "can't open file '%s'\n", argv[1]);
return 1;
}
int iExp = 0;
//fo = stdout;
fo = fopen(info.name, "wt");
while (fgets(buf, sizeof(buf), fi))
{
if (!iExp && !strncmp(buf, "EXPORTS", 5))
{
iExp = 1;
fputs(buf, fo);
}
else
{
if (iExp && buf[0] != ';' && strchr(buf, '@')) // only stdcall
fputs("_", fo);
fputs(buf, fo);
}
}
if (fo != stdout)
fclose(fo);
fclose(fi);
} while (_findnext(hf, &info) == 0);
_findclose(hf);
}
return 0;
}
May the source be with you

CommonTater

Quote from: TimoVJL on April 08, 2014, 07:31:25 AM
mingw-w64 headers and libs are here
Quote/**
* This file has no copyright assigned and is placed in the Public Domain.
* This file is part of the w64 mingw-runtime package.
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
*/

Yes, they're in the public domain... but do they work?

MinGW and GCC use a lib format that I don't believe POLINK knows how to read.  But if the headers are useable, maybe we can do something to transform the libs.  Vortex has quite a few tools for this kind of thing, maybe he can help...

Vortex

Hi TimoVJL,

Polink will display a lot of error messages if you try use directly the MinGW import libraries. My method is to build module definition files from MinGW libraries and convert the .def files to MS COFF import libraries :

lib2def libkernel32.a
lib2def libuser32.a

type libkernel32.def | minised s/libkernel32/kernel32/ > kernel32.def
type libuser32.def | minised s/libuser32/user32/ > user32.def

\PellesC\Bin\polib.exe /OUT:kernel32a.lib /DEF:kernel32.def /MACHINE:x86
\PellesC\Bin\polib.exe /OUT:user32a.lib /DEF:user32.def /MACHINE:x86


MiniSed for Windows :

http://gnuwin32.sourceforge.net/packages/minised.htm

MinGW import libraries from :

http://sourceforge.net/projects/orwelldevcpp/files/

Dev-Cpp 5.6.2 MinGW 4.8.1 Portable.7z

The attached zip file contains a simple 32-bit Pelles C project built from the regenerated libraries.
Code it... That's all...