Advertisement

Why do you need the .h .cpp AND .lib files?

Started by June 16, 2015 06:26 AM
10 comments, last by Glass_Knife 9 years, 6 months ago

Why does it need both the .h and .cpp source files and the lib? Don't the source files tell it everything it needs to know (what the functions will do etc)? Doesn't it create the .lib file from the source files?

The way I understand what you're trying to do I believe the following steps happen:

1. CMAKE generated a solution/project from a more generic, cross-platform distribution of code files. eg: it created your sln & vcproj files for Visual Studio if that is your IDE, and added .h & .cpp files to relative locations the project can find.

2. That project uses the .h & .cpp files to create the .lib file (it didn't pre-exist before this step)

3. In another project where you 'consume' the library functions you can now include that .h file & .lib file

Can you post a link to the project and documentation. That may shed some light on this.

Are you sure you're not using a *.h file and a *.lib for the library, and a different *.cpp that is using the library, and not the *cpp files that define the library?

I think, therefore I am. I think? - "George Carlin"
My Website: Indie Game Programming

My Twitter: https://twitter.com/indieprogram

My Book: http://amzn.com/1305076532

This topic is closed to new replies.

Advertisement