Hello there, do I need -flto when building a static lib?
Here is an example:

E:\Desktop>gcc foo.c -c -flto
E:\Desktop>ar rcs libfoo.a foo.o
E:\Desktop>gcc main.c -L. -lfoo -flto
C:\Users\LH_Mouse\AppData\Local\Temp\ccc30oDd.ltrans0.ltrans.o:ccc30oDd.ltrans0.o:(.text+0x1e):
 undefined reference to `foo'
collect2.exe: error: ld returned 1 exit status

Without those -flto options these commands worked just well.
Looking forward to you reply.

--------------
Best regards,
lh_mouse
2014-04-26

Attachment: main.c
Description: Binary data

Attachment: foo.c
Description: Binary data

------------------------------------------------------------------------------
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to