To clarify the clarification: I know how to create libraries in Xcode using either obj-c or swift. I know how to use these in projects. I know how to compile these projects so everything works. What I do not know is how to take open source C source code (hehe) and build/make/compile it into a library.
Just to clarify everything below: I am looking for a way to use c libraries in a Swift application, this means using Xcode. The c libraries do no have to be build with/in Xcode, I am fine with using other tools.
I normally write all the code I use myself and unfortunately I only write Swift in Xcode. So I am a little behind on using frameworks/libraries. Now I really want to explore Tesseract OCR and I am having trouble building the libraries needed. To me it is better to really understand how this works and be able to do this myself and not just look on Github and find pre-compiled sources.
The projects below both handle this differently. The iOS version uses precompiled Libraries. (.a file) The OSX version uses projects that contain the library files (not yet compiled).
libjpeg example of a library that can't be just dragged and dropped.
Using brew will only install it as a command line tool, not generate a lib.
install Tesseract with homebrew
The problem I have is that I know too little about these c libraries, and how to build them to even google this effectively.
My question:
- How do you compile/build the c code into an .a file?
- How do you create an xcode project that builds a framework based on the c code? (optional)
- What is the right vocabulary for all this?
I am not looking for a Tesseract specific answer. I want to learn how to do this myself.
This article doesn't mention how to actually add the c program and let xcode make it. The part about workspaces is interesting though.
Article on building c project in Xcode
This one is actually really relevant. However I can't find the executable in Tesseract for example. All options are greyed out when doing step 5.
This looks pretty : simple c++ procect Why can't tesseract look like that? :)