call(S, 0, 0) won't work (attempted to call a string value)?

So, I wanted to go ahead and add Lua scripting to my C++ game engine, however I can't seem to do it. I'm watching a video and i have checked out the tiny bit of code and I can't see what I'm doing wrong. #include <Lua Sourcelua.hpp> lua_State* S = luaL_newstate(); luaL_openlibs(S); luaL_loadfile(S, "main.lua"); lua_call(S, 0, 0); The Lua source codes and files are all

调用(S,0,0)将不起作用(试图调用字符串值)?

所以,我想继续添加Lua脚本到我的C ++游戏引擎,但是我似乎无法做到。 我正在看视频,我已经检查了一小段代码,我看不出我做错了什么。 #include <Lua Sourcelua.hpp> lua_State* S = luaL_newstate(); luaL_openlibs(S); luaL_loadfile(S, "main.lua"); lua_call(S, 0, 0); Lua源代码和文件都在我的项目文件夹中,除了主要功能是2 cpp文件(删除这些文件)。 我的Lua文件看起来像这样:(并放置在Lua源代码的位置

How are my arguments getting corrupted?

So I recently took it upon myself to learn Lua for the game project I'm working on(targeting Windows 7 using Visual Studio 2010 and the Ogre3D engine), at around the same time I started implementing the library of choice for our GUI system, QuickGUI. I decided to outsource font loading to lua as a learning experience and began to run into errors. Thinking it was my inexperience with lua, I

我的论点如何被破坏?

所以我最近花了一些时间去学习Lua的游戏项目(针对使用Visual Studio 2010和Ogre3D引擎的Windows 7),几乎在我开始实现GUI系统的选择库的同时, QuickGUI。 我决定将字体加载外包给lua作为学习经验,并开始遇到错误。 我认为这是我对lua的经验不足,我花了好几天的时间研究问题的症结所在,但是在纯C ++中再现错误时,我遇到了同样的问题。 为了启动QuickGUI的FontManager,我首先创建了一个皮肤效果管理器和资源管理器的实

How to build an accurate translation engine?

I found a formula few months ago, myself to translate any source language (computer characters) to destination (computer characters). Using Lua (desk top users) and C++ class (for native access) so that i can embed it in Web Browser etc etc. I am wondering if we have already better something for this in C++ or Lua. Mine sometimes its really not translating grammars correctly or even rules, bef

如何建立一个准确的翻译引擎?

我在几个月前找到了一个公式,我自己可以将任何源语言(计算机字符)翻译成目标(计算机字符)。 使用Lua(桌面用户)和C ++类(用于本地访问),以便我可以将它嵌入到Web浏览器等。我想知道如果我们已经有更好的东西在C ++或Lua中。 有时候我的语言真的没有正确地翻译语法,甚至没有规则,在构建它之前,我认为我会是一个最好的完成方式,但它现在已经走到很久了,恐怕它可能会变成错误的实现。 现在我想查看其他人并比较我

Release mode Vs DEbug mode in MS Visual Studio Windows

I am using MSVS 9 (VS 2008). My application as well as shared library(dll)(I am using to link with my application) is also of c++ environment. Now observe the below cases: when the shared library/dll is built in Debug mode and my application is also built in Debug mode Result: Application executed successfully when the shared library/dll is built in Release mode and my application is also b

发布模式VS MS Visual Studio Windows中的DEbug模式

我正在使用MSVS 9(VS 2008)。 我的应用程序以及共享库(dll)(我用于链接我的应用程序)也是c ++环境。 现在观察下面的情况: 当共享库/ dll以Debug模式构建并且我的应用程序也以Debug模式构建时结果:应用程序成功执行 当共享库/ dll构建在发布模式下时,我的应用程序也构建在发布模式下结果:应用程序成功执行 当共享库/ dll构建在发布模式下时,我的应用程序也是以调试模式构建的。结果:应用程序崩溃时没有从调用

Visual Studio No Symbols have been loaded for this document

I am having some trouble debugging a visual studio 2008 C++ project. When I start running it in debug, the breakpoints are disabled with the message The Breakpoint will not be hit. No Symbols have been loaded for this document. I have tried cleaning and rebuilding, but this doesn't make a difference. I also tried looking in Debug->Windows->Modules. If I right click on the modul

Visual Studio没有为此文档加载符号

我在调试Visual Studio 2008 C ++项目时遇到了一些麻烦。 当我开始在调试中运行它时,断点与消息一起被禁用 断点不会被击中。 没有符号已经被载入这个文件。 我曾尝试过清洁和重建,但这并没有什么区别。 我也试过在Debug-> Windows-> Modules中寻找。 如果我右键单击模块,我正在尝试调试并按符号加载信息,它会显示它尝试加载符号的位置列表。 列表中的第一个是正确的,并且文件存在,但在它旁边是这个错误

Visual Studio Debug Memory1 Window Hex to Dec Mouse Hover Not Working

I am following a C++ tutorial and using the Memory1 window to look at what is stored in my array. The numbers are in hex and when the instructor hovers his mouse over the hex number a pop up shows what that converts to in decimal. eg. he hovers over the hex 16 in the memory window and a popup says 0x16 = 22. I do not get a popup when I hover my mouse over the number. Is this an option I need

Visual Studio调试Memory1窗口十六进制为降低鼠标悬停不起作用

我正在关注一个C ++教程,并使用Memory1窗口来查看存储在我的数组中的内容。 数字以十六进制格式显示,当教师将鼠标悬停在十六进制数字上时,弹出窗口显示以十进制格式转换的内容。 例如。 他将鼠标悬停在内存窗口中的十六进制16上,弹出窗口显示0x16 = 22。当鼠标悬停在数字上时,我没有弹出窗口。 这是我需要打开的选项还是什么? 我正在使用Visual Studio 2012。 也许讲师安装了一些插件。 在我所知的Memory窗口中没

Change the way the Visual Studio debugger displays char variables

I have a program in which I'm using the unsigned char type to represent integers, but when inspecting the variables in the debugger with Visual Studio 2005, it's showing me the ASCII character representations, whereas I would like to see the decimal representation. Does anyone know of a way to change the way it displays the data? Suppose you have a variable foo declared as uint32_t , a

更改Visual Studio调试器显示char变量的方式

我有一个程序,其中使用unsigned char类型来表示整数,但是当使用Visual Studio 2005检查调试器中的变量时,它向我显示了ASCII字符表示形式,而我希望看到十进制表示形式。 有谁知道改变数据显示方式的方法吗? 假设你有一个变量foo声明为uint32_t ,并且你想显示foo就好像它实际上是一个float 。 在监视窗口中,您可以输入表达式: *(float*)&foo ...它将显示foo作为float投射。

Visual Studio /SUBSYSTEM:POSIX not appearing in 2008

I have installed visual studio 2008 Professional Edition and I am not able to set /SUBSYSTEM:POSIX option in one of the visual C++ projects. I also installed Visual Studio Debugger addin from SUA but still same. Please see attached screenshot for version information. Thanks Niraj Rathi It's gone. However, Visual Studio does provide a bunch of header files to provide functionality that

Visual Studio / SUBSYSTEM:POSIX不在2008年出现

我已经安装了Visual Studio 2008专业版,并且我无法在其中一个Visual C ++项目中设置/ SUBSYSTEM:POSIX选项。 我也从SUA安装了Visual Studio Debugger插件,但仍然一样。 请参阅附件截图了解版本信息。 感谢Niraj Rathi 它消失了。 但是,Visual Studio确实提供了一堆头文件以提供接近(但不相同)的功能,例如目录操作的direct.h 。 目前,在Windows上获取POSIX的最佳方式可能是Cygwin或它的朋友。 有Windows服务的

level Unicode GUI Native apps in C++ for Windows/Linux/Mac

API-level Unicode GUI Native apps in C++ for Windows / Linux / Mac OS X. I am looking for writing a simple Unicode , GUI , Native , application, that can be run without need any non-standard library, written in C++ compiled with GNU-GCC (g++). NOT I don't mean one-code-source run-anywhere, but 3 (Win/Linux/Mac) code source! run-without-library (native application). * Native applicati

高级Unicode GUI用于Windows / Linux / Mac的C ++本机应用程序

API级别的Unicode GUI用于Windows / Linux / Mac OS X的C ++本机应用程序。 我正在寻找一个简单的Unicode , GUI , Native ,应用程序,它可以运行而无需使用GNU-GCC(g ++)编译的C ++编写的任何非标准库。 不 我并不是说任何一个代码源都可以运行,但是3(Win / Linux / Mac)代码源! 运行无库(原生应用程序)。 *原生应用程序 应用程序可以运行而不需要任何非标准库,只需要操作系统C ++运行时(如Windows上的M

Unnamed/anonymous namespaces vs. static functions

A feature of C++ is the ability to create unnamed (anonymous) namespaces, like so: namespace { int cannotAccessOutsideThisFile() { ... } } // namespace You would think that such a feature would be useless -- since you can't specify the name of the namespace, it's impossible to access anything within it from outside. But these unnamed namespaces are accessible within the file they&#

未命名/匿名命名空间与静态函数

C ++的一个特性是能够创建未命名(匿名)的命名空间,如下所示: namespace { int cannotAccessOutsideThisFile() { ... } } // namespace 你会认为这样的功能是无用的 - 因为你不能指定名称空间的名称,所以不可能从外部访问它的任何内容。 但是,这些未命名的命名空间可以在创建它们的文件中访问,就好像你对它们有一个隐含的使用子句。 我的问题是,为什么或什么时候使用静态函数更可取? 或者他们基本上是两种做同