C-Lion Library Construction Usage Guide V2
C-Lion Library Construction Usage Guide V2
1. Create a project. Add your .cpp/.h files to your project folder. Here, staticlib.cpp contains
library function implementations and staticlib.h is the header file that contains the
functions' prototypes. It should look as follows after adding your files to your project:
(Alternatively, you may generate a new static library project and write your own
code inside the header and cpp files automatically created by C-Lion; if you do so,
you do need the second step since CMakeLists.txt file is automatically configured)
IMPORTANT: This will give you the path with “\” symbols in
Windows. You have to change these to “/” like in the example
shown above (First image in step 4).
Blue: The name of the library file without the “lib” prefix and “.a” suffix. In the
example, the library file is named as “libStaticlib_CL.a” which will be written here as
“Staticlib_CL” like in the example.
Yellow: Name of the .cpp file that will be compiled when building the project. This is
the one that uses the library functions. You may also add the library's header file
here as well but not needed.