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

Templates issue in "Script.h" #102

Open
JackalopeGit opened this issue Jul 17, 2018 · 7 comments
Open

Templates issue in "Script.h" #102

JackalopeGit opened this issue Jul 17, 2018 · 7 comments

Comments

@JackalopeGit
Copy link

In file included from /home/damir/repos/soa/SoA/MainMenuScriptedUI.cpp:3:

In file included from /home/damir/repos/soa/SoA/SoaEngine.h:20:

In file included from /home/damir/repos/soa/SoA/OptionsController.h:20:

In file included from /home/damir/repos/soa/SoA/Vorb//script/Environment.h:40:

/home/damir/repos/soa/SoA/Vorb/script/Script.h:136:24: error: call to 'fRCall' is ambiguous

                return fRCall<Ret, Args...>(s, (RDelegate<Ret, Args...>*)del);
                       ^~~~~~~~~~~~~~~~~~~~
/home/damir/repos/soa/SoA/Vorb/script/Script.h:153:26: note: in instantiation of function template specialization 'vorb::script::impl::luaDRCall<unsigned long>' requested here

            return impl::luaDRCall<Ret, Args...>;
                         ^
/home/damir/repos/soa/SoA/Vorb//script/Environment.h:149:32: note: in instantiation of function template specialization 'vorb::script::fromRDelegate<unsigned long>' requested here

                ScriptFunc f = fromRDelegate<Ret, Args...>();
                               ^
/home/damir/repos/soa/SoA/MainMenuScriptedUI.cpp:34:10: note: in instantiation of function template specialization 'vorb::script::Environment::addCRDelegate<unsigned long>' requested here

    env->addCRDelegate("size", makeRDelegate(*this, &MainMenuScriptedUI::getNumInputs));
         ^
/home/damir/repos/soa/SoA/Vorb/script/Script.h:112:17: note: candidate function [with Ret = unsigned long]

            i32 fRCall(EnvironmentHandle h, RDelegate<Ret>* del) {
                ^

/home/damir/repos/soa/SoA/Vorb/script/Script.h:117:17: note: candidate function [with Ret = unsigned long, Args = <>]

            i32 fRCall(EnvironmentHandle h, RDelegate<Ret, Args...>* del) {
                ^

Can't resolve this by my own.

@Barnold1953
Copy link
Contributor

I just merged some PRs, see if this is still happening

@JackalopeGit
Copy link
Author

I'm compiling soa on Linux with clang.
Temporary commented out all "addCDelegate" calls, and get it compiled after thousands corrections like case-sensetive-incorrect-slashes-const-lvalue-rvalue-collisions, include orders and more, but get issue on :

MainMenuLoadScreen::build()
-> m_vorbScreenDuration = (m_env["Vorb.MaxDuration"].as<f64>())();
-> RFunction::template<typename... Args> Ret operator()(Args... args) const
-> void Function::rcall(OUT Ret* retValue, Args... args) const        << m_env = NULL
-> EnvironmentHandle getHandle() const { return m_state;  }        << sigsegv

What is "m_env["Vorb.MaxDuration"]", how string literal as an array index works?

@caseymcc
Copy link
Collaborator

I have got the issues in addCDelegate and etc... fixed on at least gcc (haven't tested clang) working through the typos at the moment and a few more items for Linux, likely get to that code in a few.

However m_env is a variable of vorb::script::Environment which has a Function& operator[] (const nString& name); for handling just that.

@caseymcc
Copy link
Collaborator

Likely the commented out code to addCDelegate is the reason that is failing as Function is part of this stuff.

@caseymcc
Copy link
Collaborator

caseymcc commented Aug 4, 2018

I have the compile fixed for Linux, I don't know if it works though as my linux machine cannot open an opengl context (need to install a driver I think). However looks like I am going to have to make some changes to get the Windows version working with the changes I made for linux. But if you would like to play with the linux code and debug it (not sure I am going to mess with debugging on linux) the branches are here.

https://github.com/caseymcc/Vorb/tree/linux_compile
https://github.com/caseymcc/SoACode-Public/tree/linux_compile

@caseymcc
Copy link
Collaborator

caseymcc commented Aug 7, 2018

Ok, all changes are merged now. You should be able to compile on linux. I have no clue if it runs on linux but it does still run on windows.

@czaloj
Copy link
Contributor

czaloj commented Aug 16, 2018

Yeah, shit, all this code was freaking craaaazy

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

4 participants