Archived

This topic is now archived and is closed to further replies.

Strange & Worrying Compiler Errors

This topic is 5154 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I''m trying to compile C++, directX program using MSVC++ 6 (service pack 5). Everything was working until I added #include <vector> to one of the files. Now I get a bunch of warnings from files in "microsoft visual studio\vc98\include". The warnings are:
f:\program files\microsoft visual studio\vc98\include\xmemory(39) : warning C4100: ''_P'' : unreferenced formal parameter
f:\program files\microsoft visual studio\vc98\include\xmemory(41) : warning C4100: ''_P'' : unreferenced formal parameter
f:\program files\microsoft visual studio\vc98\include\vector(249) : warning C4663: C++ language change: to explicitly specialize class template ''vector'' use the following syntax:
        template<> class vector > ...
f:\program files\microsoft visual studio\vc98\include\vector(156) : warning C4018: ''<'' : signed/unsigned mismatch
        f:\program files\microsoft visual studio\vc98\include\vector(156) : while compiling class-template member function ''void __thiscall std::vector >::insert(unsigned int *,unsigned int,const unsig
ned int &)''
f:\program files\microsoft visual studio\vc98\include\vector(167) : warning C4018: ''<'' : signed/unsigned mismatch
        f:\program files\microsoft visual studio\vc98\include\vector(156) : while compiling class-template member function ''void __thiscall std::vector >::insert(unsigned int *,unsigned int,const unsig
ned int &)''
f:\program files\microsoft visual studio\vc98\include\vector(156) : warning C4018: ''<'' : signed/unsigned mismatch
        f:\program files\microsoft visual studio\vc98\include\vector(156) : while compiling class-template member function ''void __thiscall std::vector >::insert(struct pro *,unsigned int,const struct pro 
&)''
f:\program files\microsoft visual studio\vc98\include\vector(167) : warning C4018: ''<'' : signed/unsigned mismatch
        f:\program files\microsoft visual studio\vc98\include\vector(156) : while compiling class-template member function ''void __thiscall std::vector >::insert(struct pro *,unsigned int,const struct pro 
&)''
f:\program files\microsoft visual studio\vc98\include\xstring(600) : warning C4245: ''initializing'' : conversion from ''const int'' to ''const unsigned int'', signed/unsigned mismatch
        f:\program files\microsoft visual studio\vc98\include\xmemory(59) : while compiling class-template static data member ''const unsigned int std::basic_string,std::allocator >::npos''
f:\program files\microsoft visual studio\vc98\include\xmemory(37) : warning C4100: ''_P'' : unreferenced formal parameter
        f:\program files\microsoft visual studio\vc98\include\xmemory(68) : see reference to function template instantiation ''void __cdecl std::_Destroy(unsigned int *)'' being compiled
f:\program files\microsoft visual studio\vc98\include\xmemory(37) : warning C4100: ''_P'' : unreferenced formal parameter
        f:\program files\microsoft visual studio\vc98\include\xmemory(68) : see reference to function template instantiation ''void __cdecl std::_Destroy(struct pro *)'' being compiled
 
Any ideas? I''ve also got .Net Studio installed, but I installed MSVC++6 after that.

Share this post


Link to post
Share on other sites
the first warning is becuase there is a parameter that is not being used. not a big deal at all. The other warning is becuase you are comparing an interger with an unsigned integer. msvc gives warnings when it finds those things. You can set your warning level on 3 to stop it (i think). Or you can put this line of code before including the vector file

#pragma warning( disable : 4100 )

That will stop warning 4100 from going to the output window. You can do the same for other warnings.




:::: [ Triple Buffer ] ::::

Share this post


Link to post
Share on other sites
...I''m also one of these people who use it without any warnings, it''s just this project.

quote:
What code are you using with a vector?



none, all I''ve added so far is the include statement.

This code isn''t mine - it''s a framework written by lecturer on my masters course.

Share this post


Link to post
Share on other sites
Check the order you''re putting your header files in, and make sure none of them are stepping on each other (with #define''s or whatnot). Hmmm....Well, since they''re just warnings, it doesn''t look too bad, but I''ve not seen warnings like this at all. Try increasing the memory size of your compiler''s stack (using the /Zm option, e.g. /Zm200 for 200% memory usage), as this usually takes care of funky header file errors for me.

Chris Pergrossi
My Realm | "Good Morning, Dave"

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
quote:
Original post by Newfound Ajarn
I''ve had the same problem, and setting my warnling level to level 3 worked.


warnings are your friends! why are you not communicating with them because they are trying to help you out? they didnt mean to upset you. they just want to help you in life and now you ostracized them!

Share this post


Link to post
Share on other sites