S
smackdab
Hi, I am using MSVC to compile GD and I think I am down to my last problem
(we'll see ;-)
I can compile libgd.dll and libgd.lib ok but a gdtest.exe program that
refers to extern font variables
are not defined and I have no idea how this should work...sorry for the
confusing email, the
more I write, the worse it becomes ;-)
SHORT VERSION>
My gdtest.exe program's .map file does not list gdFontGiant and seems to
only list functions
that are visabally called in the source. There is a "enable function level
linking" setting, but it
is NOT on...How does a .exe refer to a char [] created in a .dll? (does it
come from the .lib?)
Does the .lib hold data variables?
If I don't link in the libgd.lib, I get unresolved externals except for the
variables, this call does
nothing: extern gdFontPtr gdFontGiant;
gdFontPtr is defined as a * to a struct, but gdFontGiant is a char[] defined
in libgd.c(libgd.lib).
----------------------
LONG VERSION> Here are the details:
Here is a sample from the .dll source that creates a font character (stuff
deleted)
"gdFontGiant" is what I want to access from gdtest.exe...
#include "gdfontg.h"
char gdFontGiantData[] = {
/* Char 0 */
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
};
gdFont gdFontGiantRep = {
256,
0,
9,
15,
gdFontGiantData
};
gdFontPtr gdFontGiant = &gdFontGiantRep;
------------------------------------------------------
Here is the gdfontg.h referenced above:
#ifndef _GDFONTG_H_
#define _GDFONTG_H_ 1
#ifdef __cplusplus
extern "C"
{
#endif
#include "gd.h"
extern gdFontPtr gdFontGiant;
#ifdef __cplusplus
}
#endif
#endif
------------------------------------------------------
And the .def file that exports gdFontGiant
; LIBGD.DEF - module definition file
LIBRARY LIBGD
DESCRIPTION 'LIBGD.DLL'
EXPORTS
gdAlphaBlend
gdDPExtractData
gdFontGiant
------------------------------------------------------
gdFontGiant *seems* to be in the .map .lib and .dll files if I bring
up a text editor and search for the gdFontGiant string...
------------------------------------------------------
The gdtest.exe program, just has
#include "gdfontg.h"
To include the extern part
extern gdFontPtr gdFontGiant;
But, when I am in the debugger gdFontGiant isn't defined
I have added libgd.lib in the link options, and no compiler errors
Is gdFontGiant statically compiled into gdtest.exe ?
Or does it come from the DLL? (doesn't seem likely as
it isn't a function...)
Anything is helpful!!!
(we'll see ;-)
I can compile libgd.dll and libgd.lib ok but a gdtest.exe program that
refers to extern font variables
are not defined and I have no idea how this should work...sorry for the
confusing email, the
more I write, the worse it becomes ;-)
SHORT VERSION>
My gdtest.exe program's .map file does not list gdFontGiant and seems to
only list functions
that are visabally called in the source. There is a "enable function level
linking" setting, but it
is NOT on...How does a .exe refer to a char [] created in a .dll? (does it
come from the .lib?)
Does the .lib hold data variables?
If I don't link in the libgd.lib, I get unresolved externals except for the
variables, this call does
nothing: extern gdFontPtr gdFontGiant;
gdFontPtr is defined as a * to a struct, but gdFontGiant is a char[] defined
in libgd.c(libgd.lib).
----------------------
LONG VERSION> Here are the details:
Here is a sample from the .dll source that creates a font character (stuff
deleted)
"gdFontGiant" is what I want to access from gdtest.exe...
#include "gdfontg.h"
char gdFontGiantData[] = {
/* Char 0 */
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
};
gdFont gdFontGiantRep = {
256,
0,
9,
15,
gdFontGiantData
};
gdFontPtr gdFontGiant = &gdFontGiantRep;
------------------------------------------------------
Here is the gdfontg.h referenced above:
#ifndef _GDFONTG_H_
#define _GDFONTG_H_ 1
#ifdef __cplusplus
extern "C"
{
#endif
#include "gd.h"
extern gdFontPtr gdFontGiant;
#ifdef __cplusplus
}
#endif
#endif
------------------------------------------------------
And the .def file that exports gdFontGiant
; LIBGD.DEF - module definition file
LIBRARY LIBGD
DESCRIPTION 'LIBGD.DLL'
EXPORTS
gdAlphaBlend
gdDPExtractData
gdFontGiant
------------------------------------------------------
gdFontGiant *seems* to be in the .map .lib and .dll files if I bring
up a text editor and search for the gdFontGiant string...
------------------------------------------------------
The gdtest.exe program, just has
#include "gdfontg.h"
To include the extern part
extern gdFontPtr gdFontGiant;
But, when I am in the debugger gdFontGiant isn't defined
I have added libgd.lib in the link options, and no compiler errors
Is gdFontGiant statically compiled into gdtest.exe ?
Or does it come from the DLL? (doesn't seem likely as
it isn't a function...)
Anything is helpful!!!