Discussion:
Linker errors on Windows
Mike Lischke
2013-09-02 10:08:06 UTC
Permalink
Hey Neil,

I just updated my local copy of Scintilla to the latest code in the repository, adjusted the VS project file and tried to compile the library. However this does not link, as I get these errors:

1>ScintillaWin.obj : error LNK2001: unresolved external symbol "struct ID2D1Factory * Scintilla::pD2DFactory" (?***@Scintilla@@3PEAUID2D1Factory@@EA)
1>ScintillaWin.obj : error LNK2001: unresolved external symbol "bool __cdecl Scintilla::LoadD2D(void)" (?***@Scintilla@@YA_NXZ)
1>ScintillaWin.obj : error LNK2001: unresolved external symbol "bool __cdecl Scintilla::IsNT(void)" (?***@Scintilla@@YA_NXZ)
1>ScintillaWin.obj : error LNK2001: unresolved external symbol "void __cdecl Scintilla::Platform_Initialise(void *)" (?***@Scintilla@@***@Z)
1>ScintillaWin.obj : error LNK2001: unresolved external symbol "void __cdecl Scintilla::Platform_Finalise(void)" (?***@Scintilla@@YAXXZ)
1>D:\Work\MySQL\WB6.0\trunk\bin\Debug\Scintilla.dll : fatal error LNK1120: 5 unresolved externals

As you can see these are all parts defined as extern in PlatWin.h. This is a namespace issue. If I comment out the namespace Scintilla .. lines everything links ok.

This sounds a bit weird since the external declaration as well as the actual implementation in PlatWin and its usage in ScintillaWin.cxx are all properly wrapped with either namespace Scintilla {} or using namespace Scintilla. Any idea what's wrong?

Mike
--
www.soft-gems.net
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/groups/opt_out.
Andreas Tscharner
2013-09-03 07:05:49 UTC
Permalink
On 02.09.2013 12:08, Mike Lischke wrote:

[snip]
Post by Mike Lischke
This sounds a bit weird since the external declaration as well as the
actual implementation in PlatWin and its usage in ScintillaWin.cxx are
all properly wrapped with either namespace Scintilla {} or using
namespace Scintilla. Any idea what's wrong?
Stupid question: Did you
nmake clean
before? (That's what I once forgot...)

Best regards
Andreas
--
Andreas Tscharner <***@gmail.com>
----------------------------------------------------------------------
"Intruder on level one. All Aliens please proceed to level one."
-- Call in "Alien: Resurrection"
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/groups/opt_out.
Mike Lischke
2013-09-03 07:16:59 UTC
Permalink
Hey Andreas,
Post by Andreas Tscharner
[snip]
Post by Mike Lischke
This sounds a bit weird since the external declaration as well as the
actual implementation in PlatWin and its usage in ScintillaWin.cxx are
all properly wrapped with either namespace Scintilla {} or using
namespace Scintilla. Any idea what's wrong?
Stupid question: Did you
nmake clean
before? (That's what I once forgot...)
I have a Visual Studio project to create the Scintilla dll and yes I also tried a clean build of it. It's clearly a namespaces issue (I have another patch, for GTK, I sent directly to Neil, also related to namespace usage).

Mike
--
www.soft-gems.net
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/groups/opt_out.
Neil Hodgson
2013-09-03 09:53:57 UTC
Permalink
Post by Mike Lischke
1>D:\Work\MySQL\WB6.0\trunk\bin\Debug\Scintilla.dll : fatal error LNK1120: 5 unresolved externals
Looks like you have defined SCI_NAMESPACE which isn't done by any of the distributed Windows make files. I only turn on SCI_NAMESPACE on OS X where it is needed so support for SCI_NAMESPACE on other platforms has decayed.

Neil
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/groups/opt_out.
Mike Lischke
2013-09-03 10:24:27 UTC
Permalink
Post by Neil Hodgson
Post by Mike Lischke
1>D:\Work\MySQL\WB6.0\trunk\bin\Debug\Scintilla.dll : fatal error LNK1120: 5 unresolved externals
Looks like you have defined SCI_NAMESPACE which isn't done by any of the distributed Windows make files. I only turn on SCI_NAMESPACE on OS X where it is needed so support for SCI_NAMESPACE on other platforms has decayed.
Yes, exactly, we have the Scintilla namespace activated since day 1 (on all our platforms) and correct, we don't use Windows makefiles (but a Visual Studio project).

Mike
--
www.soft-gems.net

Mike
--
www.soft-gems.net
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/groups/opt_out.
Neil Hodgson
2013-09-03 13:56:27 UTC
Permalink
Post by Mike Lischke
Yes, exactly, we have the Scintilla namespace activated since day 1 (on all our platforms) and correct, we don't use Windows makefiles (but a Visual Studio project).
I see what happened - in changeset 4685, I standardised all the header guards and header namespace declarations.
http://sourceforge.net/p/scintilla/code/ci/0bb83b6b54cdaf0d194c79ca08abb6519718d189/

Neil
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/groups/opt_out.
Neil Hodgson
2013-09-04 02:03:36 UTC
Permalink
Pushed some changes that should fix the namespace errors.
http://sourceforge.net/p/scintilla/code/ci/5a0774c71b2d6976b7cfa4ef5690d8cfe399346d/

Neil
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/groups/opt_out.
Mike Lischke
2013-09-04 14:59:54 UTC
Permalink
Post by Neil Hodgson
Pushed some changes that should fix the namespace errors.
http://sourceforge.net/p/scintilla/code/ci/5a0774c71b2d6976b7cfa4ef5690d8cfe399346d/
That works well, Neil. Thanks for the quick fix.

Mike
--
www.soft-gems.net
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/groups/opt_out.
Continue reading on narkive:
Loading...