Link to home
Start Free TrialLog in
Avatar of longjumps
longjumps

asked on

cywin - How to force my exe to use "regcomp" and "regexec" funcs from my lib and not libc?

I compiled library libregex.a and testprogram .exe in cywin.

gcc -o testprogram runtests.c -L/home/Semyon/work/src/regex/2.7/regex-2.7-src/src/.libs/libregex.a

Once I run "testprogram.exe" it takes functions "regcomp" and "regexec" from libc and not my compiled lib.

How to force "testprogram.exe" to take those functions from my lib libregex.a?
Avatar of Gerwin Jansen
Gerwin Jansen
Flag of Netherlands image

Can you try and put both the testprogram and your compiled library in the same folder and try then? If that doesn't work, try setting the PATH like this: set PATH=.\;%PATH% and try again. Put testprogram and library into your current folder.
Look within /etc/ld.so.conf. Make sure the rider of the paths is inthe search order you want.
1
2
3
.
.
.
@arnold - cygwin is Windows env. so why the /etc/ld.so.conf if I may ask>
It tries to mimic Linux, you need to alter the search path, or statically compile the exe to rely on a library.
ASKER CERTIFIED SOLUTION
Avatar of longjumps
longjumps

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of longjumps
longjumps

ASKER

I provide accurate solution. None of experts did this.