1

I have a class defined in a namespace. I created the serialize/deserialize methods required by dlib to make it serializable, outside the namespace. It works well on Windows with VC++, but in Ubuntu with gcc doesn't, showing a compilation error saying the method cannot be found. When I remove the namespace from the class, the serialization works ok.

This is the first problem, because I don't know why it works in one compiler and not in the other, and I would prefer to leave the class with a namespace.

The other problem is that I need to serialize a class that cannot be without namespace, so I need to make it work with it.

Any idea is welcome, and if more information is required, I can provide it.

1 Answer 1

1

I've been able to solve it. The problem was that I was declaring serialize/deserialize functions outside the namespace of the classes I wanted to serialize. I don't know why it works on VC++, but now it works in both compilers.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.