I fixed two problems today. I want to record here how I did it, so if someone else ever has these problems, they can follow the steps I took and maybe get up-and-running much faster than I did.
Here were the issues:
1. I kept getting an "*** empty variable name. Stop" error any time I was Cleaning or Compiling in the workspace; and
2. The program compiled and linked fine, but on running the program, I got the "0xc000007b" error message.
How I Fixed the "*** empty variable name" error.
1. I uninstalled TDM-GCC-32 and TDM-GCC-64 using Control Panel, Program Files, and clicking on TDM-GCC-32. I deleted the C:\TDM-GCC-32 and C:\TDM-GCC-64 directories (which uninstalling did not delete).
2. I uninstalled CodeLite using Control Panel, Program Files, and clicking on CodeLite. Then I reinstalled CodeLite. As part of the installation, we have to install a compiler. I clicked on a link that let me go to a web site that automatically installed TDM-GCC. I installed TDM-GCC-32 ONLY, into a new C:\TDM-GCC-32.
3. To my Windows 10 System environment variables (right-click Start, Control Panel, System, Advanced System Settings, Environment Variables, and the bottom "System Variables" box), I added the following directories in this order (notice there are no 64-bit directories; if I need them later, I'll add them later):
Code: Select all
C:\MinGW\bin\;
C:\wxWidgets\bin\;
C:\TDM-GCC-32\bin\;
C:\MinGW\;
C:\MinGW\include\;
C:\MinGW\mingw32\include\;
C:\wxWidgets\;
C:\wxWidgets\build\msw\gcc_mswu\;
C:\wxWidgets\include\;
C:\wxWidgets\lib\gcc_dll\;
4. Then, inside CodeLite, clicking on Settings->Environment Variables, in the Default tab, I added the following statements:
Code: Select all
CodeLiteDir=C:\CodeLite
WXCFG=gcc_dll\mswud
WXWIN=C:\wxWidgets
and clicked OK.
5. Still inside CodeLite, I right-clicked on the project name, clicked Settings->Linker->Linker Options. I set them to:
Code: Select all
$(shell wx-config --libs);-mwindows
6. Still inside the Linker panel, I changed the Libraries Search Path to:
Code: Select all
C:\wxWidgets\lib\gcc_dll\
C:\wxWidgets\lib\gcc_dll\mswud\
C:\wxWidgets\lib\gcc_lib\
C:\wxWidgets\lib\gcc_lib\mswud\
I added all four because I wasn't sure what the difference between the gcc_dll and gcc_lib contents were.
7. I then clicked Build, Clean, and then Build, Build and Run Project. Both completed with warnings, but no errors. Woo hoo! So far, so good!
That put me back to getting the "0xc000007b" error, which (among other ways) can occur from trying to run a 64-bit compiled program on a 32-bit machine, or some other 32-bit vs 64-bit mismatch. In my case: I am developing on a 64-bit computer. But my GOAL is to generate a 32-bit executable.
How I fixed the "0xc000007b" error
1. I verified that my win_resources.rc file correctly contained the following commands:
Code: Select all
#include "wx/msw/wx.rc"
#ifdef WIN64
1 24 "wx/msw/amd64.manifest"
#else
1 24 "wx/msw/wx.manifest"
#endif
2. In CodeLite, on the Workspace tab, I clicked the wxChoice so that "Debug" was showing. You can change this later, but for now, set it to Debug.
3. I edited my C:\wxWidgets\include\wx\msw\wx.manifest file to say:
Code: Select all
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
version="0.64.1.0"
processorArchitecture="x86"
name="Controls"
type="win32"
/>
<description>wxWindows application</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="X86"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>
4. And I edited my C:\wxWidgets\include\wx\msw\amd64.manifest file to say:
Code: Select all
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
version="0.64.1.0"
processorArchitecture="amd64"
name="Controls"
type="win32"
/>
<description>wxWindows application</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="amd64"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>
5. In CodeLite, I clicked Build, Clean Workspace, and then Build, Build and Run Project. And voila! The program ran correctly as a Debug program. I ran the same executable in a Windows 7 shell (64-bit, same as Windows 10), and it also ran perfectly.
When I changed the type of build from Debug to Release, the program Cleaned, Compiled, Built and Ran correctly.
That 0xc000007b error appears for a couple of situations, so these directions may work for you if you have the same problems that I did. Good luck!
Colleen