views:

18

answers:

1

I have several maps containing a multitude of classes in my VC++ project, some of them default constructable, others not. When trying to build, I get a "no appropriate default constructor available" error. The problem is that the error is listed to occur in line 173 of map.cpp, which is the code for operator[]. It would seem that I'm accidentally calling operator[] (which implicitly calls the mapped type's default constructor) on one of my non-default constructable maps, but VS doesn't give me any info on where the error originated.

How can I find the part in my code that's causing this problem?

+2  A: 

You're probably looking inside the error list window. Which I don't use that often for C++ projects.

Go to the output window and check a little further down, you should be able to double click the line that will bring you to the type in question.

Doing a search for : error inside the output window is very common for me as well as : fatal to find the source of the errors. Also if you have C++ keyboard shortcuts setup you can keep hitting F4 to go down the list of errors.

To reset to the default C++ keyboard mappings: Options -> Environment -> Keyboard Then reset keyboard mappings to: Visual C++ 6.

Brian R. Bondy
Ah yes, found a line number in the Output window. Thanks.
suszterpatt