VDrift / vdrift-mac

VDrift Mac OS X build dependencies
Other
6 stars 2 forks source link

Moving to c++11? #47

Closed logzero closed 9 years ago

logzero commented 9 years ago

See https://github.com/VDrift/vdrift/issues/136

Timo6 commented 9 years ago

This should be possible, I hope to have a look at it in the next week or so.

Timo6 commented 9 years ago

Seems to work, apart from one error:

vdrift/src/graphics/model_obj.cpp:224:54: error: invalid operands to binary expression ('basic_ostream<char, std::__1::char_traits<char> >' and 'std::ostream' (aka 'basic_ostream<char>'))

It does mean dropping support for Mac OS X 10.5 and 10.6, but I have no idea if VDrift works on them any more anyway.

logzero commented 9 years ago

That's a bug, luckily a trivial one.

Timo6 commented 9 years ago

Now something isn't linking right:

Undefined symbols for architecture x86_64:
  "std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::length() const", referenced from:
  calgo_testTest::run(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >&) in containeralgorithm.o
logzero commented 9 years ago

Just did a quick grep for length(). This should fail in a few other places too. Replacing it with size() should do the job.

logzero commented 9 years ago

Hmm, it might be a bit more involved. The code wants a reference to the length() function. My guess is that the compiler has it inlined, thus the linker can't find it.

monwarez commented 9 years ago

I have the same problem in FreeBSD. I found that std::mem_fun_ref was deprecated in cplusplus.com reference , and I tested the example and it didn't work(get the same error). So maybe use std::mem_fn instead(I don't know how to use it)

Timo6 commented 9 years ago

VDrift/vdrift@31d53b54168f948a7eadc81f815cc17f5680d8ca fixes it :smile: