#include functions in other programs

if i write a couple of useful functions that i want to use in other projects too, how can i #include <myfunctions> ?
and is it the same for own classes?
Just copy the header file into your project?
Actually you can't include just that functions. You can write that functions in a header file, and that header you must add at your project, as ascii says. If you want to use that functions, you must include the header where you wrote that functions: #include<your_header> and then you simply use the function as same as you have declared them in your program.
If you don't want to copy the implementations of the functions into your new project, then you should make a library containing your useful functions. The process of creating the library is different depending on the compiler/IDE you're using. The basic concept is to create your library (.a (static) or .o (shared) file in Linux, .lib (static) or .dll (shared) file in Windows). Then, the program using the library will need to have access to header files containing the declarations of the functions/classes/variables to be used from the library and will need access to the .a/.o/.lib/.dll when linking.
ok i created a new file with .h

i told codeblocks to add to current project and i put checkmarks to have it in debug and release version...

i added #include <Own_Functions.h> line in my project and get the file not found error.

i made a video if you want to look.
http://screencast.com/t/JdjbanUOYD
please help:

Never mind, i found the solution myself:
its settings -> compiler debugger -> Search directories
see video if you looking for the same

http://screencast.com/t/DtKDnNpCbc
Topic archived. No new replies allowed.