Click here to Skip to main content
15,883,829 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, this might be a silly question, but I need to know if for the code below, if i can extract the cvCaptureFromCAM() function from the highgui.lib and paste it in my code so that I can rename it to camcapture() and then call that within my program without just including the highgui library file at the beginning of the code file:

<br />
CvCapture * pCapture = 0;<br />
<br />
<br />
//Initialize video capture<br />
pCapture = cvCaptureFromCAM( CV_CAP_ANY );



Many Thanks
Posted

Libraries are compiled so you won't be able to get the source code for a function out of one.

I have no idea what you're trying to do and why but one way of effectively renamining a function is to implement a small shim function that doesn't do a lot - it just calls another function. However you'll also need to wrap any types it returns in other classes or abstract data types otherwise you'll spend the rest of your life casting.

So my advice would be suck it up - just include the header and link with the library, it's less pain in the long run.

Ash
 
Share this answer
 
Comments
Sauro Viti 22-Jul-10 9:45am    
OpenCV is an open-source library, then he could get the source code and extract some functions, but I think that it is absolutely not a good idea
Aescleal 22-Jul-10 12:28pm    
Cool, didn't know that. From the original post I assumed he had a binary lib and wanted to decompile it.
Note that OpenCV was born in Intel, but now has been released to the open-source community.

Said that, technically you can simply get the source code and extract what you want, but you should think about license infringements!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900