Hi everybody. I know my question is trivial, but i didn't find on the net a correct answer or a tutorial for my problem.
I wrote some very simple functions and i'd like to embed them in a library. I want to use them in a console application (possibily not in a project). I use C++ with codeblocks.
I tried to do this:
New project - Static library.
int double(int a)
{return 2*a;}
and compiled it. It works, and i had the mylib.a file. But didn't get the .h file, so i wrote it:
in mylib.h
Now, i want to use it in a console application file:
#include<iostream>
#include"mylib.h"
using namespace std;
int main()
{ cout << double(10);}
but the compiler can't find the function "double".
All files are in the same directory (the third one is a .cpp file).
If it's possibile, i want to keep the second step (use the library in the application) as simple as possibile, because I have to use this things in a course of C++ for beginners. I found some solutions, but they were all using gui applications or project; we won't use such tools.
Thankyou
Giulio