• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 686
  • Last Modified:

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?
0
longjumps
Asked:
longjumps
  • 2
  • 2
  • 2
1 Solution
 
Gerwin Jansen, EE MVETopic Advisor Commented:
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.
0
 
arnoldCommented:
Look within /etc/ld.so.conf. Make sure the rider of the paths is inthe search order you want.
1
2
3
.
.
.
0
 
Gerwin Jansen, EE MVETopic Advisor Commented:
@arnold - cygwin is Windows env. so why the /etc/ld.so.conf if I may ask>
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
arnoldCommented:
It tries to mimic Linux, you need to alter the search path, or statically compile the exe to rely on a library.
0
 
longjumpsAuthor Commented:
-L was wrong used in the command.
Since -L should provide only path to lib and not lib itself.

When deleting -L and link as is, my functions from my lib were executed and not libc.

gcc -o testprogram runtests.c /home/Semyon/work/src/regex/2.7/regex-2.7-src/src/.libs/libregex.a
0
 
longjumpsAuthor Commented:
I provide accurate solution. None of experts did this.
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 2
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now