file1.cpp.o: In function func1()': C:\Users\wolf\AppData\Local\Temp\build6950440914927975083.tmp/file1.cpp:4: multiple definition of func1()'
directories.cpp.o:/file1.cpp:6: first defined here
c:/program files (x86)/arduino/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/bin/ld.exe: Disabling relaxation: it will not work with multiple definitions
Any file can be included via #include directive. To include cpp is the same as it will be copied whole source exactly at the place where directive is. The problem is, if it is included cpp and arduino IDE adds the same file into project, then first will be added via project and second will be added via directive. Try to use different extension which is not recognized by IDE e.g. .cxx and if you use #include it will be OK.
Apprenetly Arduino can include .h files, but not .cpp files.
Wrong. What is happening is that the contents of the file1.cpp file are being included in the cpp file created from the ino file, which is compiled, resulting in one instance of func1. Then the file1.cpp file is compiled, resulting in another instance of func1. The linker then can't figure out which instance it should include.
Budvar10:
Any file can be included via #include directive. To include cpp is the same as it will be copied whole source exactly at the place where directive is. The problem is, if it is included cpp and arduino IDE adds the same file into project, then first will be added via project and second will be added via directive. Try to use different extension which is not recognized by IDE e.g. .cxx and if you use #include it will be OK.