NO

Author Topic: 4.50.113 - crt.lib error, pocrt.lib working fine...  (Read 3103 times)

aj

  • Guest
4.50.113 - crt.lib error, pocrt.lib working fine...
« on: May 23, 2008, 09:28:55 PM »
I'm experiencing a problem with the default static C-library in Pelles C, but the dynamic pocrt.lib works just fine (except that i need a static library)...

The problem is the following:
1. In the main thread I check to see which of two different UI's should be displayed.
2. Create new thread from which the UI should be displayed calling IsGUIThread(TRUE) etc..
3. In the newly created thread I use CreateWindow to create the UI - but it crashes upon calling CreateWindow!

The info I've gotten from Olly is:
EIP = 7C9105F8 in ntdll.
Lasterror is set to ERROR_INVALID_PARAMETER.
"Access violation when reading 0x00000010"

PellesC Debugger says:
That the last thing in the call stack is a call to RtlAllocateHeap() + 24.

Don't know if there's a new 32-bit C-library in the 5.0 version, but I thought it might be a good idea to report it. The funny thing is still that the program works perfectly when linking to pocrt.lib - but I can't use a dll in my project.

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Re: 4.50.113 - crt.lib error, pocrt.lib working fine...
« Reply #1 on: May 24, 2008, 06:20:52 PM »
If you are creating new threads with a static runtime library from Pelles C, you should *obviously* use the multi-threaded version - crtmt.lib. From your description I suspect the problem is with your code...
/Pelle

aj

  • Guest
Re: 4.50.113 - crt.lib error, pocrt.lib working fine...
« Reply #2 on: May 25, 2008, 02:04:40 PM »
Thanks for the quick answer, it solved my problem. The problem was NOT with my code, but with the linker settings.

On the other hand I thought it was enough to set 'Run-time library' to 'Multithreaded (LIB)' under the 'Compile' tab in 'Project Options'..

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Re: 4.50.113 - crt.lib error, pocrt.lib working fine...
« Reply #3 on: May 25, 2008, 02:38:07 PM »
Well, it sounded like a problem on your side at least (not necessarily with the code), and you mentioned *crt.lib* in the title of your initial post, so...
/Pelle