library help

May 15, 2015 at 6:23pm
So I have been studying c++ for a couple of years now and think it is time to learn to build and use my own library file.

I am using vs2012. I basically want to make a simple test library to play with. Maybe one that only has one function that displays 'Hello world' for example.

If anyone could write a walk through on making a simple .lib file and then how to link to it and use it with vs2012, well I would be very glad. Thanks.
May 15, 2015 at 7:01pm
It's actually pretty easy.
https://www.google.com/search?q=how+to+write+library+in+c
Hope this helps.
May 15, 2015 at 11:20pm
May 16, 2015 at 1:35pm
Thanks guys, but no, I have already tried and failed with all the online tutorials. They seem to talk about command line tags and I don't even know if vs2012 has a command line. Or maybe I am too dumb to get it to work. I did build a .lib file. And when I try to use it I get all kinds of errors. I think maybe I built it wrong or maybe I just don't know how to link to it right...
May 16, 2015 at 2:01pm
Not sure about vs, but if you're willing to switch to codeblocks, it allows you to create library projects that just compile to libraries extremely easily.
May 16, 2015 at 2:02pm
I don't even know if vs2012 has a command line.

do you mean command line arguments?

Right-click on the project and select properties. You'll find the command arguments in the "Configuration Properties -> Debugging" section.
May 16, 2015 at 2:28pm
@mutexe Hmm, let me look into that. Maybe that helps.
May 16, 2015 at 3:43pm
Wait, I think I got it. If this works I am dancing!
Last edited on May 16, 2015 at 3:53pm
May 16, 2015 at 4:34pm
It works!! Thanks to all for your patience and guidance.
Topic archived. No new replies allowed.