You didn't specify -flto in your linker command line. Add that and try again.

https://gcc.gnu.org/wiki/LinkTimeOptimization

------------------                               
Best regards,
lh_mouse
2015-05-21

-------------------------------------------------------------
发件人:Etienne Sandré-Chardonnal <etienne.san...@m4x.org>
发送日期:2015-05-21 15:24
收件人:mingw-w64-public
抄送:
主题:Re: [Mingw-w64-public] Multiple definition issue with -flto,
 MinGW-w64 4.9.1

The gcc version is in the title (4.9.1), it is an official MinGW-w64
posix-seh build

The command line is like this (I have stripped several -D and -I command
line options, otherwise it is intact)

*Compiler:*
g++ -c -pipe -fno-keep-inline-dllexport -O3 -Wformat-nonliteral
-std=gnu++11 -mfpmath=sse -march=corei7-avx -mtune=corei7-avx -msse4 -mavx
-ftree-vectorize -fno-math-errno -funsafe-math-optimizations
-fno-trapping-math -fno-exceptions *-flto *-frtti -Wall -Wextra
-fexceptions -mthreads -o release\appparameters.o
..\..\ocean\source\appparameters.cpp

*Linker*
g++ -Wl,-s -Wl,-s -Wl,-subsystem,console -mthreads -o release\myapp.exe
object_script.myapp.Release -lglu32 -lopengl32 -lgdi32 -luser32 -lIlmImf
-lHalf -lIlmThread -lIex -lImath -lz -ldbghelp -lslapi
-LD:/Qt/Desktop/Qt/5.4.1/lib -lQt5Widgets -lQt5Gui -lQt5Network -lQt5Xml
-lQt5Concurrent -lQt5Core release\myapp_res.o

The script file only contains all the .o

Everything compiles & link fine without -flto

What g++ version were you using? What were the exact command lines you
used to build your program?
>
> ------------------                            
> Best regards,
> lh_mouse
> 2015-05-21
>
>


------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to