Hi
I am trying to write something that compiles and runs
correctly on both Linux and Windows. I am running bash
in Ubuntu on Linux, and I try to set environment variables
in the makefile just before the compile lines. I then write
something in the code like
int main()
{
#ifdef UBUNTU
std::cout << "Ubuntu = true\n";
#else
std::cout << "Ubuntu = false\n";
#endif
return 0;
}
No matter what variant of this I try (#if vs. #ifdef, UBUNTU vs $UBUNTU,
setting the environment variable on the command line before the make
command, etc. I always get "Ubuntu = false". Can someone set me straight
on how to get this working?
Dave