Problem with Scintilla library

I have problem with calling this function Scintilla_RegisterClasses()
Compiler gives me this error
"MainFile.obj : error LNK2019: unresolved external symbol _Scintilla_RegisterResources referenced in function: "blah blah blah" "

I'm using scintilla 331 version, I only copied and pasted what I downloaded from
Scintilla website in my projects directory.

These are my includes:
#include <afxwin.h>
#include "resource.h"
#include "scintilla/include/SciLexer.h"
#include "scintilla/include/Scintilla.h"
#include <afxext.h>         
#include <afxdisp.h>        
#include <afxdtctl.h>	 

How can I fix linkage?
Assuming you're already linking to the required scintilla libs...

I have the source for Scintilla 3.3.2 (the latest version) and another from a 2010 (not sure what version it is) on my machine and there is no sign of a function called Scintilla_RegisterResources in either of these projects: not in the public headers not in the source.

Do you mean Scintilla_ReleaseResources?

btw your assumption is wrong
in which folder are those libraries?
Actually, checking the Scintilla sample app, it looks like you don't need to call any of the DLL functions yourself. You just need to load Scintilla.DLL using LoadLibrary. Therefore no need for a lib file. See [the] simple sample using Scintilla from C++ on Windows" linked to the Scintilla documentation page for how this is done, it you are unsure.

Scintilla Documentation

If you'd prefer to statically link to Scintilla, you'll need to build it from source. This guy shows how to do it.

Building a simple C++ script compiler from Scintilla and CINT

Actually, have you built Scintilla from source? Or did you extract the pre-built DLL from the SciTE package?

Last edited on
tried this:

"# pragma comment( lib, "scintilla/bin/sd_scintilla.lib" )"
//scintilla is in directory of my progrma, also tried linking full path to file, didn't work too

and it says cannot open file
i checked that folder and there' nothing but some .txt file in it

and as i said in main post
i downloaded scintilla package, extracted it from .zip file, and moved it in directory of my program...
Last edited on
Do you want to use Scintilla as a DLL or link to it statically?

If you're ok with a DLL, have you got it from the SciTE package (it's called SciLexer.DLL)

Then all you need to do is call LoadLibrary. The DLL does not export Scintilla_RegisterClasses or Scintilla_ReleaseResources. Registration of classes is done for you automatically when the DLL is loaded, and the resources release when the DLL is unloaded.

If you need or want to use it as a static library, then you will have to build it from source following the instructions in the Scintilla documentation and readme. In particular:

Static linking

On Windows, Scintilla is normally used as a dynamic library as a .DLL file. If you want to link Scintilla directly into your application .EXE or .DLL file, then the STATIC_BUILD preprocessor symbol should be defined and Scintilla_RegisterClasses called. STATIC_BUILD prevents compiling the DllMain function which will conflict with any DllMain defined in your code. Scintilla_RegisterClasses takes the HINSTANCE of your application and ensures that the "Scintilla" window class is registered.

Scintilla Documentation

Using the DLL will be less work.

Last edited on
Topic archived. No new replies allowed.