Make GCC/MinGW build work again and support cross-building under Linux#1229
Make GCC/MinGW build work again and support cross-building under Linux#1229marcows wants to merge 27 commits intonotepad-plus-plus:masterfrom marcows:mingw-gcc-minimal
Conversation
Common.h is included in the appropriate source files directly, so it does not have to be included in the compiler invocation. TIXMLA_USE_STL is defined now.
The trailing slash has been removed from PowerEditor/bin/localization/ so that it can also be ignored if created as symbolic link.
Also add .PHONY targets. Avoid using sh.exe on Windows if found in the PATH, elsewise there may be CreateProcess() failures depending on the make implementation, e.g. with MinGW32 make. Use backslash instead of slash as directory separator for Windows internal commands, elsewise the slashes will be treated as parameters.
To be able to execute Notepad++ from this location.
Works for .c and .cpp files, but not for resources.rc dependencies.
Also remove duplicated and identical "NotepadPPUnicode" target and unused compiler flags from link command.
_WIN32_IE is defined in include/sdkddkver.h:
In file included from /usr/i686-w64-mingw32/include/windows.h:10:0,
from ../src/MISC/Common/precompiledHeaders.h:60,
from ../src/Notepad_plus.cpp:29:
/usr/i686-w64-mingw32/include/sdkddkver.h:170:0: note: this is the location of the previous definition
#define _WIN32_IE _WIN32_IE_IE60
_wtof() is available:
/usr/i686-w64-mingw32/include/stdlib.h:498:51: error: conflicting declaration of 'double _wtof(const wchar_t*)' with 'C' linkage
_CRTIMP double __cdecl _wtof(const wchar_t *_Str);
eh.h is available, duplicated definition causes link error:
multiple definition of `_set_se_translator(void (*)(unsigned int, _EXCEPTION_POINTERS*))'
Also remove unused dummy defines.
This fixes GCC compile errors: '__inout' has not been declared The keyword is defined in include/driverspecs.h to an empty value and has been adopted instead of using the include file. This also fixes some other compile errors around __inout, e.g.: ../src/dpiManager.h:53:33: error: expected ',' or '...' before '*' token ../src/dpiManager.h:54:9: error: 'pRect' was not declared in this scope
This fixes GCC compile error: expected 'catch' before '__except' and some subsequent errors.
C++ 2011 is needed to fix this GCC compile error:
In file included from /usr/i686-w64-mingw32/include/c++/5.1.0/unordered_map:35:0,
from ../src/ScitillaComponent/UserDefineDialog.h:54,
from ../src/ScitillaComponent/ScintillaEditView.h:53,
from ../src/Notepad_plus.h:32,
from ../src/Notepad_plus.cpp:30:
/usr/i686-w64-mingw32/include/c++/5.1.0/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
C++ 2014 is needed to fix these GCC compile errors:
../src/ScitillaComponent/ScintillaEditView.cpp:1911:33: error: 'make_unique' is not a member of 'std'
std::unique_ptr<TCHAR[]> buf = std::make_unique<TCHAR[]>(bufSize);
^
../src/ScitillaComponent/ScintillaEditView.cpp:1911:55: error: expected primary-expression before '[' token
std::unique_ptr<TCHAR[]> buf = std::make_unique<TCHAR[]>(bufSize);
^
../src/ScitillaComponent/ScintillaEditView.cpp:1911:56: error: expected primary-expression before ']' token
std::unique_ptr<TCHAR[]> buf = std::make_unique<TCHAR[]>(bufSize);
^
Error messages: 'Notepad_plus' has not been declared 'Notepad_plus' does not name a type class 'FileManager' does not have any field named '_pNotepadPlus' no matching function for call to 'FileManager::init(Notepad_plus*, ScintillaEditView*)'
Add appropriate includes. Error messages: 'runtime_error' is not a member of 'std' 'invalid_argument' is not a member of 'std' 'find' is not a member of 'std'
…sic_istream<wchar_t>'
Error messages in tinyxmlparserA.cpp: 'strncmp' was not declared in this scope 'strlen' was not declared in this scope
max() and min() are already defined in gcc/include/various.h Error messages: call of overloaded 'max(LONG&, LONG&)' is ambiguous call of overloaded 'max(int&, int)' is ambiguous call of overloaded 'max(size_t&, const int&)' is ambiguous call of overloaded 'max(int, long int)' is ambiguous
This fixes GCC compile errors like no matching function for call to 'std::exception::exception(const char [77])' See also http://stackoverflow.com/questions/577270/creating-new-exception-in-c/577338#577338
The wide-character version is not available in current MinGW-w64.
According to MSDN documentation the behaviour is identical, only the
locale parameter is an ordinary char type now.
This fixes the following GCC compile error:
../src/MISC/Common/Sorters.h: In constructor 'NumericSorter<T_Num>::NumericSorter(bool, size_t, size_t)':
../src/MISC/Common/Sorters.h:125:15: error: '::_wcreate_locale' has not been declared
_usLocale = ::_wcreate_locale(LC_NUMERIC, TEXT("en-US"));
^
Converted with: $ iconv -f UTF-16LE -t UTF-8 localizationString.h -o localizationString.h GCC cannot read source and include files with mixed encodings.
Compile errors downgraded to warnings:
../src/MISC/Common/Sorters.h:157:48: error: 'make_pair' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
nonEmptyInputAsNumbers.push_back(make_pair(lineIndex, convertStringToNumber(preparedLine)));
^
/usr/i686-w64-mingw32/include/c++/5.1.0/bits/stl_algo.h:4718:5: error: 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator<std::pair<unsigned int, double>*, std::vector<std::pair<unsigned int, double>, std::allocator<std::pair<unsigned int, double> > > >; _Compare = NumericSorter<T_Num>::sort(std::vector<std::__cxx11::basic_string<wchar_t> >) [with T_Num = double]::<lambda(std::pair<unsigned int, double>, std::pair<unsigned int, double>)>]', declared using local type 'NumericSorter<T_Num>::sort(std::vector<std::__cxx11::basic_string<wchar_t> >) [with T_Num = double]::<lambda(std::pair<unsigned int, double>, std::pair<unsigned int, double>)>', is used but never defined [-fpermissive]
sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
^
To make MinGW windres (used as resource compiler) work on Linux.
Error message: undefined reference to `_imp___Z18_set_se_translatorPFvjP19_EXCEPTION_POINTERSE' See also https://gitorious.org/libreoffice/core/commit/8231620264779d56a074efee8b6d65293c701a49 http://lists.freedesktop.org/archives/libreoffice-commits/2014-April/070309.html
The behaviour of the sorting feature may not be as intended for the MinGW build now. The locale functions seem not to be implemented in MinGW-w64 currently. Undefined reference errors with the following symbols: _create_locale _free_locale _imp___wcstod_l
|
I hope this get's merged.. |
|
i like too,waiting |
|
If you have access to a Visual Studio installation on Windows, you could test the patches there as I don't have the possibility. This might increase the chance for being merged. Especially for the following two commits I do not know whether they have bad influence: |
|
I could try building it.. But even then I cannot guarantee it's correctness. Don't forget we are dealing with code here which has 0 tests. |
|
All I meant was testing that these two changes do not introduce regressions for the VS build, i.e. after a successful build checking that the menu icons are still existing and the UI language can still be switched. |
|
@marcows Just compiled under VS2013 without any error. Where can I download MinGW package without the online installer? |
|
For testing on Windows I used i686-5.2.0-release-win32-sjlj-rt_v4-rev1.7z. Then go to "PowerEditor\gcc" and invoke make from command line: Maybe with e.g. option |
|
use i686-5.2.0-release-win32-sjlj-rt_v4-rev1.7z.,it can finish build,but run it get std::exception title is exception on WM_CREATE,and it can't finish build use mingw64 64 bits edition,my OS is windows 10 th2,also i use VS 2015 build 64bits is good,also use mingw i suggest static link,then will be more portable,thx for you guys great jobs,notepadpp is a great editor |
|
It would have been nice to keep the single steps in the repository history, but thanks anyway, Don! I'm really happy for this being applied now. |
|
Um, can somebody update makefiles and/or code again? Because mingw failes to build for me. You can see error and details here https://notepad-plus-plus.org/community/topic/11701/how-to-compile-notepad-with-mingw-or-clang |
|
@slitazcn I just got the "std::exception" error as well. Reason was the missing SciLexer.dll file. Copy it to the bin/ directory beside NotepadPP.exe. |
…adapted with notepad-plus-plus#1229 - fixed some gcc compiler errors and warnings, see https://ci.appveyor.com/project/chcg/notepad-plus-plus/build/1.0.3 to https://ci.appveyor.com/project/chcg/notepad-plus-plus/build/1.0.13 - remaining task is the wincontrol "ReadDirectoryChanges", which uses ATL, propably not available with mingw
- changes necessary to get back a buildable version with mingw, last adapted with #1229 - fixed some gcc compiler errors and warnings, see https://ci.appveyor.com/project/chcg/notepad-plus-plus/build/1.0.3 to https://ci.appveyor.com/project/chcg/notepad-plus-plus/build/1.0.13 - remaining task is the wincontrol "ReadDirectoryChanges", which uses ATL, propably not available with mingw Closes #2478
* Update german.xml to version 7.0 - 14.10.16 including last updates following english.xml from 14.10.2016 Closes notepad-plus-plus#2423 * Update translations * Update farsi.xml to 7.1 * Update slovenian.xml to v7.1 * Notepad++ 7.1 release * Updated hindi.xml Closes notepad-plus-plus#2375 * Update config.model.xml * config.xml is generated by notepad++ No more config.model.xml. config.xml is generated by notepad++ directly. * Add SmartHighLight node for config.xml generation * Fixed disable smart highlihgt inconsistent behaviour This bug can be reproduce by turning off smart highlight then restart Notepad++ : some smart highlight options are still enabled. Fixes notepad-plus-plus#2442, closes notepad-plus-plus#2465 * Add .profile, .bash_profile, and .bashrc extensions. * Ensure backup directory exists Failed backups result in a user error message and asks to save the file anyways. Closes notepad-plus-plus#2346, Closes notepad-plus-plus#2441 * Add smart highlighting extension to anothe view option Add new option to enable smat highlighting extension to anothe view, while both views are visible side by side. * Fix a regression of double click on several zones of status bar. * Fix a tab settings regression Tab settings per language broken due to the entries are doubled by error during the preferences dialog reorganization. * Fix uninstaller silent mode issue Remove also unecessary files * Fix Installer for 64-bit fails with argument "/D" * Change styler to make makefile more readable Closes notepad-plus-plus#2482 * MinGW GCC update - changes necessary to get back a buildable version with mingw, last adapted with notepad-plus-plus#1229 - fixed some gcc compiler errors and warnings, see https://ci.appveyor.com/project/chcg/notepad-plus-plus/build/1.0.3 to https://ci.appveyor.com/project/chcg/notepad-plus-plus/build/1.0.13 - remaining task is the wincontrol "ReadDirectoryChanges", which uses ATL, propably not available with mingw Closes notepad-plus-plus#2478 * Japanese translation update * update translations to v7.1 * correct indent Closes notepad-plus-plus#2436 * Update Ukrainian translation Closes notepad-plus-plus#2414 * Update catalan.xml Update to v7.0 Closes notepad-plus-plus#2412 * Fix Encoding radio button issue in New Document Sync UTF-8 checkbox with UTF-8 radio button Closes notepad-plus-plus#2377 * cmake config update - added usable cmake config file by transferring files structure from visual studio project file - contains also basic support for mingw make file creation - see https://ci.appveyor.com/project/chcg/notepad-plus-plus/build/1.0.38 for successful with own appveyor config Closes notepad-plus-plus#2477 * Update translations * Notepad++ release 7.2 * Expand environment variables in backup path Fixes notepad-plus-plus#2520, Fixes notepad-plus-plus#2525 * Improve Javascript readability
* Update german.xml to version 7.0 - 14.10.16 including last updates following english.xml from 14.10.2016 Closes notepad-plus-plus#2423 * Update translations * Update farsi.xml to 7.1 * Update slovenian.xml to v7.1 * Notepad++ 7.1 release * Updated hindi.xml Closes notepad-plus-plus#2375 * Update config.model.xml * config.xml is generated by notepad++ No more config.model.xml. config.xml is generated by notepad++ directly. * Add SmartHighLight node for config.xml generation * Fixed disable smart highlihgt inconsistent behaviour This bug can be reproduce by turning off smart highlight then restart Notepad++ : some smart highlight options are still enabled. Fixes notepad-plus-plus#2442, closes notepad-plus-plus#2465 * Add .profile, .bash_profile, and .bashrc extensions. * Ensure backup directory exists Failed backups result in a user error message and asks to save the file anyways. Closes notepad-plus-plus#2346, Closes notepad-plus-plus#2441 * Add smart highlighting extension to anothe view option Add new option to enable smat highlighting extension to anothe view, while both views are visible side by side. * Fix a regression of double click on several zones of status bar. * Fix a tab settings regression Tab settings per language broken due to the entries are doubled by error during the preferences dialog reorganization. * Fix uninstaller silent mode issue Remove also unecessary files * Fix Installer for 64-bit fails with argument "/D" * Change styler to make makefile more readable Closes notepad-plus-plus#2482 * MinGW GCC update - changes necessary to get back a buildable version with mingw, last adapted with notepad-plus-plus#1229 - fixed some gcc compiler errors and warnings, see https://ci.appveyor.com/project/chcg/notepad-plus-plus/build/1.0.3 to https://ci.appveyor.com/project/chcg/notepad-plus-plus/build/1.0.13 - remaining task is the wincontrol "ReadDirectoryChanges", which uses ATL, propably not available with mingw Closes notepad-plus-plus#2478 * Japanese translation update * update translations to v7.1 * correct indent Closes notepad-plus-plus#2436 * Update Ukrainian translation Closes notepad-plus-plus#2414 * Update catalan.xml Update to v7.0 Closes notepad-plus-plus#2412 * Fix Encoding radio button issue in New Document Sync UTF-8 checkbox with UTF-8 radio button Closes notepad-plus-plus#2377 * cmake config update - added usable cmake config file by transferring files structure from visual studio project file - contains also basic support for mingw make file creation - see https://ci.appveyor.com/project/chcg/notepad-plus-plus/build/1.0.38 for successful with own appveyor config Closes notepad-plus-plus#2477 * Update translations * Notepad++ release 7.2 * Expand environment variables in backup path Fixes notepad-plus-plus#2520, Fixes notepad-plus-plus#2525 * Improved Run Macro dialog UI. 1. Radio button and edit box were overlapped 2. Edit box and comboxed were not vertically aligned.
* Update german.xml to version 7.0 - 14.10.16 including last updates following english.xml from 14.10.2016 Closes notepad-plus-plus#2423 * Update translations * Update farsi.xml to 7.1 * Update slovenian.xml to v7.1 * Notepad++ 7.1 release * Updated hindi.xml Closes notepad-plus-plus#2375 * Update config.model.xml * config.xml is generated by notepad++ No more config.model.xml. config.xml is generated by notepad++ directly. * Add SmartHighLight node for config.xml generation * Fixed disable smart highlihgt inconsistent behaviour This bug can be reproduce by turning off smart highlight then restart Notepad++ : some smart highlight options are still enabled. Fixes notepad-plus-plus#2442, closes notepad-plus-plus#2465 * Add .profile, .bash_profile, and .bashrc extensions. * Ensure backup directory exists Failed backups result in a user error message and asks to save the file anyways. Closes notepad-plus-plus#2346, Closes notepad-plus-plus#2441 * Add smart highlighting extension to anothe view option Add new option to enable smat highlighting extension to anothe view, while both views are visible side by side. * Fix a regression of double click on several zones of status bar. * Fix a tab settings regression Tab settings per language broken due to the entries are doubled by error during the preferences dialog reorganization. * Fix uninstaller silent mode issue Remove also unecessary files * Fix Installer for 64-bit fails with argument "/D" * Change styler to make makefile more readable Closes notepad-plus-plus#2482 * MinGW GCC update - changes necessary to get back a buildable version with mingw, last adapted with notepad-plus-plus#1229 - fixed some gcc compiler errors and warnings, see https://ci.appveyor.com/project/chcg/notepad-plus-plus/build/1.0.3 to https://ci.appveyor.com/project/chcg/notepad-plus-plus/build/1.0.13 - remaining task is the wincontrol "ReadDirectoryChanges", which uses ATL, propably not available with mingw Closes notepad-plus-plus#2478 * Japanese translation update * update translations to v7.1 * correct indent Closes notepad-plus-plus#2436 * Update Ukrainian translation Closes notepad-plus-plus#2414 * Update catalan.xml Update to v7.0 Closes notepad-plus-plus#2412 * Fix Encoding radio button issue in New Document Sync UTF-8 checkbox with UTF-8 radio button Closes notepad-plus-plus#2377 * cmake config update - added usable cmake config file by transferring files structure from visual studio project file - contains also basic support for mingw make file creation - see https://ci.appveyor.com/project/chcg/notepad-plus-plus/build/1.0.38 for successful with own appveyor config Closes notepad-plus-plus#2477 * Update translations * Notepad++ release 7.2 * Expand environment variables in backup path Fixes notepad-plus-plus#2520, Fixes notepad-plus-plus#2525 * Update readme.txt * Improve Javascript string readability Fixes notepad-plus-plus#1543, closes notepad-plus-plus#2550 * Small tune on Run Macro dialog UI. 1. Radio button and edit box were overlapped 2. Edit box and comboxed were not vertically aligned. Closes notepad-plus-plus#2549 * Remove 32bit shell dll from 64bit installer Closes notepad-plus-plus#2408
- changes necessary to get back a buildable version with mingw, last adapted with notepad-plus-plus#1229 - fixed some gcc compiler errors and warnings, see https://ci.appveyor.com/project/chcg/notepad-plus-plus/build/1.0.3 to https://ci.appveyor.com/project/chcg/notepad-plus-plus/build/1.0.13 - remaining task is the wincontrol "ReadDirectoryChanges", which uses ATL, propably not available with mingw Closes notepad-plus-plus#2478
- changes necessary to get back a buildable version with mingw, last adapted with notepad-plus-plus#1229 - fixed some gcc compiler errors and warnings, see https://ci.appveyor.com/project/chcg/notepad-plus-plus/build/1.0.3 to https://ci.appveyor.com/project/chcg/notepad-plus-plus/build/1.0.13 - remaining task is the wincontrol "ReadDirectoryChanges", which uses ATL, propably not available with mingw Closes notepad-plus-plus#2478
- changes necessary to get back a buildable version with mingw, last adapted with notepad-plus-plus#1229 - fixed some gcc compiler errors and warnings, see https://ci.appveyor.com/project/chcg/notepad-plus-plus/build/1.0.3 to https://ci.appveyor.com/project/chcg/notepad-plus-plus/build/1.0.13 - remaining task is the wincontrol "ReadDirectoryChanges", which uses ATL, propably not available with mingw Closes notepad-plus-plus#2478
Fixes #385.
Only build errors are fixed, compile warnings are left alone. To reduce the number of changes, even the compiler option "-fpermissive" has been used to downgrade several errors to warnings.