I am using C++, but a lot of the code is c-style (not explicitly using classes and such).
In tx_mpi_client.cpp, I have at the top of the file,
in tx_client.h, I include tx_mpi_client.hCode:int myrank, num_ranks;
in tx_client.cpp I have
also at the top of the file, before any functions.Code:int myrank, num_ranks;
Why is it telling me that myrank and num_ranks were already defined? They aren't static variables, so they shouldn't be accessible to anything else?
Here are the errors:
tx_mpi_client.o.bss+0x0): multiple definition of `myrank'
tx_client.o.bss+0x0): first defined here
tx_mpi_client.o.bss+0x4): multiple definition of `num_ranks'
tx_client.o.bss+0x4): first defined here