GCC compiler error: unrecognized option '--export-dynamic'

10,381

Solution 1

It seems the building scripts issue. --export-dynamic is a linker (ld in Unixes) option which could be useful in your case but it isn't gcc frontend option. All GCC versions I see have -rdynamic flag which causes passing of --export-dynamic to linker. So you can fix this with your own means (e.g. simply try to rename the option in makefile/etc.) and/or report the issue to maintainers.

Solution 2

Use gcc -rdynamic or -Wl,--export-dynamic (the -Wl tells to send the next suboption to ld ...)

Share:
10,381
johnfound
Author by

johnfound

My interests are mainly in assembly programming (FASM). Check some of my assembly projects: Fresh IDE - Visual RAD IDE and framework for assembly programming. Self-compilable. Allows writing of portable assembly programs. Has embedded FASM compiler. MiniMagAsm - Ultralight and fast CMS for small sites, written entirely in assembly language. Uses markdown-like markup language for article formatting. Portable for Windows and Linux (32 and 64 bit) web servers. AsmBB - Ultralight and very fast web forum engine, written in assembly language that use SQLite as a storage backend and FastCGI as communication protocol. phWeb - lightweight and fast web server for Windows, Linux and KolibriOS. (work in progress)

Updated on June 05, 2022

Comments

  • johnfound
    johnfound almost 2 years

    The context is the following: I am trying to compile InkscapeLite from sources in Linux Mint. At the end of the compilation, the last command is (some .o and .a files are replaced with "...", because the command is very long):

    gcc -g -O2 -o inkscape --export-dynamic inkscape.o inkscape-stock.o ... ./.libs/libinkscape.al dialogs/libspdialogs.a ... -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 /usr/lib/i386-linux-gnu/libcairo.so -lpango-1.0 -lfontconfig -lgobject-2.0 -lglib-2.0 /usr/lib/i386-linux-gnu/libart_lgpl_2.so /usr/lib/i386-linux-gnu/libxml2.so /usr/lib/i386-linux-gnu/libpopt.so -lpng -lXft -L/usr/lib/i386-linux-gnu /usr/lib/i386-linux-gnu/libfreetype.so -lz -Wl,--rpath -Wl,/usr/lib/i386-linux-gnu -Wl,--rpath -Wl,/usr/lib/i386-linux-gnu

    It fails with error: gcc: error: unrecognized option '--export-dynamic'

    What I have done is to replace --export-dynamic with -export-dynamic, just for test (notice, I am not C/C++ programmer and know nothing about GCC or any other C compiler) and executed the command manually in the console. The compilation ended without errors and the program works, but it misses almost all toolbar and menu icons (only some common icons are there as open/save/copy/paste...)

    Is it because of this problem option --export-dynamic or there is some different problem in the sources?

    BTW, the same program works normally in the Puppy Linux distributions.