SDL: Problem compiling the program in MSVC 2005PE

Started by
1 comment, last by nobodynews 17 years, 1 month ago
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

I would love to change the world, but they won’t give me the source code.

Advertisement
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.
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)"

C++: A Dialog | C++0x Features: Part1 (lambdas, auto, static_assert) , Part 2 (rvalue references) , Part 3 (decltype) | Write Games | Fix Your Timestep!

This topic is closed to new replies.

Advertisement