Would i have to convert the main code into c++ aswell or can i have a seperate .h and .cpp file and have it linked to the original .h file inside an extern "C" {
#include "originalC.h"
}
Or do i have to convert it into c++ aswell?
In your original post you say this:
hello
i am building a library for my atmega328p its to allow all 4 communication methods over i2c (MT,MR,ST and SR)
so obviously, if the library is in fact a C++ class, then it is not callable from C, only C++. Yes, your main program needs to be _formally_ a C++ application. I emphasize formally, because other than being a C++ source file, it can remain essentially as is. Due to the difference in calling conventions, if you mix C and C++, you may need to guide the compiler with some extern "C" directives but other than that, no big deal.
As a rule, i try to create fully self contained applications, i.e. all the code that goes into the app is part of the project source repository. Other than compiler standard libraries, that is. That way it can all be compiled as C++ and you don't need to worry about extern "C"s because there is none. The actual source code can still be vanilla C, ignoring some miniscule details, the compiler won't mind.
You would then have your main() in a main.cpp file (or whatever you call it), and your i2c class in a i2c.h header and i2c.cpp source file. Include normally where needed and you are basically done. That is absolutely the way i would do it, and in fact am doing it for many peripherals. Doing this consistently will result in very "Arduino-like

", easily used peripheral classes hiding all the dirty details from the main code. You just specify during instance construction (or initialization if you don't care for dynamic instances) how you wish the object to behave this time.