Skip to main content
gamedev.net
🔒 Locked

namespace mayhem

Started by supagu 4 replies 500+ views
Original Post
supagu
supagu
right in my engine i have a class call Mesh, and im making a plugin for 3d max, which also has a class called Mesh, now i dont want to namespace up my code, so what i did was modified the 3d max header files to namespace up thier max class. Problem is, with this is doesnt seem to want to link when i go to use any methods from the 3d max mesh class :| saying the functions are unresolved. does any one know a work around for such a problem?
TheTroll
TheTroll
This is the reason that namespaces were created. USE THEM...

theTroll
Verg
Verg
Quote:
Original post by supagu
right in my engine i have a class call Mesh, and im making a plugin for 3d max, which also has a class called Mesh, now i dont want to namespace up my code, so what i did was modified the 3d max header files to namespace up thier max class. Problem is, with this is doesnt seem to want to link when i go to use any methods from the 3d max mesh class :| saying the functions are unresolved.

does any one know a work around for such a problem?


Well... if you're into changing other people's code...

...why not put a "using" directive in their source files, too?

"using 3dmax"... or whatever you called it...

Surely within 3DMax they reference "Mesh" by the name "Mesh" and not "yournamespacename::Mesh"


Chad
supagu
supagu
i only have access to thier headers. i've changed all thier code from Mesh to Max::Mesh

i've wrapped thier mesh in the Max namespace, but this screws up the linker as it seems the namespace is used during linking so linker thinks its just Mesh, but i've hcnaged it to Max::Mesh
Way Walker
Way Walker
Quote:
Original post by supagu
i only have access to thier headers. i've changed all thier code from Mesh to Max::Mesh

i've wrapped thier mesh in the Max namespace, but this screws up the linker as it seems the namespace is used during linking so linker thinks its just Mesh, but i've hcnaged it to Max::Mesh


Wrap your Mesh in the supagu (or whatever) namespace and access theirs as ::Mesh.
Nitage
Nitage
To put the 3DSMax Mesh class in a namespace, you'd have to put both the header and the source in that namespace. You don't have access to the source, so you can't do it.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.