here is repro code.
#include <iostream>
#include <Windows.h>
#include <ShlObj.h>
#include <WinCon.h>
#include <string>
int main(void) {
HWND hwndOwner=GetConsoleWindow();
std::string unc="\\\\.\\C:";
std::wstring wunc;
wunc.assign(unc.begin(),unc.end());
bool bsuccess=0!=SHValidateUNC(hwndOwner, (wchar_t*)wunc.c_str(),
VALIDATEUNC_NOUI);
std::cout<<bsuccess<<std::endl;
return 0;
}
On , Jim Michaels <[email protected]> wrote:
you are right, just found this out. I have to compile with -lshell32 -lkernel32
-lshlwapi -lstdc++
>however... it still does not link with 32-bit versions of either the posix or
>win32 sjlj compiler.
>
>it gives me that
>build-bug1.o:build-bug1.cpp:(.text.startup+0x1b0): undefined reference to
>`_imp__SHValidateUNC@12'
>collect2.exe: error: ld returned 1 exit status
>
>perhaps the DLL Imports or the .def file (whatever) were not correctly coded
>for that library?
>
>
>
>
>
>
>On Wednesday, November 27, 2013 10:45 PM, niXman <[email protected]>
>wrote:
>
>Jim Michaels писал 2013-11-28 08:48:
>>
>>> d:\i686-4.8.2-release-win32-sjlj-rt_v3-rev0\mingw32\bin\g++.exe
>>> -Wall -Wextra -v -save-temps -Xlinker -Map=32\df.32.map -Ofast
>>> -std=c++11 -s -isystem /libpq/ -isystem /libpq/server/libpq/
>>> -isystem /prj/fltk/fltk-2.0.x-alpha-r9042/ -isystem
>>> /prj/fltk/fltk-2.0.x-alpha-r9042/lib/ -isystem /prj/zlib-1.2.5/
>>> -isystem /prj/boost/boost32 -o 32\df.exe df.cpp prsinum.cpp
>>> atoi64.cpp strfuncs.cpp
>>>
32\df.manifest.res -lshlwapi
>>> -lkernel32 -lstdc++ 2>32\errgw32df
>>>
>>> is my command line. I am suspecting there is something wrong with my
>>> commandline.
>>>
>>>
>>> this commandline works for 64-bit:
>>> d:\x86_64-4.8.2-release-win32-sjlj-rt_v3-rev0\mingw64\bin\g++.exe
>>> -Wall -Wextra -v -save-temps -Xlinker -Map=64\df.64.map -Ofast
>>> -std=c++11 -s -isystem /libpq/ -isystem /libpq/server/libpq/
>>> -isystem /prj/fltk/fltk-2.0.x-alpha-r9042/ -isystem
>>> /prj/fltk/fltk-2.0.x-alpha-r9042/lib/ -isystem /prj/zlib-1.2.5/
>>> -isystem /prj/boost/boost64 -o 64\df.exe df.cpp prsinum.cpp
>>> atoi64.cpp strfuncs.cpp
>>> 64\df.manifest.res -lshlwapi
>>> -lkernel32 -lstdc++ 2>64\errgw64df
>>>
>>> but they are exactly the same with the exception of the g++ path and
>>> the destination of the exe!
>>>
>>> I am suspecting there is a problem with the mingw-builds
>>> i686-4.8.2-release-win32-sjlj-rt_v3-rev0. it won't link its own
>>> shlwapi library. here is the only
error message.
>>>
>>>
>>> d:/i686-4.8.2-release-win32-sjlj-rt_v3-rev0/mingw32/bin/../libexec/gcc/i686-w64-mingw32/4.8.2/collect2.exe
>>> --sysroot=C:/Temp/msys64/tmp/i686-482-win32-sjlj-rt_v3-r0/mingw32 -m
>>> i386pe -Bdynamic -o 32\df.exe -s
>>> d:/i686-4.8.2-release-win32-sjlj-rt_v3-rev0/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib/crt2.o
>>> d:/i686-4.8.2-release-win32-sjlj-rt_v3-rev0/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/crtbegin.o
>>> -Ld:/i686-4.8.2-release-win32-sjlj-rt_v3-rev0/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.8.2
>>> -Ld:/i686-4.8.2-release-win32-sjlj-rt_v3-rev0/mingw32/bin/../lib/gcc
>>> -Ld:/i686-4.8.2-release-win32-sjlj-rt_v3-rev0/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib
>>> -Ld:/i686-4.8.2-release-win32-sjlj-rt_v3-rev0/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../lib
>>>
>>> -Ld:/i686-4.8.2-release-win32-sjlj-rt_v3-rev0/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib
>>> -Ld:/i686-4.8.2-release-win32-sjlj-rt_v3-rev0/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../..
>>> -Map=32\df.32.map df.o prsinum.o atoi64.o strfuncs.o
>>> 32\df.manifest.res -lshlwapi -lkernel32 -lstdc++ -lstdc++ -lmingw32
>>> -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt -ladvapi32 -lshell32
>>> -luser32 -lkernel32 -liconv -lmingw32 -lgcc_s -lgcc -lmoldname
>>> -lmingwex -lmsvcrt
>>> d:/i686-4.8.2-release-win32-sjlj-rt_v3-rev0/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/crtfastmath.o
>>>
d:/i686-4.8.2-release-win32-sjlj-rt_v3-rev0/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/crtend.o
>>> df.o:df.cpp:(.text+0x2a01): undefined reference to
>>> `_imp__SHValidateUNC@12'
>>> collect2.exe: error: ld returned 1 exit status
>>>
>>> what do I do?
>>>
>>> I need something that will compile my program for both 32 and 64-bit
>>> targets.
>>>
>>> am going to try the posix-threads version in the meantime if avaiable
>>> in both...
>>
>>Hmm... Symbol SHValidateUNC is not exists in lib32/shell32.def, but
>>exists in lib64/shell32.def.
>>These two files are very different. The list of exported symbols
really
>>so different for win32 and win64?
>>
>>
>>--
>>Regards, niXman
>>___________________________________________________
>>Dual-target(32 & 64-bit) MinGW-W64 compilers for 32 and 64-bit Windows:
>>http://sourceforge.net/projects/mingw-w64/
>>___________________________________________________
>>Another online IDE: http://liveworkspace.org/
>>
>>------------------------------------------------------------------------------
>>Rapidly troubleshoot problems before they affect your business. Most IT
>>organizations don't have a clear picture of how application performance
>>affects their
revenue. With AppDynamics, you get 100% visibility into your
>>Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
>>http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk
>>_______________________________________________
>>Mingw-w64-public mailing list
>>[email protected]
>>https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
>>
>>
>>
>>
>
>
------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public