Author Topic: Memory Error: Borland 5.5 + C::B 8.02 + XP + <string>  (Read 5852 times)

EETHead

  • Guest
Memory Error: Borland 5.5 + C::B 8.02 + XP + <string>
« on: July 09, 2008, 03:41:09 pm »
  In console programs compiled through the Borland compiler and including <string>, where string output is attempted through the cout command:

  Program compiles 100% with no warnings or errors.

  On execute, the following errors occur:

 
  Application Error: The instruction at "0x00405bd8" referenced memory at "0x000000001". The memory could not be "read".
   
  This error repeats on selecting OK to terminate program. After selecting OK again, the following error occurs:

  The exception unknown software exception (0xc0000027) occured in the application at location 0c7c80de9c.


  The application then closes, returning:
 
  Process returned -1073741819 (0xC0000005)   execution time : 269.703 s
  Press any key to continue.



  I know the knee-jerk reaction is to point at the compiler, but the same code compiles and runs fine from the command line. I believe C::B is invoking command line switches in the linker that aren't necessary, aren't switchable through C::B's interface, and are deadly to reading strings from memory. I use very basic switches (essentially none, actually) on the command line. I also do not separately invoke the linker. Here is the command line output from C::B :

bcc32.exe -q -w -x -v -tWC -IE:\PortableApps\Borland\BCC55\Include -IE:\Documents\Programming\StringErr -oobj\Debug\main.obj -c main.cpp
main.cpp:
ilink32.exe -q -ap -v -LE:\PortableApps\Borland\BCC55\Lib -LE:\PortableApps\Borland\BCC55\Lib\PSDK c0x32 obj\Debug\main.obj ,bin\Debug\StringErr.exe,,cw32mt.lib import32.lib ,,
Output size is 119.00 KB
Process terminated with status 0 (0 minutes, 1 seconds)
0 errors, 0 warnings


  Any experience with this problem? Any help would be greatly appreciated!

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Memory Error: Borland 5.5 + C::B 8.02 + XP + <string>
« Reply #1 on: July 10, 2008, 09:48:16 pm »
bcc32.exe -q -w -x -v -tWC -IE:\PortableApps\Borland\BCC55\Include -IE:\Documents\Programming\StringErr -oobj\Debug\main.obj -c main.cpp
main.cpp:
ilink32.exe -q -ap -v -LE:\PortableApps\Borland\BCC55\Lib -LE:\PortableApps\Borland\BCC55\Lib\PSDK c0x32 obj\Debug\main.obj ,bin\Debug\StringErr.exe,,cw32mt.lib import32.lib ,,
What exactly do you put at the command line when it works? Where is the difference in the command line above?! Are you really using the same compiler? Probably you have 2 versions of BCC installed and use one on the command line but another in C::B (verify the toolchain settings of the compiler accordingly...)?!
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

EETHead

  • Guest
Re: Memory Error: Borland 5.5 + C::B 8.02 + XP + <string>
« Reply #2 on: July 14, 2008, 02:42:46 pm »
  Nope, only one installation of the Borland compiler, and as I said in my post, I use basically no switches in the command line . . . something like:

bcc32.exe -IE:PortableApps\Borland\BCC55\Include -LE:\PortableApps\Borland\BCC55\Lib\ program.cpp program.exe

  This generates an .exe that does not throw the memory error . . . no switches. You'll notice I'm running C::B as a portable app, but the final .exe generates the same error whatever arrangement of installations I set up. Tried this on a dozen classroom computers, and the only solutions to the problem have been compiling under Borland from the command line (bypassing C::B) or using C::B to compile through the MinGW compiler.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7594
    • My Best Post
Re: Memory Error: Borland 5.5 + C::B 8.02 + XP + <string>
« Reply #3 on: July 16, 2008, 02:19:59 am »
Try compiling the same program using the command line from Code::Blocks.
Remove options till it works, add options back till it fails

In other words try to do some troubling shooting or post the code that fails.

Otherwise you are just wasting every body time.

Tim S
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org