Problem: R6034 - ...attempt to load the C runtime library...

Problems and solutions for installing or running FreeOrion, including discussion of bugs if needed before posting a bug report on GitHub. For problems building from source, post in Compile.

Moderator: Oberlus

Post Reply
Message
Author
bbame
Space Krill
Posts: 4
Joined: Thu Oct 20, 2011 6:48 pm

Problem: R6034 - ...attempt to load the C runtime library...

#1 Post by bbame »

Generally I play FreeOrion on Linux, but I thought I'd try the 3.17 version for Windows.

Unfortunately I get an error when I try to run it.

The intro/menu displays normally. I choose "Single Player", take all the defaults for "Galaxy Setup", then click "Ok". After which I receive multiple dialog boxes displaying the error below...

---
Runtime Error!

Program: C:\Program Files\FreeOrion\freeorionca.exe

R6034
An application has made an attempt to load the C runtime library incorrectly.
Please contact the application's support team for more information.
---

100% repeatable.

My hunch is that there's some sort of DLL issue, but I don't know enough about Windows to track it down.

My environment:
WinXP SP3
FreeOrion v0.3.17 [SVN 4282] MSVC 2010 (via Windows installer from Sourceforge, not built from source)

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Problem: R6034 - ...attempt to load the C runtime librar

#2 Post by Geoff the Medio »

You can probably avoid the problem by playing a game with 0 AIs.

You could try installing the latest .NET framework from Microsoft. Various versions of Visual Studio have added dependency to various versions of that, though I don't know what version is required for the v0.3.17 Windows build.

You could also try installing Python 2.7 on your system, and perhaps also removing the Python DLL and .zip from the main FreeOrion install directory.

bbame
Space Krill
Posts: 4
Joined: Thu Oct 20, 2011 6:48 pm

Re: Problem: R6034 - ...attempt to load the C runtime librar

#3 Post by bbame »

Geoff the Medio wrote:You can probably avoid the problem by playing a game with 0 AIs.

You could try installing the latest .NET framework from Microsoft. Various versions of Visual Studio have added dependency to various versions of that, though I don't know what version is required for the v0.3.17 Windows build.

You could also try installing Python 2.7 on your system, and perhaps also removing the Python DLL and .zip from the main FreeOrion install directory.
I already have the latest .NET framework, and since I already have Python 2.7.2 on my Windoze box I tried the DLL trick... No luck. On the other hand, since I sometimes develop software in Python and need to test it with various Python versions on Windows, I also have Python 2.5, Python 2.6, Python 3.1, and Python 3.2. I suppose this mix&match Python environment may be part of the problem.

But you're right about running a game with 0 AIs, so the dependency is clearly in the AI code, not the GUI.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Problem: R6034 - ...attempt to load the C runtime librar

#4 Post by Geoff the Medio »

Do you get any AI_#.log files generated in C:\Documents and Settings\UserName\Application Data\FreeOrion ? Can you post the contents of AI_1.log if you do?

Edit: You might also try building FreeOrion yourself, perhaps using Visual Studio 2008 instead of 2010 that was used for v0.3.17. It's possible that something about how I built Python with MSVC 2010 doesn't work with XP. (I had to build Python myself in order to link against Boost 1.47 and remove the MSVC 2008 dependency that their binary has...)

bbame
Space Krill
Posts: 4
Joined: Thu Oct 20, 2011 6:48 pm

Re: Problem: R6034 - ...attempt to load the C runtime librar

#5 Post by bbame »

I do get AI logs, but they look fairly normal (attached).

In fact the AIs appear to be working normally... I just never let the game progress beyond the error dialogs before.

So is it possible that the game is working fine, except for some bogus error messages?
Attachments
ai_logs.tar.gz
(4.19 KiB) Downloaded 135 times

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Problem: R6034 - ...attempt to load the C runtime librar

#6 Post by Geoff the Medio »

That is really weird... The AI appears to run for the first turn, and then just exits suddenly after saving its state. The looks just like what I see if I start a game with an AI, and then exit without pressing the turn button. So, it's not a problem starting up Python, or doing most of the standard AI stuff, and there's no indication of any problem or crash in the log.

Are you sure that AI log file was generated from attempting to start a game with the version you're currently using? The log timestamps appear consistent, but I'm very confused...

bbame
Space Krill
Posts: 4
Joined: Thu Oct 20, 2011 6:48 pm

Re: Problem: R6034 - ...attempt to load the C runtime librar

#7 Post by bbame »

Geoff the Medio wrote:That is really weird... The AI appears to run for the first turn, and then just exits suddenly after saving its state. The looks just like what I see if I start a game with an AI, and then exit without pressing the turn button. So, it's not a problem starting up Python, or doing most of the standard AI stuff, and there's no indication of any problem or crash in the log.

