Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moving to c++11? #47

Closed
logzero opened this issue Jun 13, 2015 · 8 comments
Closed

Moving to c++11? #47

logzero opened this issue Jun 13, 2015 · 8 comments

Comments

@logzero
Copy link
Member

logzero commented Jun 13, 2015

See VDrift/vdrift#136

@Timo6
Copy link
Member

Timo6 commented Jun 14, 2015

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

Timo6 added a commit to Timo6/vdrift-mac that referenced this issue Jun 22, 2015
libc++ is only supported on Mac OS X 10.7 and high
@Timo6
Copy link
Member

Timo6 commented Jun 22, 2015

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 added a commit to VDrift/vdrift that referenced this issue Jun 22, 2015
@logzero
Copy link
Member Author

logzero commented Jun 22, 2015

That's a bug, luckily a trivial one.

@Timo6
Copy link
Member

Timo6 commented Jun 22, 2015

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
Copy link
Member Author

logzero commented Jun 22, 2015

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
Copy link
Member Author

logzero commented Jun 22, 2015

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.

logzero added a commit to VDrift/vdrift that referenced this issue Jun 22, 2015
They are not guaranteed to be visible to the linker, can be inlined.
Hit with osx/clang VDrift/vdrift-mac#47
@monwarez
Copy link

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
Copy link
Member

Timo6 commented Jun 22, 2015

VDrift/vdrift@31d53b5 fixes it 😄

@Timo6 Timo6 closed this as completed in c03106c Jun 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants