For some reason, I would like to use an extension .cxy to use as a c++ source code. Say, the filename is abc.cxy. But, my g++ (4.9.2 version) is failing to compile.
I am compiling as:
g++ -o abc.oxy abc.cxy
It's complaining as: g++: warning: conn.cxy: linker input file unused because linking not done
And, the object file abc.oxy is not being made.
Whereas, if I have the extension as .cxx, and compile as:
g++ -o abc.oxy abc.cxx
It's making abc.oxy
Am I not allowed to use extension other than .c, .cpp, .cxx?
Try
g++ -o abc.oxy -x c++ abc.cxyg++can't deduce the correct language from your custom suffix, and anything that it can't deduce as source, it passes directly to the linker as an object file.Not if you want GCC to auto deduce the source language. Conventions are in place so we won't have to be explicit, but you can still use the
-xoption.