Pelles C forum

Pelles C => Bug reports => Topic started by: fryquez on July 19, 2018, 11:57:21 AM

Title: 9.0 RC3 - Polink errors with module definition files (*.def)
Post by: fryquez on July 19, 2018, 11:57:21 AM
To reproduce:

Creating a new Project with "Windows DLL Wizard" and check "Create module definition file for the linker (advanced)".



With x86 polink can resolve the import

POLINK: error: Unresolved external symbol 'SampleFunction' - referenced from '<common>'.

changing the export line in *.def

"MyExportFunction"=SampleFunction

to

"MyExportFunction"=_SampleFunction@8

it works all right.




With x64 it build without error, but in the export table of the dll, there is a "SampleFunction" instead of "MyExportFunction".
Title: Re: 9.0 RC3 - Polink errors with module definition files (*.def)
Post by: TimoVJL on July 19, 2018, 01:00:55 PM
Also these problems exist with x86:#define WIN32_LEAN_AND_MEAN
#include <windows.h>
//char * po_strstr(const char *string1, const char *string2);
//#pragma comment(linker, "-export:po_strstr=pocrt.strstr")
#pragma comment(linker, "-export:MessageBoxA=user32.MessageBoxA")
BOOL WINAPI _DllMainCRTStartup(HANDLE hInstDLL, DWORD dwReason, LPVOID lpvReserved)
{
return 1;
}
POLINK: error: Unresolved external symbol 'MessageBoxA' - referenced from '<common>'.
POLINK: fatal error: 1 unresolved external(s).

In x64 this line works#pragma comment(linker, "-export:MessageBoxA=user32.MessageBoxA")