hpcc-systems/HPCC-Platform — Issue #1499: #OPTION('linkOptions',xxx) does not output correct arguments
Author: vasiloglou
Created: 2012-02-09 13:02:56+00:00
State: open

Here is what I used:
[code]#OPTION('linkOptions', ' -LMyPath -lmylib ');
[/code]

And here is what eclcc generated:
[code]"/usr/bin/g++" -L. -Wl,-E -fPIC -pipe -O0 -L/opt/HPCCSystems/lib -Wl,-rpath -Wl,/opt/HPCCSystems/lib -LMyPath -lmylib "a.out.o" -leclrtl -la.out.res.o -lhthor -o "a.out"[/code]

But that is incorrect, it will not do the linking properly and for that reason the linker fails.
This is because all the libraries must be appended after a.out.o
So the correct one is this:

[code]"/usr/bin/g++" -L. -Wl,-E -fPIC -pipe -O0 -L/opt/HPCCSystems/lib -Wl,-rpath -Wl,/opt/HPCCSystems/lib "a.out.o" -LMyPath -lmylib -leclrtl -la.out.res.o -lhthor -o "a.out"[/code]

Can we get a fix on that?