Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiling OS2 #14

Closed
TeLLie opened this issue Dec 30, 2020 · 6 comments
Closed

Compiling OS2 #14

TeLLie opened this issue Dec 30, 2020 · 6 comments
Milestone

Comments

@TeLLie
Copy link

TeLLie commented Dec 30, 2020

Hello,
Try to get this build to OS/2
I use QT v5.13.1 and gcc v9.2.0

When compiling i get this:
../../NotepadNext/LuaExtension.cpp: In member function 'bool LuaExtension::RunFile(const wchar_t*)':
../../NotepadNext/LuaExtension.cpp:778:71: error: no matching function for call to 'std::basic_ifstream::basic_ifstream(const wchar_t*&, std::_Ios_Openmode)'
778 | std::ifstream filestream(filename, std::ios::in | std::ios::binary);
| ^
g++ -c -Zomf -march=i686 -mtune=i686 -O2 -std=gnu++1z -Wall -W -DQT_NO_IPV6 -DAPP_VERSION=""0.3.3"" -DAPP_COPYRIGHT=""Copyright 2019-2020 Justin Dailey"" -DSCI_OWNREGEX -DADS_STATIC -DEXPORT_IMPORT_API= -DLUA_VERSION_NUM=503 -DQT_NO_DEBUG -DQT_PRINTSUPPORT_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I../../NotepadNext -IE:/qt5-src/Editors/NotepadNext/src/os2/NotepadNext -I../../NotepadNext/decorators -I../../NotepadNext/dialogs -I../../NotepadNext/widgets -I../../scintilla/qt/ScintillaEditBase -I../../scintilla/qt/ScintillaEdit -I../../scintilla/include -I../../scintilla/src -I../../scintilla/lexlib -I../../qtsingleapplication/src -I../../lua/src -I../../uchardet/src -I../../LuaBridge -I../../../src -I../../ads/src -isystem /@unixroot/usr/include/qt5 -isystem /@unixroot/usr/include/qt5/QtPrintSupport -isystem /@unixroot/usr/include/qt5/QtWidgets -isystem /@unixroot/usr/include/qt5/QtGui -isystem /@unixroot/usr/include/qt5/QtNetwork -isystem /@unixroot/usr/include/qt5/QtCore -IE:/qt5-src/Editors/NotepadNext/src/os2/NotepadNext -IE:/qt5-src/Editors/NotepadNext/src/os2/NotepadNext -I/@unixroot/usr/lib/qt5/mkspecs/os2-g++ -o ScintillaNext.obj ../../NotepadNext/ScintillaNext.cpp
In file included from ../../NotepadNext/LuaExtension.cpp:30:
C:/usr/include/c++/9/fstream:587:7: note: candidate: 'std::basic_ifstream<_CharT, _Traits>::basic_ifstream(std::basic_ifstream<_CharT, _Traits>&&) [with _CharT = char; _Traits = std::char_traits]'
587 | basic_ifstream(basic_ifstream&& __rhs)
| ^~~~~~~~~~~~~~
C:/usr/include/c++/9/fstream:587:7: note: candidate expects 1 argument, 2 provided
C:/usr/include/c++/9/fstream:579:2: note: candidate: 'template<class _Path, class _Require> std::basic_ifstream<_CharT, _Traits>::basic_ifstream(const _Path&, std::ios_base::openmode)'
579 | basic_ifstream(const _Path& __s,
| ^~~~~~~~~~~~~~
C:/usr/include/c++/9/fstream:579:2: note: template argument deduction/substitution failed:
C:/usr/include/c++/9/fstream:578:32: error: request for member 'make_preferred' in 'std::declval<const wchar_t*&>()', which is of non-class type 'const wchar_t*'
578 | template<typename _Path, typename _Require = _If_fs_path<_Path>>
| ^~~~~~~~

Any idea to fix ?

@TeLLie
Copy link
Author

TeLLie commented Dec 30, 2020

Oeps i see i did ask earlyer..

I still have no right solution for this error.

Please close this ..

@dail8859
Copy link
Owner

According to this stackoverflow answer, it may be due to using an older compiler and they have some suggested changes. If you do figure it out I'll gladly accept a PR but won't be able to test it myself. As long as it still builds on Windows that's fine with me.

@TeLLie
Copy link
Author

TeLLie commented Dec 30, 2020 via email

dail8859 added a commit that referenced this issue Dec 30, 2020
This still has a very Windows specific implementation and likely is causing issues on other platforms. See #14
@dail8859
Copy link
Owner

I would guess that is new enough. Your g++ command shows -std=gnu++1z which Google shows this supports c++17 which is sufficient.

Looking more into your error message shows:

no matching function for call to 'std::basic_ifstream::basic_ifstream(const wchar_t*&, std::_Ios_Openmode)'

The wchar_t type is a left over of this code being first developed in a very Windows specific environment. So it sounds like it is due to the char type, and not the fstream.

note: candidate: 'std::basic_ifstream<_CharT, _Traits>::basic_ifstream(std::basic_ifstream<_CharT, _Traits>&&) [with _CharT = char; _Traits = std::char_traits]'

Suggests it wants a char and not a wchar_t.

Looking at this section of code, this function isn't even used and if it ever would be needed should be rewritten into a Qt specific implementation.


I just pushed a commit to the dev branch which hopes to fix this issue. Let me know.

@TeLLie
Copy link
Author

TeLLie commented Dec 30, 2020 via email

@dail8859
Copy link
Owner

Glad it worked!

@dail8859 dail8859 added this to the v0.3.3 milestone Dec 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants