Solved

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

Posted on 2013-01-12
6
640 Views
Last Modified: 2013-11-15
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
Comment
Question by:longjumps
  • 2
  • 2
  • 2
6 Comments
 
LVL 38

Expert Comment

by:Gerwin Jansen, EE MVE
ID: 38771961
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
 
LVL 77

Expert Comment

by:arnold
ID: 38772057
Look within /etc/ld.so.conf. Make sure the rider of the paths is inthe search order you want.
1
2
3
.
.
.
0
 
LVL 38

Expert Comment

by:Gerwin Jansen, EE MVE
ID: 38772188
@arnold - cygwin is Windows env. so why the /etc/ld.so.conf if I may ask>
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
LVL 77

Expert Comment

by:arnold
ID: 38772226
It tries to mimic Linux, you need to alter the search path, or statically compile the exe to rely on a library.
0
 
LVL 1

Accepted Solution

by:
longjumps earned 0 total points
ID: 38777188
-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
 
LVL 1

Author Closing Comment

by:longjumps
ID: 38796111
I provide accurate solution. None of experts did this.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
cannot rename datastore 3 72
trouble on installing syslog-ng on CentOS 7 7 60
Disabling security updates Ubuntu 3 33
Need public domain maps 3 19
If your app took Google’s lash recently, here are the 5 most likely reasons.
The article will include the best Data Recovery Tools along with their Features, Capabilities, and their Download Links. Hope you’ll enjoy it and will choose the one as required by you.
Using Adobe Premiere Pro, the viewer will learn how to set up a sequence with proper settings, importing pictures, rendering, and exporting the finished product.
The viewer will learn how to successfully download and install the SARDU utility on Windows 8, without downloading adware.

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question