Are you sure that AI log file was generated from attempting to start a game with the version you're currently using? The log timestamps appear consistent, but I'm very confused...
Yep, definitely generated by the version I'm currently using. I don't have any other version on this PC.

There is way too much stuff on this PC, though, so I think I'll start up plain vanilla XP in a virtual machine on my Linux box and see how/if it runs in that environment. If it runs ok I'll assume I simply have too much "pollution" on the PC in question and go back to the Linux version. Don't want to send anybody on a wild goose chase!

Eloque
Space Squid
Posts: 53
Joined: Mon Jul 21, 2014 11:56 am

Re: Problem: R6034 - ...attempt to load the C runtime librar

#8 Post by Eloque »

3 years later, I happend upon this exact same problem. Renaming/removing the python executable, python DLL and python folder solved this.

I do have Python27 installed on the system as well, so I think it's safe to say that that is somehow related.
Code, justify, code - Pitr
Attached patches are released under GPL 2.0 or later, artwork and such are released under CC-BY-SA 3.0 license.

Eloque
Space Squid
Posts: 53
Joined: Mon Jul 21, 2014 11:56 am

Re: Problem: R6034 - ...attempt to load the C runtime librar

#9 Post by Eloque »

Of course, as soon as I removed that python bit, the solution won't build anymore in windows.

Windows 7 Ultimate SP1, SVN version 7282

Code: Select all

1>------ Build started: Project: Common, Configuration: Release Win32 ------
1>  Configuring Version.cpp
1>  '"C:\Workspace\FreeOrion_VS2010_SDK\FreeOrion\msvc2010\..\python.exe"' is not recognized as an internal or external command,
1>  operable program or batch file.
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: "cmd.exe" exited with code 9009.
========== Build: 0 succeeded, 1 failed, 2 up-to-date, 0 skipped ==========
Doesn't seem to look at the path, just the hardcoded Python.exe
Code, justify, code - Pitr
Attached patches are released under GPL 2.0 or later, artwork and such are released under CC-BY-SA 3.0 license.

User avatar
Vezzra
Release Manager, Design
Posts: 6095
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: Problem: R6034 - ...attempt to load the C runtime librar

#10 Post by Vezzra »

Eloque wrote:Of course, as soon as I removed that python bit, the solution won't build anymore in windows.
The Python exe is required for the build environment (there are Python scripts executed during the build process). What happens if you leave the Python exe in place, and only delete the dll and folder?

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Problem: R6034 - ...attempt to load the C runtime librar

#11 Post by Geoff the Medio »

Eloque wrote:Renaming/removing the python executable, python DLL and python folder solved this.
What "python folder" are you referring to?

If it's the python directory within the main FreeOrion directory, that shouldn't make any beneficial difference, as there's only .cpp files in it, which should have no effect at runtime, but will prevent you from building the AI client and possibly the server.

What are the first ~20 lines of your AI_1.log ?

Do you have any other instances of python.exe running on the system at the same time as trying to start a FreeOrion game with AIs?

Eloque
Space Squid
Posts: 53
Joined: Mon Jul 21, 2014 11:56 am

Re: Problem: R6034 - ...attempt to load the C runtime librar

#12 Post by Eloque »

Okay, I got somewhat further, I will try to provide to logs, but I can build now; however, on debugging I get this;

Code: Select all

First-chance exception at 0x7523c42d in FreeOrion.exe: Microsoft C++ exception: Ogre::FileNotFoundException at memory location 0x0018f3cc..
First-chance exception at 0x7523c42d in FreeOrion.exe: Microsoft C++ exception: std::runtime_error at memory location 0x0018f778..
First-chance exception at 0x5a6df6ae in FreeOrion.exe: 0xC0000005: Access violation reading location 0x00000000.
Unhandled exception at 0x5a6df6ae in FreeOrion.exe: 0xC0000005: Access violation reading location 0x00000000.
Seemingly to do with this

Code: Select all

main() caught exception(std::runtime_error): Failed to find an Ogre GL render system.
However, starting the FreeOrion.exe outside MVCS does work.
Code, justify, code - Pitr
Attached patches are released under GPL 2.0 or later, artwork and such are released under CC-BY-SA 3.0 license.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Problem: R6034 - ...attempt to load the C runtime librar

#13 Post by Geoff the Medio »

You need to set the working directory for debugging in MSVC to the location of the FreeOrion executable and related libraries it needs to load...
Attachments
working dir setting
working dir setting
MSVC_Project_Working_Dir.png (70.65 KiB) Viewed 2813 times

Post Reply