Hi Bob,

I've little experience with helping other people on this forum. When I have 
a program in which I would need the Windows API. I do include windows.h in 
the source file and have the following list of Windows API libraries on the 
link command line.

-l:libkernel32.a -l:libuser32.a -l:libshell32.a -l:libadvapi32.a\
-l:libws2_32.a -l:liboleaut32.a -l:libimm32.a -l:libwinmm.a -l:libole32.a\
-l:libuuid.a -l:libopengl32.a -l:libole32.a -l:libgdi32.a -l:libcomdlg32.a

I do believe the function GetSaveFileNameW would need other Windows API 
libraries to be able to do it's job. Are you willing to try this?

Kind regards,
Maarten Verhage


----- Original Message ----- 
From: "Sailor Bob via Mingw-w64-public" 
<mingw-w64-public@lists.sourceforge.net>
To: <mingw-w64-public@lists.sourceforge.net>
Cc: "Sailor Bob" <sailorbob74...@yahoo.com>
Sent: Tuesday, January 08, 2019 18:29
Subject: [Mingw-w64-public] Linking fails for GetSaveFileName when cross 
compiling with MinGW


>
> I'm trying to compile a modified version of UniLogger on Ubuntu 18.04 
> using mingw. I'm getting the following link error:
>
> undefined reference to '_imp__GetSaveFileNameW@4'
>
> I found this post on the MinGW mailing list saying one needs to explicitly 
> link to comdlg32 so I tried that also:
>
> i686-w64-mingw32-g++ -municode -o unilogger.exe -lcomdlg32 Source.cpp
>
> But still got the same error, as did the person asking in the post.
>
> https://sourceforge.net/p/mingw-w64/mailman/message/34523082/
>
> He and I both verified the presence of the function in the lib file:
>
> nm /usr/i686-w64-mingw32/lib/libcomdlg32.a
>
> libcomdlg32s00012.o:
> 00000000 b .bss
> 00000000 d .data
> 00000000 T _GetSaveFileNameW@4
> U head_lib32_libcomdlg32_a
> 00000000 i .idata$4
> 00000000 i .idata$5
> 00000000 i .idata$6
> 00000000 i .idata$7
> 00000000 I imp__GetSaveFileNameW@4
> 00000000 t .text
>
> libcomdlg32s00011.o:
> 00000000 b .bss
> 00000000 d .data
> 00000000 T _GetSaveFileNameA@4
> U head_lib32_libcomdlg32_a
> 00000000 i .idata$4
> 00000000 i .idata$5
> 00000000 i .idata$6
> 00000000 i .idata$7
> 00000000 I imp__GetSaveFileNameA@4
> 00000000 t .text
> I'm at a bit of a loss at this point.
> _______________________________________________
> Mingw-w64-public mailing list
> Mingw-w64-public@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public 



_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to