Author Topic: Building Miranda-NG  (Read 2827 times)

0 Members and 1 Guest are viewing this topic.

Offline kashr00t

  • Newbie
  • *
  • Posts: 4
Building Miranda-NG
« on: 13 05 2021, 15:28:28 »
Hello everyone!
I'm sorry for a newbie question but I don't understand how to build the project properly. There are so many solution files for Visual Studio but none of their has complete target to build basic runnable app. It needs to build each target manually but I don't have a list of essential targets.
So I found cmake files and tried to configure and generate but it said "Could NOT find OpenSSL... blah blah blah". And I don't know whether I should download and build OpenSSL either it is in libs folder of repository and something wrong in cmake.
I mean I've searched everywhere but couldn't find any HOW TO for building in a proper way. All I need is to build basic messenger app and necessary for ICQ protocol working optionally. I would appreciate for help.
 

Offline dartraiden

Re: Building Miranda-NG
« Reply #1 on: 13 05 2021, 17:19:25 »
You can open mir_full.sln (inside /bin15 (VS2017) or /bin16 (VS2019)) in VS, remove plugins that are useless for you, choose Release 32 (or Release 64) and press Build. It will build all except OpenSSL and Pascal-based plugins.

mir_icons.sln - same for icons.
« Last Edit: 13 05 2021, 17:27:18 by dartraiden »
 

Offline ghazan

Re: Building Miranda-NG
« Reply #2 on: 13 05 2021, 17:30:29 »
kashr00t,
you don't need to build OpenSSL libraries, they are very rarely updated.
grab them from our archives from the site: https://miranda-ng.org/distr/x64/miranda64.zip (or x32/miranda32.zip respectively)
 

Offline ghazan

Re: Building Miranda-NG
« Reply #3 on: 13 05 2021, 17:33:01 »
You can open mir_full.sln
mir_full.sln contains about 200 plugins, it's much more reasonable to make a copy of miranda32.sln and add required plugins in it
 

Offline dartraiden

Re: Building Miranda-NG
« Reply #4 on: 13 05 2021, 19:56:00 »
My batch file for building

my.sln is a copy of mir_full.sln edited for my needs
my_icons is a copy of mir_icons.sln

you need to run it as admin if Miranda is placed in %PROGRAMFILES% or some other protected place
« Last Edit: 14 05 2021, 20:39:24 by dartraiden »
 

Offline kashr00t

  • Newbie
  • *
  • Posts: 4
Re: Building Miranda-NG
« Reply #5 on: 15 05 2021, 09:59:21 »
Thank you for your answers.
Well I found out a problem ICQ dll protocol was built but not loaded by LoadLibrary in pluginEntry::checkAPI with reason 126 ERROR_MOD_NOT_FOUND. At the same time IRC dll protocol loaded normally. I tried building projects bin15 and bin16 with VS 2017 and 2019 respectively, win32 and x64. How can I fix it?
 

Offline ghazan

Re: Building Miranda-NG
« Reply #6 on: 15 05 2021, 10:02:05 »
kashr00t,
you cannot build ICQ.dll alone, it has to be built with all core modules (miranda32.exe, mir_core.dll, mir_app.dll etc) from the same source files.
 

Offline dartraiden

Re: Building Miranda-NG
« Reply #7 on: 15 05 2021, 11:16:47 »
https://wiki.miranda-ng.org/index.php?title=Main_Page
Quote
Stable work of Miranda NG is guaranteed within the same build, i.e., all plugins of the same compilation are compatible with the core while two adjacent builds can be completely incompatible.

You cannot use Miranda core build xxxxx with plugin from build yyyyy. All binaries MUST be compiled from the same source code base. No backward compatibility.

So copy mir_full.sln, edit it in VS, remove useless plugins/libs (do not remove Core section), and build the whole solution.
« Last Edit: 15 05 2021, 11:27:26 by dartraiden »
 

Offline kashr00t

  • Newbie
  • *
  • Posts: 4
Re: Building Miranda-NG
« Reply #8 on: 15 05 2021, 20:41:39 »
kashr00t,
you cannot build ICQ.dll alone, it has to be built with all core modules (miranda32.exe, mir_core.dll, mir_app.dll etc) from the same source files.
https://wiki.miranda-ng.org/index.php?title=Main_Page
You cannot use Miranda core build xxxxx with plugin from build yyyyy. All binaries MUST be compiled from the same source code base. No backward compatibility.

So copy mir_full.sln, edit it in VS, remove useless plugins/libs (do not remove Core section), and build the whole solution.

Yes I do the same. All core sources and necessary database are built from one version. The problem exactly is win32 function LoadLibrary in mir_app.dll can't load built ICQ.dll with error 126 ERROR_MOD_NOT_FOUND got from called function GetLastError. Debugger shows such output log
Code: [Select]
'Miranda32.exe' (Win32): Loaded 'D:\DEV\PROJ\miranda-ng\bin15\Debug\Plugins\ICQ.dll'. Symbols loaded.
'Miranda32.exe' (Win32): Unloaded 'D:\DEV\PROJ\miranda-ng\bin15\Debug\Plugins\ICQ.dll'
'Miranda32.exe' (Win32): Loaded 'D:\DEV\PROJ\miranda-ng\bin15\Debug\Plugins\ICQ.dll'. Symbols loaded.
'Miranda32.exe' (Win32): Loaded 'D:\DEV\PROJ\miranda-ng\bin15\Debug\Libs\libcrypto-1_1.mir'. Cannot find or open the PDB file.
'Miranda32.exe' (Win32): Loaded 'D:\DEV\PROJ\miranda-ng\bin15\Debug\Libs\vcruntime140.dll'. Cannot find or open the PDB file.
'Miranda32.exe' (Win32): Unloaded 'D:\DEV\PROJ\miranda-ng\bin15\Debug\Libs\vcruntime140.dll'
'Miranda32.exe' (Win32): Unloaded 'D:\DEV\PROJ\miranda-ng\bin15\Debug\Libs\libcrypto-1_1.mir'
'Miranda32.exe' (Win32): Unloaded 'D:\DEV\PROJ\miranda-ng\bin15\Debug\Plugins\ICQ.dll'
I don't know why it can't find dll suddenly. I checked ICQ.dll for unresolved dependcies with DependencyWalker and ProcMonitor so no criminal. :)
 

Offline dartraiden

Re: Building Miranda-NG
« Reply #9 on: 16 05 2021, 00:44:48 »
Successfully built  Debug win32:
- opened /bin15/mir_full.sln in VS2017
- built mir_core
- built whole Core section
- built ICQ
- build libjson
- built dbx_sqlite
- put MSVS runtime dlls from https://www.miranda-ng.org/distr/miranda-ng-alpha-latest.exe to \sources\bin15\Debug\Libs
- run \sources\bin15\Debug\Miranda32.exe under Windows 10, ICQ is loaded successfully

MSVS components installed:
Code: [Select]
Static analysis tools
Text Template Transformation
C# and Visual Basic Roslyn compilers
MSBuild
VC++ 2017 version 15.9 v14.16 latest v141 tools
Visual C++ 2017 Redistributable Update
Windows Universal CRT SDK
Windows XP support for C++
Visual Studio C++ core features
« Last Edit: 16 05 2021, 00:51:15 by dartraiden »
 
The following users thanked this post: kashr00t

Offline kashr00t

  • Newbie
  • *
  • Posts: 4
Re: Building Miranda-NG
« Reply #10 on: 16 05 2021, 10:55:41 »
dartraiden, Oh thank you! It turns out that the only thing I lacked was the built libjson and now everything works as good! I don't understand why dependency walker or ProcMon didn't show something meaningful. Thank you very much!
 

Offline dartraiden

Re: Building Miranda-NG
« Reply #11 on: 16 05 2021, 11:24:31 »
CrashDumper is very useful. Main menu → Version info → Show. It shows all plugins (including unloaded) and the reason (missing libraries)
 
The following users thanked this post: kashr00t