Page 1 of 1

How do I fix an "*** empty variable name" error?

Posted: Fri Apr 14, 2017 11:26 pm
by ColleenKobe
I am trying to get a program written in CodeLite/wxWidgets/wxCrafter (set up to create a 32-bit executable) on 64-bit Windows 10, to run on 64-bit Windows 7. The error message I was originally getting is "error 0xc000007b." Now, while trying to fix that problem, I have a new error.

I researched the 0xc000007b error message here in the CodeLite forum and in other places. I now know the message appears to be a catch-all for a number of error conditions. I have a long list of failed attempts to fix the error.

In following the advice to fix this problem, I've uninstalled and reinstalled CodeLite, tdm-gcc, and wxWidgets. Those processes, unfortunately, deleted my compiler and linker settings, so now I'm getting error messages that I did not get before. I'm trying to patiently fix problems as I go. Currently, when I try to perform a "clean" in CodeLite, I get the message:

Code: Select all

C:\WINDOWS\system32\cmd.exe /C C:/TDM-GCC-32/bin/mingw32-make.exe -e -f  "Window_01.mk"  clean
----------Cleaning project:[ Window_01 - Debug ]----------
Window_01.mk:64: *** empty variable name.  Stop.
====0 errors, 0 warnings====
My makefile, Window_01.mk, line 64, says:

Code: Select all

set WXWIN:=C:\wxWidgets
I am not sure how the variable could be empty. How do I fix this error?

I have included three screen shots, hoping to give you the information you need to spot my mistake.
Failing_64-01.jpg
Failing_64-02.jpg
Failing_64-03.jpg
Also, the directories in my path related to wxWidgets are, in this sequence:
  • C:\TDM-GCC-64\bin\;
    C:\TDM-GCC-32\bin\;
    C:\MinGW\;
    C:\MinGW\include\;
    C:\MinGW\bin\;
    C:\wxWidgets\;
    C:\wxWidgets\bin\;
    C:\wxWidgets\include\;
    C:\wxWidgets\lib\gcc_dll\;
-----------------------------------------------------------------------------
Software Versions
-------- --------
CodeLite 10.0.3
gcc 4.9.3
NetBeans 8.1
tdm-gcc 5.1.0.2
Windows 10 Pro, 64-bit
wxWidgets 3.1.0
wxCrafter 2.6

Target platform 32-bit
Target build debug

Re: How do I fix an "*** empty variable name" error?--SOLVED

Posted: Sun Apr 16, 2017 11:01 pm
by ColleenKobe
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