hi folks, one of the things that is causing the problem is -municode.




>________________________________
> From: Jim Michaels <[email protected]>
>To: Mingw64 Users <[email protected]> 
>Sent: Thursday, May 8, 2014 3:44 PM
>Subject: -console gone, some opt switches seem to force wWinMain
> 
>
>
>-console switch is gone, some optimization switches like 
>-ftree-parallelize-loops=4 -ftree-loop-vectorize -ftree-slp-vectorize 
>-floop-parallelize-all which must be combined with -O2 apparently, seem to 
>somehow require a WinMain. why is this? console programs are quite capable of 
>doing threads and making win32 calls and this should not be required.
>
>
>
>
>ib\libmingw32.a(lib64_libmingw32_a-crt0_w.o):crt0_w.c:(.text+0x18): undefined 
>reference to `wWinMain'
>collect2.exe: error: ld returned 1 exit status
>
>
>COLLECT_GCC=f:\x86_64-4.9.0-release-win32-seh-rt_v3-rev1\mingw64\bin\g++.exe
>COLLECT_LTO_WRAPPER=f:/x86_64-4.9.0-release-win32-seh-rt_v3-rev1/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/4.9.0/lto-wrapper.exe
>
>Target: x86_64-w64-mingw32 
>Thread model: win32
>gcc version 4.9.0 (x86_64-win32-seh-rev1, Built by MinGW-W64 
>project)COLLECT_GCC_OPTIONS='-v' '-save-temps'
 '-ftree-parallelize-loops=4' '-ftree-loop-vectorize' '-ftree-slp-vectorize' 
'-floop-parallelize-all' '-O2' '-m64' '-municode' '-static' 
'-fno-strict-aliasing' '-fwrapv' '-Wall' '-Wextra' '-std=c++11' '-o' 
'gcc-substr-bug.exe'
> '-mtune=core2' '-march=nocona' '-mthreads' '-pthread'
>
>code is
>
>#include <string>
>#include <iostream>
>int main(void) {
>    std::string searchIn="abc(<a href=\"def.html\">def</a>", searchFor="<a 
>href=\"",equals="=";
>    size_t posOpenElement=searchIn.find(searchFor); //should be 4
>    std::cout<<"posOpenElement="<<posOpenElement<<", should be 4"<<std::endl;
>    if
 (std::string::npos!=posOpenElement) {
>        size_t posEquals=searchIn.find(equals,posOpenElement + 
>searchFor.size());//should fail
>        std::cout<<"posEquals="<<posEquals<<", should be huge number 
>(-1)"<<std::endl;
>    }
>    return 0;
>}
>
>
>commandline is
>Thu 05/08/2014 
>15:36:58.22|d:\prj\tc-search\renumber-ids-2.0\tests|>"f:\x86_64-4.9.0-release-win32-seh-rt_v3-rev1\mingw64\bin\g++.exe"
> -Wall -Wextra -v -save-temps -ftree-parallelize-loops=4 -ftree-loop-vectorize 
>-ftree-slp-vectorize -floop-parallelize-all -O2 -m64 -municode -static 
>-fno-strict-aliasing -fwrapv -lstdc++ -lmingw32 -Wall -W -Wextra -Xlinker 
>-Map=gcc-substr-bug.map -std=c++11
 -o"gcc-substr-bug.exe" "gcc-substr-bug.cpp"          2>gcc-substr-bug.err
>
>on 64-bit windows 7.
>
>-------------
>Jim Michaels
>[email protected]
>[email protected]
>http://RenewalComputerServices.com
>http://JesusnJim.com (my personal site, has software)
>---
>IEC Units: Computer RAM & SSD measurements, microsoft disk size measurements 
>(note: they will say GB or MB or KB or TB when it is IEC Units!):
>[KiB] [MiB] [GiB] [TiB]
>[2^10B=1,024^1B=1KiB]
>[2^20B=1,024^2B=1,048,576B=1MiB]
>[2^30B=1,024^3B=1,073,741,824B=1GiB]
>[2^40B=1,024^4B=1,099,511,627,776B=1TiB]
>[2^50B=1,024^5B=1,125,899,906,842,624B=1PiB]
>SI Units: Hard disk industry disk size measurements:
>
>[kB] [MB] [GB] [TB]
>[10^3B=1,000B=1kB]
>[10^6B=1,000,000B=1MB]
>[10^9B=1,000,000,000B=1GB]
>[10^12B=1,000,000,000,000B=1TB]
>[10^15B=1,000,000,000,000,000B=1PB]
>
>
>
>
------------------------------------------------------------------------------
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
&#149; 3 signs your SCM is hindering your productivity
&#149; Requirements for releasing software faster
&#149; Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to