How do you link 2 c library files, to a c++ file?
Right now I am doing this:
> gcc -c file1.c (this works fine)
> gcc -c file2.c ( this works fine)
> g++ -c myc++file.cpp (this works fine)
> g++ -o program myc++file.o file1.o file2.o
-> I get an error on this last one saying that their is a undefined reference to a function in myc++file.o, but that function is defined in file2.o. Something is wrong, but I just cant figure it out.
Any ideas?