revel8n / glfx

Automatically exported from code.google.com/p/glfx
BSD 2-Clause "Simplified" License
0 stars 0 forks source link

Complie Error Ocurs When Build on Windows Using Visual Studio 2008 #8

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
error C2039: 'at' : is not a member of 'std::map<_Kty,_Ty>'

Original issue reported on code.google.com by lilei9...@gmail.com on 27 Feb 2013 at 5:17

GoogleCodeExporter commented 9 years ago
Version: glfx-0.70-src.zip

Original comment by lilei9...@gmail.com on 27 Feb 2013 at 5:19

GoogleCodeExporter commented 9 years ago
I don't have VS2008 available, so you'll have to help me sort this out.

If you replace the ".at" with a ".find" sequence then it compiles?

Original comment by max.snif...@gmail.com on 27 Feb 2013 at 9:01

GoogleCodeExporter commented 9 years ago
I'll try to fix this when I get out of class later today.

Original comment by ad...@ovgl.org on 27 Feb 2013 at 3:16

GoogleCodeExporter commented 9 years ago
I'm not sure which way Lilei went about building the project files (MinGW, 
NMake, or manually made?) Spring break is coming up and I'll have some extra 
time. I was thinking we should move to a CMake based build system and this 
seems like a good time to bring it up. CMake can create make/project files for 
almost any platform or IDE, it has a graphical user interface which allows 
users to select which options they want, and best of all you only code one 
simple script and it works across the board.

So in other words we won't have to maintain make and project files for legacy 
IDEs like VS2008 and it may even allow GLFX to be built on OSX/everything with 
ease. I would understand why you and etay may not want to throw out the make 
scripts but cmake can build better ones in 30 seconds. Ultimately it's up to 
you and etay if that's the direction you want to go?

Original comment by ad...@ovgl.org on 27 Feb 2013 at 8:55

GoogleCodeExporter commented 9 years ago
So if I understand correctly, it's a build issue?

As for the build systems... I don't mind whether there's another build system 
as long as it doesn't get in a developer's way.

For instance, most people on Windows expect to have sln/vcxproj files ready to 
be used (let's focus just on the up-to-date versions, VS2010/2012). Using CMake 
to generate those files is counter-intuitive on Windows (and requires having 
CMake).
However, if the purpose is to complement the currently supported build systems, 
then I'm all for it. This way, if someone wants a VS2008 sln/vcproj (or 
something else that isn't supported) he can just use CMake to generate it.

Also, Etay has recently looked into scons. Maybe he has some input on it too.
I'm more of a Windows developer, so my opinion on GNU/BSD tools shouldn't 
matter all that much.

Original comment by max.snif...@gmail.com on 27 Feb 2013 at 9:21

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I would assume it is a build issue since we know it works on visual studio 2010 
and 2012, right? There are no visual studio 2008 project files. We could always 
leave the make files and visual studio project files generated by CMake in the 
folder, but either way it's still more logical than maintaining these files 
manually.

Original comment by ad...@ovgl.org on 28 Feb 2013 at 3:49

GoogleCodeExporter commented 9 years ago
It's not necesairly a build issue. The STL could've changed.

Let's take the build system discussion to another thread, to keep  
things on-topic.

Original comment by max.snif...@gmail.com on 28 Feb 2013 at 12:12

GoogleCodeExporter commented 9 years ago
to max:

> It's not necesairly a build issue. The STL could've changed.

> Let's take the build system discussion to another thread, to keep things 
on-topic.

I think you're right. It's an issue of MS STL instead of a build issue. Because 
even if I replace '.at' to '.find', it still fails to compile.

Original comment by lilei9...@gmail.com on 3 Mar 2013 at 6:56

GoogleCodeExporter commented 9 years ago
It's probably a stupid question, but I just want to make sure. You tried to 
replace the '.at' with a sequence of '.find'? I mean that there's no such 
method 'find' in map class, you have to use iterators, thus an actual sequence 
is required.

Original comment by max.snif...@gmail.com on 3 Mar 2013 at 8:43

GoogleCodeExporter commented 9 years ago
I totally thought '.at' was apart of earlier versions of STL. I think the 
easiest fix would be to create our own implementation. I'll have some time to 
work on it Monday if you don't get around to it before I do.

Original comment by ad...@ovgl.org on 3 Mar 2013 at 10:04

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Just checked MSDN, indeed 'at' came to be only from VS2010.
Basically what needs to be done is replace:
value=m.at(key);
with:
iter=m.find(key);
if(iter==m.end())
 throw something;
value=iter->second;

The 'throw' is probably not required, so it can be:
value=m.find(key)->second;

Original comment by max.snif...@gmail.com on 3 Mar 2013 at 3:31

GoogleCodeExporter commented 9 years ago
> It's probably a stupid question, but I just want to make sure. You tried to 
replace the '.at' with a sequence of '.find'? I mean that there's no such 
method 'find' in map class, you have to use iterators, thus an actual sequence 
is required.

Yes, you're right. I gave it up to replace '.find', because '.find' requires 
iterator as parameter for MS STL. And I think to implement a map is not that 
hard, there are many source code for that. For example, I used FBX SDK's red 
black tree class to implement my own map for my project. The readability is 100 
times better than MS STL.

I'd like to use glfx instead of CgFx in my project, because CgFx OpenGL profile 
seems not support geometry shader. So, I need some counterparts to replace 
CgFx. And I will try to update to VS 2010, and see how the glfx works.

Original comment by lilei9...@gmail.com on 3 Mar 2013 at 3:32

GoogleCodeExporter commented 9 years ago
Indeed, Lilei, CgFX also does not support OpenGL core profile. The short 
comings of CgFX make it impossible to do what I need for my own project, and 
that's why I wanted to help work on GLFX. It was either that or write my own fx 
format. As far as I'm aware there are no other alternatives. The good news is 
that we only have a few more things to implement and GLFX will be complete!

Original comment by ad...@ovgl.org on 3 Mar 2013 at 5:27

GoogleCodeExporter commented 9 years ago
> CgFX also does not support OpenGL core profile.

It supports vertex shader and fragment shader for OpenGL, but you need call 
CgFX APIs instead of native OpenGL APIs. You can complie Cg program using 
arbvp1 and arbfp1 for OpenGL, and it even works for ATI's card.

> The good news is that we only have a few more things to implement and GLFX 
will be complete!

Great! Good job.

Original comment by lilei9...@gmail.com on 4 Mar 2013 at 5:45

GoogleCodeExporter commented 9 years ago

Original comment by ad...@ovgl.org on 4 Mar 2013 at 4:12