Menu

Problem compiling template plugin

Grahack
2014-10-07
2014-10-13
  • Grahack

    Grahack - 2014-10-07

    Hi all,
    I'm struggling with plugin compilation. I tried with the template plugin, then with the src of other plugins, and still no luck.
    I use Code::Blocks (with GCC), which can import .vcproj files.
    When I open NP++ after having copied the .dll in the plugins dir,
    the error is the ANSI vs UNICODE one. I heard (http://sourceforge.net/p/notepad-plus/discussion/331753/thread/2c102dff/) that the error msg is in fact not adapted.
    Any idea?

     
  • Justin Dailey

    Justin Dailey - 2014-10-08

    I'll agree I've ran into that error when in fact it has nothing to do with ANSI vs UNICODE. I haven't used Code::Blocks anytime recently so I can't help you much with that. You may try to Google for some 3rd party tool that lets you inspect the DLL to make sure the correct functions are getting exported so that N++ can find them. I wish I could help more. If you have any other questions feel free to ask.

     
  • Grahack

    Grahack - 2014-10-08

    Thanks for your answer, I'll try to debug the .dll.
    BTW, could you please tell what do you compile with? Visual Studio?

     
  • Justin Dailey

    Justin Dailey - 2014-10-09

    Yes I've always uses Visual Studios. I've used MSVC 2008, 2010, and been using 2013 as of lately.

     
  • Grahack

    Grahack - 2014-10-13

    I found a fix. Thanks for your idea of inspecting the .dll (I used dllexp.exe and saw that an #ifdef prevented isUnicode to be exported).

    For some reason, VS compiles with UNICODE defined. I had to add ;UNICODE in the .vcproj, at lines 205 and 286 for the import in Code::Blocks to work. Now the lines look like:

    PreprocessorDefinitions="WIN32;...;UNICODE"
    

    The corresponding change in the Code::Blocks project file (.cbp) is the addition of

    <Add option="-DUNICODE" />
    

    in the relevant sections right under

    <Add option="-DNPPPLUGINTEMPLATE_EXPORTS" />
    

    Thanks dail8859 for your help.

     

    Last edit: Grahack 2014-10-13