Link error with v11 SDK

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
Jun 10, 2008
35
0
#1
I downloaded the v11 plugin SDK and recompiled my Idle plugin, to
discover that the linker complains about one (but only one) unresolved
external:

idle4nt.obj : error LNK2019: unresolved external symbol "int __stdcall
GetLine(void *,wchar_t *,int,int)" (?GetLine@@YGHPAXPA_WHH@Z) referenced
in function "char const * __cdecl reader(struct lua_State *,void
*,unsigned int *)" (?reader@@YAPBDPAUlua_State@@PAXPAI@Z)

The decorated name generated locally is ?GetLine@@YGHPAXPA_WHH@Z which
at first glance seems to make sense. The name in TakeCmd.lib seems to be
?GetLine@@YGHPAXPA_WHH1@Z ie there is an additional '1' before the final
'@Z'.

Anyone got an idea what's the problem here?

--
cheers thomasl

web: http://thomaslauer.com/start
 
#2
On Mon, 02 Nov 2009 08:26:14 -0600, thomasl <> wrote:

|I downloaded the v11 plugin SDK and recompiled my Idle plugin, to
|discover that the linker complains about one (but only one) unresolved
|external:
|
|idle4nt.obj : error LNK2019: unresolved external symbol "int __stdcall
|GetLine(void *,wchar_t *,int,int)" (?GetLine@@YGHPAXPA_WHH@Z) referenced
|in function "char const * __cdecl reader(struct lua_State *,void
|*,unsigned int *)" (?reader@@YAPBDPAUlua_State@@PAXPAI@Z)
|
|The decorated name generated locally is ?GetLine@@YGHPAXPA_WHH@Z which
|at first glance seems to make sense. The name in TakeCmd.lib seems to be
|?GetLine@@YGHPAXPA_WHH1@Z ie there is an additional '1' before the final
|'@Z'.
|
|Anyone got an idea what's the problem here?

Change the declaration to:

int WINAPI GetLine( HANDLE hFile, LPTSTR pszLine, int nMaxSize, int nEditFlag,
LPTSTR lpszMask);
/*
Return a single line in pszLine from a file or pipe

hFile - (already opened) handle to the file or pipe
nMaxSize - maximum buffer size for pszLine
nEditFlag - flags for input (OR'd):
0x10000 - file or pipe is Unicode
lpszMask - list of acceptable characters
*/

Also visit the Plugins forum where this and a few other v11 anomalies have been
discussed.
--
- Vince
 
Jun 10, 2008
35
0
#3
vefatica <> wrote:

> On Mon, 02 Nov 2009 08:26:14 -0600, thomasl <> wrote:
>
> |I downloaded the v11 plugin SDK and recompiled my Idle plugin, to
> |discover that the linker complains about one (but only one) unresolved
> |external:
> |
> |idle4nt.obj : error LNK2019: unresolved external symbol "int __stdcall
> |GetLine(void *,wchar_t *,int,int)" (?GetLine@@YGHPAXPA_WHH@Z) referenced
> |in function "char const * __cdecl reader(struct lua_State *,void
> |*,unsigned int *)" (?reader@@YAPBDPAUlua_State@@PAXPAI@Z)
> |
> |The decorated name generated locally is ?GetLine@@YGHPAXPA_WHH@Z which
> |at first glance seems to make sense. The name in TakeCmd.lib seems to be
> |?GetLine@@YGHPAXPA_WHH1@Z ie there is an additional '1' before the final
> |'@Z'.
> |
> |Anyone got an idea what's the problem here?
>
> Change the declaration to:
>
> int WINAPI GetLine( HANDLE hFile, LPTSTR pszLine, int nMaxSize, int nEditFlag,
> LPTSTR lpszMask);
> /*
> Return a single line in pszLine from a file or pipe
>
> hFile - (already opened) handle to the file or pipe
> nMaxSize - maximum buffer size for pszLine
> nEditFlag - flags for input (OR'd):
> 0x10000 - file or pipe is Unicode
> lpszMask - list of acceptable characters
> */
>
Thanks, works now as expected.

I have downloaded the SDK *today* from the JPSoft website... does that
mean that the version there is out of date and out of sync?


> Also visit the Plugins forum where this and a few other v11 anomalies have been
> discussed.
Actually, I did. I even searched the Plugin forum but I found nothing re
GetLine (I found a perhaps related problem re AllocMem).

Well, either the search is stupid or I am. Never mind;-)

--
cheers thomasl

web: http://thomaslauer.com/start
 
#4
On Mon, 02 Nov 2009 09:29:24 -0600, thomasl <> wrote:

|Thanks, works now as expected.
|
|I have downloaded the SDK *today* from the JPSoft website... does that
|mean that the version there is out of date and out of sync?

I don't know Rex's intention. Certainly the SDK available needs some tweaking
for v11.

|---Quote---
|> Also visit the Plugins forum where this and a few other v11 anomalies have been
|> discussed.
|---End Quote---

|Actually, I did. I even searched the Plugin forum but I found nothing re
|GetLine (I found a perhaps related problem re AllocMem).

Yes, that's another one. And somewhere along the line (v10?) stristr() changed
to _stristr().

I also added these to my SDKv11\takecmd.h (the first two to save my having to
declare them in every plugin).

typedef struct {
WCHAR *pszDll; // name of the DLL
WCHAR *pszAuthor; // author's name
WCHAR *pszEmail; // author's email
WCHAR *pszWWW; // author's web page
WCHAR *pszDescription; // (brief) description of plugin
WCHAR *pszFunctions; // command, _variable, @function
int nMajor; // plugin's major version #
int nMinor; // plugin's minor version #
int nBuild; // plugin's build #
HMODULE hModule; // module handle
WCHAR *pszModule;
} PLUGININFO, *LPPLUGININFO;

typedef struct {
int nKey; // key entered
int nHomeRow; // start row
int nHomeColumn; // start column
int nRow; // current row in window
int nColumn; // current column in window
LPTSTR pszLine; // command line
LPTSTR pszCurrent; // pointer to position in line
INT fRedraw;
} KEYINFO, *LPKEYINFO;

int TakeCommandIPC( LPTSTR pszCommand, LPTSTR pszArguments );
--
- Vince
 
Jun 10, 2008
35
0
#6
rconn <> wrote:

> ---Quote---
> > I have downloaded the SDK *today* from the JPSoft website... does that
> > mean that the version there is out of date and out of sync?
> ---End Quote---
> The SDK build process was grabbing the wrong version of the TakeCmd.h file
> (everything else was up-to-date). I've corrected & reuploaded the SDK.ZIP.
Plugin compiles and links and seems to run OK now.

--
cheers thomasl

web: http://thomaslauer.com/start