Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EClipse CDT/Juno and linker options --start-group

I know the -l and -L options for link but I am looking to set the --start-group and --end-group and all my libraries into my C project (Properties) under CDT/Juno but where do I put this option ???? -Xlinker ?

Thanks Marc

like image 270
user2140068 Avatar asked Oct 22 '22 15:10

user2140068


1 Answers

You can insert this options through "Expert settings: Command line patterns".
To insert the options -Wl,--start-group and -Wl,--end-group you can edit this field. Follow the steps below:

  1. Click in the option GCC C/C++ Linker
  2. Edit the field Command line pattern

from

${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}

to

 ${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} $(OBJS) -Wl,--start-group $(USER_OBJS) -Wl,--end-group $(LIBS)

Notice that we are open the variable ${INPUTS} that's equal INPUT="$(OBJS) $(USER_OBJS) $(LIBS)". Check the result in the makefile generated.

  1. Insert your static files in the section GCC C/C++ Linker -> Miscellaneous -> Other objects.
like image 138
Leandro dos Santos Avatar answered Oct 25 '22 19:10

Leandro dos Santos