Sign in to follow this  
skwee

SDL: Problem compiling the program in MSVC 2005PE

Recommended Posts

Hi, seems like i have to much question. Today i switched to MSVC 2005 Professional edition. I tried to compile my program in it and got error: error LNK2019: unresolved external symbol __imp___CrtDbgReportW referenced in function "public: __thiscall std::_Vector_const_iterator<struct SDL_Surface *,class std::allocator<struct SDL_Surface *> >::_Vector_const_iterator<struct SDL_Surface *,class std::allocator<struct SDL_Surface *> >(struct SDL_Surface * *,class std::_Container_base const *)" So i searched Google and here and found that to fix i need to remove _DEBUG from Preprocessor tab in MSVC. So i did and it worked but when i tried to send the application to my friend he got an error: "The application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem." And onther 2 my friend got the same error. When i compiled the SAME source code in Dev-Cpp no one of them got an error and everything was fine. There is a way to fix this error? Or should i stay with Dev-Cpp instead of MSVC2005? Thanks a lot

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
you need the Microsoft 2005 redistributable
http://www.microsoft.com/downloads/details.aspx?familyid=32BC1BEE-A3F9-4C13-9C99-220B62A191EE&displaylang=en
any pc that you expect to run your program you needs to have this installed.

Share this post


Link to post
Share on other sites
Quote:
Original post by Minios
Hi, seems like i have to much question.
Today i switched to MSVC 2005 Professional edition.
I tried to compile my program in it and got error:
error LNK2019: unresolved external symbol __imp___CrtDbgReportW referenced in function "public: __thiscall std::_Vector_const_iterator<struct SDL_Surface *,class std::allocator<struct SDL_Surface *> >::_Vector_const_iterator<struct SDL_Surface *,class std::allocator<struct SDL_Surface *> >(struct SDL_Surface * *,class std::_Container_base const *)"

So i searched Google and here and found that to fix i need to remove _DEBUG from Preprocessor tab in MSVC. So i did and it worked but when i tried to send the application to my friend he got an error:
"The application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem." And onther 2 my friend got the same error. When i compiled the SAME source code in Dev-Cpp no one of them got an error and everything was fine.
There is a way to fix this error? Or should i stay with Dev-Cpp instead of MSVC2005?
Thanks a lot


Your second error actually has nothing to do with the first error. This is due to missing dll files on your friend's computer. There are a few solutions:

Give the dll files to your friend or recompile your project so that it statically links the dll files into your executable. I can't remember which dll files you need, but to statically link your project follow these instructions:

Quote:

If you want to create a simple program that does not require any other files then you can still statically link to the C and C++ runtime. To use the static libraries you need to go to Properties - Configuration Properties - C/C++ - Code Generation - Runtime Library and select either "Multi-threaded (/MT)" or "Multi-threaded Debug (/MTd)"

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this