First, the project am in is in the final stage of development and we cannot move to vs2019 until is released.
My problem: Am trying to create .dll files in Visual Studio 2017 for a GDNative module, that connects to different stores.
I've compiled the godot-cpp with the x64 native tools command prompt VS 2017, by running "scons p=windows generate_bindings=yes" targeting debug and release, creating a .lib file for each, I've done all the configurations in vs2017 following this tutorial:
https://www.youtube.com/watch?v=Ye23Fj94QzQ
And the test works, until I set my "hello world" code. Rebuiling the project (Debug/Release, x64) gives me multiple errors:
LNK2001 unresolved external symbol _CxxFrameHandler4 [My project name] libgodot-cpp.windows.debug.64.lib(Thread.obj)
LNK2001 unresolved external symbol _CxxFrameHandler4 [My project name] libgodot-cpp.windows.debug.64.lib(Dictionary.obj)
LNK2001 unresolved external symbol _CxxFrameHandler4 [My project name] libgodot-cpp.windows.debug.64.lib(Engine.obj)
and so on, all errors pointing to .obj.
This doesn't happen in vs2019, just for trying to discard that the .lib aren't corrects.
What am I missing in vs2017?
Library.cpp:
#include "Hello.h"
using namespace godot;
extern "C" void GDN_EXPORT godot_gdnative_init(godot_gdnative_init_options * o) {
Godot::gdnative_init(o);
}
extern "C" void GDN_EXPORT godot_gdnative_terminate(godot_gdnative_terminate_options * o) {
Godot::gdnative_terminate(o);
}
extern "C" void GDN_EXPORT godot_nativescript_init(void* handle) {
Godot::nativescript_init(handle);
register_class<Hello>();
}
Hello.h:
#pragma once
#include <Godot.hpp>
#include <Node.hpp>
namespace godot {
class Hello: public Node {
private:
GODOT_CLASS(Hello, Node)
public:
static void _register_methods();
void _init();
String get_hello();
};
}
Hello.cpp:
#include "Hello.h"
using namespace godot;
void Hello::_register_methods() {
register_method((char*)"get_hello", &Hello::get_hello);
}
void Hello::_init() {
}
String Hello::get_hello() {
return "Hello world";
}
Thanks.