POLINK: warning: Realigned section '.idata$2' in object (from 4 to 1 byte(s)).

Started by Quin, June 27, 2024, 01:55:02 PM

Previous topic - Next topic

Quin

Thanks, $pragma lib worked, and also thanks for all the Pelles C info! :)

MrBcx

Quote from: Quin on June 27, 2024, 01:55:02 PM
I'm trying to link against a .lib file (more specifically Tolk.lib, a screen reader abstraction library). It all works, but every time I compile, I get that warning. Is there a way to disable/prevent it?


Ref: https://forum.pellesc.de/index.php?topic=9989.0

Pelle said this in 2021 on his forum:


The realigned warning was added to version 10. It was added because the alignments changed in POLINK (to account for X64 machines, among other things). This is an informational warning, unlike some other warnings, but there are no warning levels in POLINK and no way to disable a warning. I have no plans to change this.  The easy "fix" is to rebuild your import library with version 10.

Quote

While we're on the subject, is there a way to make a particular project remember what files I want to link against it? When I press f5, there's an edit field, but that doesn't seem to stay for the current project if you change it somewhere else.


One thing you can use is the $PRAGMA directive from inside your BCX file. 

For example, here is a snippet from one of the BCX Darkmode experiments:


FUNCTION InitDarkMode(hWnd AS HWND)
    #include <uxtheme.h>
    #include <dwmapi.h>

    $PRAGMA comment(lib, "uxtheme.lib")   ' This format works with MSVC and Pelles C
    $PRAGMA comment(lib, "Dwmapi.lib")    '                   Ditto


Add path information to the .lib's, if not in the CWD.

Vortex


Quin

I'm trying to link against a .lib file (more specifically Tolk.lib, a screen reader abstraction library). It all works, but every time I compile, I get that warning. Is there a way to disable/prevent it?

While we're on the subject, is there a way to make a particular project remember what files I want to link against it? When I press f5, there's an edit field, but that doesn't seem to stay for the current project if you change it somewhere else.