mariuz / flamerobin

FlameRobin is a database administration tool for Firebird RDBMS. Our goal is to build a tool that is: lightweight (small footprint, fast execution) cross-platform (Linux, Windows, Mac OS X, FreeBSD) dependent only on other Open Source software
http://flamerobin.org
MIT License
214 stars 66 forks source link

Compiling current FR code with MSVC 2019 fails #172

Closed tester0077 closed 11 months ago

tester0077 commented 3 years ago

When I try to build FR with wxWidgets 3.1.4 under MSVC 2019 for 32-bits static debug, I get a number of warnings, but also one error

_1>DataGridRows.cpp 1>D:\pkg\wx\MSVC2019_3.1.4_2019\flamerobin-git\src\gui\controls\DataGridRows.cpp(1269,53): error C2440: 'type cast': cannot convert from 'DataGridRowBuffer' to 'unsigned char' 1>D:\pkg\wx\MSVC2019_3.1.4_2019\flamerobin-git\src\gui\controls\DataGridRows.cpp(1269,25): message : No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called 1>Done building project "flamerobinflamerobin.vcxproj" -- FAILED.

The warnings I can either live with or fix, but this error, is a show stopper for me.

arvanus commented 3 years ago

Hi, could please test under VS2015? Also, can you confirm if it's this line with the error? https://github.com/mariuz/flamerobin/blob/7d85a47390bf5394a086f2d138ba34f2107c7091/src/gui/controls/DataGridRows.cpp#L1269 Thanks

tester0077 commented 3 years ago

No, in the latest code from your Github, is is in the block 1221 - 1237 else // binary (show as hexadecimal) { for (int i=0; i<size; i+=8) { int last = 8; if (i+last >= size) last = size - i; for (int j=0; j<last; j++) { result += wx2std(wxString::Format("%02X", (unsigned char)(buffer[i+j]))); <<<<<<<<<<<<<<<<<<<<< } result += " "; if (((i + 8) % 32) == 0) result += "\n"; } } I have compiled the latest code from this site using SVC 2015 and wxWidgets 3.1.1 and many of the warnings in the code I have are fixed, though some are still there and others are new. Still it all compiles with MSVC 2015. Will give 2019 a try; the MSVC's compilers get fussier with every release ;-)

Using MSVC 2019 and wxWidgets 3.1.4 libraries allow the 32-bit static debug build to work, with a several warning related to unused arguments and font related warning. The 32-bit static release does not compile - yet. Modifying the C/C++ Code Generation -> Basic Runtime Library to Multi-threaded DLL allow rge release version to compile & run

tester0077 commented 3 years ago

Some of the warnings for MMSVC 2019 & wxWidgets 3.1.4 can be avoided StartStyling(0, 0); ==> StartStyling(0); font.SetWeight(wxBOLD); ==> font.SetWeight(wxFONTWEIGHT_BOLD );

wxFont font(frlayoutconfig().getEditorFontSize(), wxMODERN, wxNORMAL, wxNORMAL); ==>

wxFont font(frlayoutconfig().getEditorFontSize(),wxFONTFAMILY_MODERN, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, wxFONTFLAG_DEFAULT );

along with some unused args, such as wxString Package::getAlterSql(bool WXUNUSED(full))

arvanus commented 3 years ago

The question about wxWidgets 3.1.4 warnings... it's not fixed yet to keep compatibility with 3.0, and to migrate directly to 3.2 (or something like that)

arvanus commented 3 years ago

About VS2019, I just downloaded and prepared with CMake and was able to build normally without errors Did you used CMake too? Thanks

tester0077 commented 3 years ago

No, I converted the older MSVC .sln file I only use CMake if I have to :-) Yes. upgrading even in wxWidgets does cause some issues. Getting rid of warnings just makes it easier to spot 'real' problems, though most warnings can be suppressed with compiler /wdxxxx options Still, I am very happy to see FR is not dead :-)

arvanus commented 11 months ago

Hi. I'm closing this issue as I can compile Flamerobin with VS2022. Also now you need to use CMake to create the project now