New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
example usage as a static library? #7
Comments
I just pushed up 76e2038 which includes a static library build of Argument Parser. If you were to do this yourself, what you would do is add the source files for ArgumentParser and CoreParse to your project and ensure that you add the Let me know if you have any further questions! |
you rock! |
:) |
noob question n2: shouldn't the static library have a header file also? |
In this case, the header file will be |
you say I should copy all header files from your library (22 headers) onto my project? and the CoreParse files? I'm heavily lost :( |
So when you build the static library it produces Therefore, once you build the A slightly easier approach is to drag the ArgumentParser Xcode project into your own project and then mark the static library target as a dependency of your own build target. That's a little Xcode-specific, however, and therefore you're probably better served finding a tutorial for it. A quick Bing search revealed that Apple has a tutorial, though depending on your level of comfort with Xcode and the legendary terseness of Apple's docs, that might not be all the tutorial you'll need. |
thanks for the help, it's terse indeed! I'm advancing, but not yet quite there... I'll keep smashing my head a little more, it's usually a painful but fast way of learning things deeply. :) |
Ok, I'm really stuck. I tried 3 different ways, 2 of them compile, but give runtime exceptions, luckily the same :) setup: default xcode OSX command line tool application, replace main.m content with ArgumentParser/example/desc.m demo app: https://github.com/ramiroaraujo/cli-test Below are the 3 options, with the description of the steps I took, although if you checkout the branches in the demo apps the steps are already done. Option 1: Link untouched ArgumentParser project
It doesn't compile, I get Match-O Linker errors, indicating Undefined symbols like OBJC_CLASS$_CPItem Option 2: Link modified ArgumentParser project
It compiles perfectly, it outputs text correctly with the -h flag, but then it shows: Option 3: Add ArgumentParser and CoreParse sources to test-cli project
It compiles perfectly, it outputs text correctly with the -h flag, but then shows the exact same error as Option 2: I think I've reached far beyond my skills here. Any more help or hints are highly appreciated! Cheers! |
follow up: |
It would appear that you're trying to use If you instead use |
I should also note that the first argument of |
not sure I'm following. I copied examples/desc.m into main.m exactly. Also I don't see that code using |
So it would appear that there is a bug in my example file that I need to fix. It should be calling |
I have no idea why this was still open. |
disclaimer: I'm hugely noob with Obj-C, so I might be saying nonsense.
Is it possible to compile this as a static library to use in other projects? I'm trying to bundle this within my own binary for a cli app, but having a hard time figuring out what to do, or if it's even possible.
cheers
The text was updated successfully, but these errors were encountered: