package main
func main() {
print("hello\n")
}
and runtime pkg with GOOS=mingw.
Build completes without any errors, resulting executable runs on
windows, but it doesn't print my "hello\n", just exits.
Looking in the runtime code for mingw, I can see, that it searches for
entry points to some Windows system dlls, but the exe itself doesn't
have them (import table is missing).
Isn't generated PE exe supposed to have dll entries?
Am I missing something here?
I suspect it is something "to be done". If that's the case, are there
any other things to overcome?
Thank you for your comments
Alex
After some head banging, I have discovered, that my exe runs fine on
WinXP, but not on Win2000.
It seems, (the only reference on the Internet I can find is
http://www.phreedom.org/solar/code/tinype/) that WinXP PE loader is
smart enough to load kernel32.dll automatically. On the other hand,
Win2000 needs all imported functions explicitly listed in PE import
table.
So, if we want Win2000 supported, it looks like we need to generate
import table.
Alex
On Jan 21, 4:15 am, Alex Brainman <alex.brain...@gmail.com> wrote:
> > Isn't generated PE exe supposed to have dll entries?
>
> After some head banging, I have discovered, that my exe runs fine on
> WinXP, but not on Win2000.
>
> It seems, (the only reference on the Internet I can find ishttp://www.phreedom.org/solar/code/tinype/) that WinXP PE loader is
Don't waste your time. I'll be away for a week, when back, I'll try to
tackle it. (I haven't done anything like that before, but I'll have a
go).
I believe, your trick with not providing import table will only work
for kernel32.dll, but not other dlls..
I think, better way to approach this is to import LoadLibrary and
GetProcAddress and then use these to load others during runtime.
Alex
On Jan 22, 9:45 am, Hector <hector...@gmail.com> wrote:
> LOL, I'm tempted to say screw Win2k...
>
I've made the change and it seems to be working OK on my Win2k. Should
I send it to you to have a look? There are only 2 files changed pe.c
and pe.h.
Alex