linking shared library

66 views
Skip to first unread message

yoges...@gmail.com

unread,
Feb 2, 2017, 10:26:33 AM2/2/17
to NAR Maven plugin
I am trying to create an c++ executable, with a set of libraries that need to be linked. I noticed that only some of the libraries get linked to the final executable and not rest. How can I resolve this such that all my libraries are linked against the executable.

Following is my linker tab. Library cmdenvd does not get linked to the final executable

https://gist.github.com/hodiapa/b32df2ff6d57466c8150547a0e028923


ldd executable results:

https://gist.github.com/hodiapa/9c2b20be85fbae92c1c2778fe5e04679


Any Suggestions as to how to link the missing shared library to the executable?

yoges...@gmail.com

unread,
Feb 2, 2017, 12:43:24 PM2/2/17
to NAR Maven plugin, yoges...@gmail.com
To add a followup question:

How does one pass LDFLAGS like options to the maven nar linker?
Specifically I would like to pass --no-as-needed option to the linker.

When I set :

<linker>
<name>${linker-name}</name>
<options>
<option>-Wl,-u,_cmdenv_lib </option>
<option>--no-as-needed -loppcmdenv</option>
...

I get error g++ "--no-as-needed" unrecognized command.

here is the relevant debug log:
https://gist.github.com/hodiapa/4edac7482a48139707189ce317b25de8

eyal...@gmail.com

unread,
Feb 6, 2017, 2:53:09 AM2/6/17
to NAR Maven plugin, yoges...@gmail.com
 <options>                           
                            <option>-Wl</option>
                            <option>-u</option>
<option>_cmdenv_lib</option>
<option>--no-as-needed</option>
<option>-loppcmdenv</option>
 
Eyal

בתאריך יום חמישי, 2 בפברואר 2017 בשעה 19:43:24 UTC+2, מאת yoges...@gmail.com:
Reply all
Reply to author
Forward
0 new messages