LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   compiling code resulting in: 'unrecognized command line "-fstart-group"' (https://www.linuxquestions.org/questions/programming-9/compiling-code-resulting-in-unrecognized-command-line-fstart-group-641916/)

freeindy 05-13-2008 11:42 AM

compiling code resulting in: 'unrecognized command line "-fstart-group"'
 
Hi,

I'm running gcc version 3.4.3 on a Red Hat linux EL4.

I enter the follwing command (or actually wrote a Makefile):

Code:

/home/builder/montavista/cge/devkit/x86/pentium4/bin/pentium4-gcc -o -Wall -DLINUX_LIB  polyposix.cxx -o polyposix.o -I/home/insi/platform/element-org/include/ -I/home/insi/platform/element-org/include/linux -I/home/insi/platform/element-org/lib/linux-mvcge401-pl1337-x86 -I/home/insi/platform/element-org/ref_platforms/kontron/callouts/lib/linux-mvcge401-pl1337-x86 -I/home/insi/platform/poly7.1/include -Wl, --start-group -lelem_core_api -lelem_amf_api -llinx -lelem_ais_api -element_callouts -Wl, --end-group -lstdc++ -lrt -lnsl -lexpat
cc1plus: error: unrecognized command line option "-fstart-group"
cc1plus: error: unrecognized command line option "-fend-group"

I can't find the error or the meaning of the error. Anybody have a clue?

Thanks
Indy

colucix 05-13-2008 01:58 PM

It states that the --start-group and --end-group are treated as gcc options (hence the prefix -f in the error message) but they are not recognized, since they are linker options. For this reason you use the -Wl, option to specify they have to be passed to the linker.

The problem here is simply the syntax: do not put a space between -Wl, and --start-group. It should be:
Code:

-Wl,--start-group .......... -Wl,--end-group
Strip out extra spaces and the trick is done.

freeindy 05-14-2008 01:28 AM

Thanks Colucix.

That was just it. Cheers.

Indy


All times are GMT -5. The time now is 11:50 AM.