Author Topic: WxPack with Visual C++ 2005 Compiler  (Read 8785 times)

yablebab

  • Guest
WxPack with Visual C++ 2005 Compiler
« on: September 20, 2006, 03:42:53 am »
I'm running the Sept. 6, 2006 build of CodeBlocks, with WxPack v. 2.6.3 installed. I first tested WxWidgets using the Visual C++ Express IDE instead of CodeBlocks. Everything compiled and ran fine without any errors.

Then I followed the tutorial http://wxpack.sourceforge.net/Tutorials/CodeBlocksWxWizardVC for setting up a Wx project in CodeBlocks to the letter. My test project compiled in CodeBlocks, but when I ran the .exe, it told me that it could not find wxmsw26ud_vc.dll. So I copied this file to the directory of the .exe. I Built it again, and ran it. It crashed, and gave an error which said:


HEAP CORRUPTION DETECTED: after Normal block (#66) AT 0X00E92F70. CRT detected that the application wrote to memory after end of heap buffer.

Now why would it work fine in VC++ Express but not in CodeBlocks? I have every variable, compiler flag, and  library set up as it says in the tutorial.

I've searched the forum for similar problems and tried many of the responses other people have given, but none have addressed this particular issue. Any help would be greatly appreciated.

Thanks!

Offline RJP Computing

  • Almost regular
  • **
  • Posts: 135
    • RJP Computing
Re: WxPack with Visual C++ 2005 Compiler
« Reply #1 on: September 20, 2006, 04:27:03 am »
Simple, you can thank Microsoft for this one, you need the VC8.0 run-time manifest file. Visual C++ 8.0 embeds this burring building your application and COde::Blocks does not. This manifest makes it possible for your application to use the vc 8.0 run-time as a dll.

That is there error message now if you don't have a .manifest file right next to your application. You need a file called Microsoft.VC80.CRT.manifest. To take care of this you need to download Microsoft Visual C++ 2005 Redistributable Package

You can read through an interesting post on this subject here.

Also it might be beneficial for Code::Blocks to look at firing off the Manifest tool just like Visual C++ 2005 does. I am not sure of what needs to happen, but it is the ONLY way you can use the VC 8.0 run-time as a dll in your application.
« Last Edit: September 20, 2006, 04:31:05 am by RJP Computing »
- Ryan

Ubuntu/WinXP, AMD Athlon 64 3000+, 1000MB RAM, AC 97 Audio, ATI Radeon 9600XT 256MB

yablebab

  • Guest
Re: WxPack with Visual C++ 2005 Compiler
« Reply #2 on: September 20, 2006, 08:59:28 pm »
So I installed the redistributable package, but was still getting the same error. Then I installed WxPack v 2.7 and it worked. It would be cool if the .exe knew where to look for the .dll file, so I didn't have to copy and paste it from the WxPack directory.  But for now this is a good fix. Thanks for the help!

Brian

Offline RJP Computing

  • Almost regular
  • **
  • Posts: 135
    • RJP Computing
Re: WxPack with Visual C++ 2005 Compiler
« Reply #3 on: September 20, 2006, 10:15:13 pm »
I don't know of any way in windows to do that. I don't think Windows lets you set more then the default places to look for dll's. Sorry that is a limitation of windows I think.
- Ryan

Ubuntu/WinXP, AMD Athlon 64 3000+, 1000MB RAM, AC 97 Audio, ATI Radeon 9600XT 256MB

yablebab

  • Guest
Re: WxPack with Visual C++ 2005 Compiler
« Reply #4 on: September 20, 2006, 10:52:06 pm »
So when we distribute this application, we'd have to include both the .dll and the .manifest file with the exe. Is that right?

takeshimiya

  • Guest
Re: WxPack with Visual C++ 2005 Compiler
« Reply #5 on: September 20, 2006, 11:06:09 pm »
I don't know of any way in windows to do that. I don't think Windows lets you set more then the default places to look for dll's. Sorry that is a limitation of windows I think.

There's a way, add the dir to PATH:
set PATH=C:\YourDir\;%PATH%

Or go to Control Panel->System Properties->Environment Variables
and edit one of the PATH variables and then add your dir.

Offline RJP Computing

  • Almost regular
  • **
  • Posts: 135
    • RJP Computing
Re: WxPack with Visual C++ 2005 Compiler
« Reply #6 on: September 22, 2006, 02:34:50 am »
So when we distribute this application, we'd have to include both the .dll and the .manifest file with the exe. Is that right?
Yes that is correct.
- Ryan

Ubuntu/WinXP, AMD Athlon 64 3000+, 1000MB RAM, AC 97 Audio, ATI Radeon 9600XT 256MB

Offline RJP Computing

  • Almost regular
  • **
  • Posts: 135
    • RJP Computing
Re: WxPack with Visual C++ 2005 Compiler
« Reply #7 on: September 22, 2006, 02:36:10 am »
There's a way, add the dir to PATH:
set PATH=C:\YourDir\;%PATH%

Or go to Control Panel->System Properties->Environment Variables
and edit one of the PATH variables and then add your dir.
That works great. Thanks for the tip. I do this in a program now to dynamically load dll's that have dependancies.
- Ryan

Ubuntu/WinXP, AMD Athlon 64 3000+, 1000MB RAM, AC 97 Audio, ATI Radeon 9600XT 256MB