Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 504204 - x11-libs/wxGTK- - x86_64-pc-linux-gnu-ranlib: /usr/lib64/crt1.o: In function `_start': (.text+0x20): undefined reference to `main'
Summary: x11-libs/wxGTK- - x86_64-pc-linux-gnu-ranlib: /usr/lib64/crt1.o: In fu...
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: AMD64 Linux
: Normal normal with 2 votes (vote)
Assignee: Gentoo wxWidgets Herd
Depends on:
Reported: 2014-03-11 13:22 UTC by Christian
Modified: 2022-05-10 19:48 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---

complete build.log (build.log,277.55 KB, text/plain)
2014-03-11 13:22 UTC, Christian
emerge -info (,21.04 KB, text/plain)
2014-03-11 13:23 UTC, Christian

Note You need to log in before you can comment on or make changes to this bug.
Description Christian 2014-03-11 13:22:17 UTC
I can't compile wxGTK- because of this undefined reference to main.
the relevant part is this, I think:

/var/tmp/portage/x11-libs/wxGTK- ./.pch/wxprec_basedll/wx/wxprec.h.gch wx/wxprec.h x86_64-pc-linux-gnu-g++ -I./.pch/wxprec_basedll -D__WXGTK__      -DWXBUILDING      -I/var/tmp/portage/x11-libs/wxGTK-  -DwxUSE_GUI=0 -DWXMAKINGDLL_BASE -DwxUSE_BASE=1 -fPIC -DPIC -Wall -Wundef -Wunused-parameter -Wno-ctor-dtor-privacy -Woverloaded-virtual -D_FILE_OFFSET_BITS=64 -I/var/tmp/portage/x11-libs/wxGTK- -I/var/tmp/portage/x11-libs/wxGTK- -D_REENTRANT -pthread -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/directfb -I/usr/include/libdrm -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/X11R6/include -DWX_PRECOMP -pthread -pthread -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -D_REENTRANT -pthread -I/usr/include/gtk-unix-print-2.0 -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/directfb -I/usr/include/libdrm -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -O2 -pipe -fomit-frame-pointer -march=native -Wl,-O1 -Wl,--as-needed -fvisibility=hidden -fvisibility-inlines-hidden
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/../../../../lib64/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status
Makefile:15504: recipe for target '.pch/wxprec_basedll/wx/wxprec.h.gch' failed
make: *** [.pch/wxprec_basedll/wx/wxprec.h.gch] Error 1

Reproducible: Always
Comment 1 Christian 2014-03-11 13:22:50 UTC
Created attachment 372376 [details]
complete build.log
Comment 2 Christian 2014-03-11 13:23:46 UTC
Created attachment 372378 [details]
emerge -info
Comment 3 Rick Harris 2015-07-16 05:34:54 UTC
Me too!

Removing '-Wl,-O1' from CXXFLAGS fixes this for me.
Comment 4 . 2015-10-10 11:50:18 UTC
(In reply to Rick Harris from comment #3)
> Me too!
> Removing '-Wl,-O1' from CXXFLAGS fixes this for me.

Yes, I can confirm this resolves the issue. Thanks.

P.S. In my case those flags were introduced into CXXFLAGS by portage-bashrc-mv.
Comment 5 throwd 2019-06-21 02:37:28 UTC
I still run into this issue for x11-libs/wxGTK-3.0.4-r300

It's not clear how I'm supposed to remove '-Wl,-O1' from the CXXFLAGS since I'm not adding it via make.conf.