NO

Author Topic: 9.0 RC3 - Polink errors with module definition files (*.def)  (Read 2170 times)

fryquez

  • Guest
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

Code: [Select]
POLINK: error: Unresolved external symbol 'SampleFunction' - referenced from '<common>'.
changing the export line in *.def

Code: [Select]
"MyExportFunction"=SampleFunction
to

Code: [Select]
"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".

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2115
Re: 9.0 RC3 - Polink errors with module definition files (*.def)
« Reply #1 on: July 19, 2018, 01:00:55 PM »
Also these problems exist with x86:
Code: [Select]
#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;
}
Code: [Select]
POLINK: error: Unresolved external symbol 'MessageBoxA' - referenced from '<common>'.
POLINK: fatal error: 1 unresolved external(s).
In x64 this line works
Code: [Select]
#pragma comment(linker, "-export:MessageBoxA=user32.MessageBoxA")
« Last Edit: July 19, 2018, 01:24:37 PM by TimoVJL »
May the source be with you