![]() |
Documentation: Developing Win32 GUI Applications Using FOX
![]() |
Introduction
![]() |
Compilers and Development Tools
![]() |
Using Microsoft Visual C++ 6.0
![]() |
Common Problems
![]() |
Unresolved symbols at link time. If you get one or more "error
LNK2001" messages at link time, this usually means you've omitted required
libraries from the list. Open the Project Settings dialog and change to
the "Link" tab. On this tab, choose "Input" from the "Category" drop-down
list. Finally, add the missing libraries to the list under "Object/library
modules". Here is a list of commonly forgotten libraries:
|
this library |
foxd.lib(FXPrintDialog.obj) : error LNK2001: unresolved external symbol _EnumPrintersA@28 | winspool.lib |
foxd.lib(FXRegistry.obj) : error LNK2001: unresolved external symbol
__imp__RegCloseKey@4
foxd.lib(FXRegistry.obj) : error LNK2001: unresolved external symbol __imp__RegEnumKeyExA@32 foxd.lib(FXRegistry.obj) : error LNK2001: unresolved external symbol __imp__RegCreateKeyExA@36 foxd.lib(FXRegistry.obj) : error LNK2001: unresolved external symbol __imp__RegOpenKeyExA@20 foxd.lib(FXRegistry.obj) : error LNK2001: unresolved external symbol __imp__RegEnumValueA@32 foxd.lib(FXRegistry.obj) : error LNK2001: unresolved external symbol __imp__RegSetValueExA@24 foxd.lib(FXRegistry.obj) : error LNK2001: unresolved external symbol __imp__RegDeleteKeyA@8 |
advapi32.lib |
foxd.lib(FXApp.obj) : error LNK2001: unresolved external symbol __imp___TrackMouseEvent@4 | comctl32.lib |
On the other hand, if you get this error message:
MSVCRTD.lib(crtexew.obj) : error LNK2001: unresolved external symbol _WinMain@16this indicates that you forgot to change the application's entry-point symbol to mainCRTStartup. See this section for the details.
Missing support for JPEG or PNG images. If you're trying to use the FXJPEGIcon, FXJPEGImage, FXPNGIcon or FXPNGImage classes and it doesn't seem to be working, it's possible that the FOX library was not compiled correctly to include support for these image formats. Load the FOX library project into Developer Studio and then launch the Project Settings dialog box. On the C/C++ tab of this dialog box, look at the list of preprocessor definitions and confirm that HAVE_JPEGLIB_H (for JPEG support) and/or HAVE_PNG_H (for PNG support) are defined. You will also want to be sure that the compiler can find its way to the JPEG and PNG header files, so make sure the include paths are correct as well. Note that these settings are only relevant for building the FOX library itself; you don't need to have HAVE_JPEGLIB_H or HAVE_PNG_H defined when compiling your FOX-based application code, nor do you need access to the JPEG or PNG header files. You will need to link your applications to the JPEG or PNG libraries, however.
Other Tips...
![]() |
Select "Include files" from the "Show directories for:" drop-down list and the list of directories should show the default include path (in order). Add your FOX installation's include directory to the end of the list. Then select "Library files" from the drop-down list and add your FOX installation's lib directory that list.
Add a description such as "Updating DLL..." to indicate what's going on; this message gets printed to the Build output window in Developer Studio when these commands are executed. Then, add the following two commands to the "Post-build command(s)" list:
REPLACE C:\src\fox\lib\foxdlld.dll /U Debug
IF NOT EXIST Debug\foxdlld.dll COPY C:\src\fox\lib\foxdlld.dll
Debug
You should, of course, use the correct path to the DLL for your FOX installation.
You should also be sure to copy the release build of the DLL (named foxdll.dll)
to your project's Release subdirectory, if that's the configuration
you're configuring.
Using the MinGW Compilers
![]() |
Disclaimer. The process described here has been tested using the most recent release of the Cygwin tools (i.e. the 1.1.x series) and the MinGW tools, under Windows 2000.
To get started, you will need to download and install the following packages:
If you want to use OpenGL, you'll also need to download the OpenGL header files MinGW; they are not a standard part of the packages listed above. Check the MinGW FAQ list for more information about how to develop OpenGL applications using MinGW.
Now, because of some problems with the version of make distributed with MinGW (currently, make-3.77) you'll need to use an earlier version of make, such as the one distributed with the Cygwin tools (make-3.76.1). Ensure that the correct version of make is picked up by either renaming or deleting the version of make distributed with MinGW.
Next, unpack the FOX distribution somewhere by typing, e.g.,
tar xzf fox-0.99.149.tar.gzand then go to the top-level directory of the FOX distribution and type:
./configureIf configure stops rather quickly, right after it prints the message about "checking whether make sets ${MAKE}", it's picking up the wrong version of make (see the notes a few paragraphs earlier).
Once configure is finished doing its thing, and assuming there were no errors, build the library and supporting executables by typing:
makeand then sit back and wait ;)