rubenwardy/NodeBoxEditor

Visual Studio 2015 error

MoNTE48 opened this issue · 13 comments

Severity    Code    Description Project File    Line    Suppression State
Error   C4996   'chdir': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _chdir. See online help for details.   Win32Project1   c:\users\monte\desktop\nodeboxeditor-master\src\minetest.cpp    178 
Severity    Code    Description Project File    Line    Suppression State
Error   C4996   'chdir': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _chdir. See online help for details.   Win32Project1   c:\users\monte\desktop\nodeboxeditor-master\src\minetest.cpp    184 

@SmallJoker is the person to talk to - sounds quite easy to resolve through editing the line.
Weird how it's only there, not in main.cpp.

I replaced chdir to _chdir and got more than 30 errors :)
I'm sorry, I do not understand in C ++.

It seems _chdir is just a MSVC thing.
That code should really use --config instead though, and fork/execve instead of system (otherwise you have to implement shell escaping for all platforms and you waste resources with an extra shell).
EDIT: it apparently doesn't even use quotes, so paths with spaces in them will have issues.

I can not reproduce this bug because in MSVC 2010 I don't get any error or warning about this function.

Your build not working on Win10:)
VC10 is very old

I replaced the chdir function with _chdir and it worked perfectly as before. Could you post an error log after doing that change?

EDIT: getcwd is deprecated too. A change to _getcwd should solve it aswell.

LNK2019 unresolved external symbol "public: void __thiscall Media::debug(void)" (?debug@Media@@QAEXXZ) referenced in function "public: bool __thiscall Editor::run(class irr::IrrlichtDevice *,class Configuration *,bool)" (?run@Editor@@QAE_NPAVIrrlichtDevice@irr@@PAVConfiguration@@_N@Z) Nodebox c:\Users\monte\OneDrive\documents\visual studio 2015\Projects\Nodebox\Nodebox\Editor.obj 1

Have you included the mediamanager.cpp or whatever in your list of cpp files to build?

Oops, i add all files and see this:
LNK2019 unresolved external symbol _WinMain@16 referenced in function "int __cdecl invoke_main(void)" (?invoke_main@@yahxz) Nodebox C:\Users\monte\OneDrive\Documents\Visual Studio 2015\Projects\Nodebox\Nodebox\MSVCRTD.lib(exe_winmain.obj) 1
LNK1120 1 unresolved externals Nodebox C:\Users\monte\OneDrive\Documents\Visual Studio 2015\Projects\Nodebox\Debug\Nodebox.exe 1

Answer 11: Most likely you’ve created the wrong type of project. Make sure you’re creating a Win32 Console Application, not a Win32 Project.
http://www.learncpp.com/cpp-tutorial/07-a-few-common-cpp-problems/

Does it change anything when you change that in the by-cmake-generated project?

@MoNTE48 It looks like you are compiling with sdl endabled /sdl+
sdl_enabled
(sorry for localization)
compile with /sdl- or create a new project where the check box sdl is disabled should work for you.
sdl_disabled

If you only compile for yourself you can safely disable it. If you want to deploy and share your .exe with other people I would recommend you (or someone else) fix the errors and compile with /sdl+

fork/execve instead of system

WIP PR, need reviewing (not sure if it's okay) #81

That code should really use --config instead though

What do you mean? To find the world path? Is that even a setting?

If you use the dev branch, does this problem persist?