From 3886ed08acce4f4c66ea6fd834f086b18994e9d1 Mon Sep 17 00:00:00 2001 From: ZuBsPaCe Date: Thu, 29 Oct 2015 14:27:19 +0100 Subject: [PATCH 1/3] Fixes Visual Studio 2015 compile error C3688 (invalid literal suffix) tools\editor\editor_node.cpp(3037): error C3688: invalid literal suffix 'VERSION_FULL_NAME'; literal operator or literal operator template 'operator ""VERSION_FULL_NAME' not found --- tools/editor/editor_node.cpp | 2 +- tools/editor/project_manager.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index a3d7cbd7cf1..ab887865369 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -3034,7 +3034,7 @@ Error EditorNode::save_translatable_strings(const String& p_to_file) { OS::Time time = OS::get_singleton()->get_time(); f->store_line("# Translation Strings Dump."); f->store_line("# Created By."); - f->store_line("# \t"VERSION_FULL_NAME" (c) 2008-2015 Juan Linietsky, Ariel Manzur."); + f->store_line("# \t" VERSION_FULL_NAME " (c) 2008-2015 Juan Linietsky, Ariel Manzur."); f->store_line("# From Scene: "); f->store_line("# \t"+get_edited_scene()->get_filename()); f->store_line(""); diff --git a/tools/editor/project_manager.cpp b/tools/editor/project_manager.cpp index 9f472914332..8f8189cb726 100644 --- a/tools/editor/project_manager.cpp +++ b/tools/editor/project_manager.cpp @@ -144,7 +144,7 @@ class NewProjectDialog : public ConfirmationDialog { fdialog->set_mode(FileDialog::MODE_OPEN_FILE); fdialog->clear_filters(); - fdialog->add_filter("engine.cfg ; "_MKSTR(VERSION_NAME)" Project"); + fdialog->add_filter("engine.cfg ; " _MKSTR(VERSION_NAME) " Project"); } else { fdialog->set_mode(FileDialog::MODE_OPEN_DIR); } @@ -839,7 +839,7 @@ ProjectManager::ProjectManager() { l->set_align(Label::ALIGN_CENTER); vb->add_child(l); l = memnew( Label ); - l->set_text("v"VERSION_MKSTRING); + l->set_text("v" VERSION_MKSTRING); //l->add_font_override("font",get_font("bold","Fonts")); l->set_align(Label::ALIGN_CENTER); vb->add_child(l); From b051914032aeb8112d22159d4009304f96a76ad8 Mon Sep 17 00:00:00 2001 From: ZuBsPaCe Date: Thu, 29 Oct 2015 14:31:48 +0100 Subject: [PATCH 2/3] Fixes Visual Studio 2015 linker error (___iob_func) The original, uncommited fix simply changed compiler flag /MT to /MD. This would link the C runtime dynamically instead of statically. This is bad, because some users would have to install the c runtime before starting the editor. You can find alot of info about this error, which can happen after upgrading to VS 2015, and there are workarounds. But I realized, that the only place, where iob_func is used, is in e_os.h of the openssl library. The latest version already contains a workaround. I simply updated the part in e_os.h. Reference: https://github.com/openssl/openssl/blob/master/e_os.h#L268 Reference: https://software.intel.com/en-us/forums/intel-parallel-studio-beta-archived/topic/266345 Reference: https://connect.microsoft.com/VisualStudio/feedback/details/1144980/error-lnk2001-unresolved-external-symbol-imp-iob-func Reference: http://stackoverflow.com/questions/757418/should-i-compile-with-md-or-mt Here's the original error message: Creating library bin\godot.windows.tools.lib and object bin\godot.windows.tools.exp drivers1.windows.tools.lib(t1_enc.windows.tools.obj) : error LNK2001: unresolved external symbol ___iob_func drivers1.windows.tools.lib(txt_db.windows.tools.obj) : error LNK2001: unresolved external symbol ___iob_func drivers1.windows.tools.lib(d1_enc.windows.tools.obj) : error LNK2001: unresolved external symbol ___iob_func drivers1.windows.tools.lib(ui_openssl.windows.tools.obj) : error LNK2001: unresolved external symbol ___iob_func drivers1.windows.tools.lib(cryptlib.windows.tools.obj) : error LNK2001: unresolved external symbol ___iob_func drivers1.windows.tools.lib(pem_lib.windows.tools.obj) : error LNK2001: unresolved external symbol ___iob_func drivers1.windows.tools.lib(d1_both.windows.tools.obj) : error LNK2001: unresolved external symbol ___iob_func drivers1.windows.tools.lib(rsa_sign.windows.tools.obj) : error LNK2001: unresolved external symbol ___iob_func bin\godot.windows.tools.exe : fatal error LNK1120: 1 unresolved externals scons: *** [bin\godot.windows.tools.exe] Error 1120 --- drivers/builtin_openssl2/e_os.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/builtin_openssl2/e_os.h b/drivers/builtin_openssl2/e_os.h index e801b4106a9..7323a7b4bf3 100644 --- a/drivers/builtin_openssl2/e_os.h +++ b/drivers/builtin_openssl2/e_os.h @@ -318,8 +318,8 @@ static unsigned int _strlen31(const char *str) # undef isupper # undef isxdigit # endif -# if defined(_MSC_VER) && !defined(_DLL) && defined(stdin) -# if _MSC_VER>=1300 +# if defined(_MSC_VER) && !defined(_WIN32_WCE) && !defined(_DLL) && defined(stdin) +# if _MSC_VER>=1300 && _MSC_VER<1600 # undef stdin # undef stdout # undef stderr @@ -327,7 +327,7 @@ static unsigned int _strlen31(const char *str) # define stdin (&__iob_func()[0]) # define stdout (&__iob_func()[1]) # define stderr (&__iob_func()[2]) -# elif defined(I_CAN_LIVE_WITH_LNK4049) +# elif _MSC_VER<1300 && defined(I_CAN_LIVE_WITH_LNK4049) # undef stdin # undef stdout # undef stderr From fff7cedbe18e0ebf4bd22f05d2b068d6cd85b739 Mon Sep 17 00:00:00 2001 From: ZuBsPaCe Date: Thu, 29 Oct 2015 14:35:35 +0100 Subject: [PATCH 3/3] Fixes Visual Studio 2015 parallel builds (-j switch) Reference: http://stackoverflow.com/questions/284778/what-are-the-implications-of-using-zi-vs-z7-for-visual-studio-c-projects fatal error C1041: cannot open program database 'C:\godot\vc140.pdb'; if multiple CL.EXE write to the same .PDB file, please use /FS --- platform/windows/detect.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/windows/detect.py b/platform/windows/detect.py index f0d2a7cc40a..f578e273901 100644 --- a/platform/windows/detect.py +++ b/platform/windows/detect.py @@ -203,14 +203,14 @@ def configure(env): env.Append(LINKFLAGS=['/SUBSYSTEM:CONSOLE']) elif (env["target"]=="debug_release"): - env.Append(CCFLAGS=['/Zi','/Od']) + env.Append(CCFLAGS=['/Z7','/Od']) env.Append(LINKFLAGS=['/DEBUG']) env.Append(LINKFLAGS=['/SUBSYSTEM:WINDOWS']) env.Append(LINKFLAGS=['/ENTRY:mainCRTStartup']) elif (env["target"]=="debug"): - env.Append(CCFLAGS=['/Zi','/DDEBUG_ENABLED','/DDEBUG_MEMORY_ENABLED','/DD3D_DEBUG_INFO','/Od']) + env.Append(CCFLAGS=['/Z7','/DDEBUG_ENABLED','/DDEBUG_MEMORY_ENABLED','/DD3D_DEBUG_INFO','/Od']) env.Append(LINKFLAGS=['/SUBSYSTEM:CONSOLE']) env.Append(LINKFLAGS=['/DEBUG'])