I have a project that was build with cmake. The project creates a library (.a) in one directory, and then the application (from another directory) links in this library. It’s using GCC as the compiler.
As long as every file has a “.c” extension, it’s fine.
I wanted to start migrating this to C++ (for reasons), and so one of the first things I did was make one of the files from “<file.c>” to “<file.cxx>” just to see what would happen – if there were any issues.
I have no classes yet, nothing like that. I’ve simply renamed one of the files.
However, the linker now dies. It can’t find any of the references to the library functions in the .a file. It doesn’t matter if I renamed a program file with .cxx, or one of the library files with .cxx. After I clean and redo cmake, the linking step fails.
I’m really at a loss here. This has to be a total noobie thing, but nothing I’ve found on stack overflow or anywhere else gives me any indication on what I’m doing wrong. I can see the linker wants to link in the .a file (just as it did before), but now it’s like it can’t find that library or something.
1