Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

Tagged with
1 vote
1 answer
85 views

Building Visual Studio solution with C and C++

I'm wondering if I can add a C file to a C++ project. I use premake5 and conan to get the dependencies and build the solution but every file I've used so far is C++. Now, I need a C file that has a ...
agutier2's user avatar
0 votes
0 answers
42 views

Premake5 - cppdialect is ignored while creating project for VS2022

I'm trying to compile Sciter from a command line batch, using the Visual Studio 2022 compiler. For that reason I need to generate the VS2022 projects using Premake5. However Sciter needs to be ...
Jean-Milost Reymond's user avatar
0 votes
0 answers
23 views

Error parsing config from lua tables in boost unit test

Config file are read from my project directory, each of them run normally when I execute the main project target. I have an issue running a test case. I'm using sol2 from here as the lua-managing ...
SagunKho's user avatar
  • 1,033
0 votes
0 answers
30 views

Passing Lua expression to interpreter from C++

I'm working on building a C++ hook into a game that uses a Lua 5.1 interpreter internally for game functions. Currently, I've identified the common functions that I can use to get the internal lua ...
Surasia's user avatar
  • 13
0 votes
0 answers
56 views

Using Lua FFI in dnsdist

How can i use Lua FFI for LuaFFIAction() in my dnsdist's configuration file? In doc: Invoke a Lua FFI function that accepts a pointer to a dnsdist_ffi_dnsquestion_t object, whose bindings are defined ...
Nikita Onin's user avatar
1 vote
0 answers
172 views

Lua 5.1 bitwise operations using arithmetic for 64bit numbers

Lua 5.1 does not yet support bitwise operators. The Lua environment I'm using is restricted and provides a bit32 library that allows bitwise operations with 32-bit numbers. The issue is that I'm ...
neth's user avatar
  • 19
1 vote
0 answers
254 views

Unable to load simple DLL module with Lua 5.4: "The specified module could not be found"

I'm trying to create a DLL module to be required by a Lua 5.4 script (64-bit Windows). I've created a simple DLL in Visual Studio based on the few examples I was able to find, however when I try to ...
user avatar
0 votes
1 answer
69 views

Share data(variables) between lua callback functions in C++

how I can share/access some data inside several lua callback functions in C++? I know that I can use global c++ variables or some singleton but I don't want to use that. Hypotetic sample: static int ...
marukas's user avatar
0 votes
1 answer
84 views

Using multiple Lua scripts with c++

I'm trying to use lua with my c++ program and when I look up for how to use multiple lua script with I found this result https://stackoverflow.com/a/61684333/22979136 I modified this result and ...
Codyea's user avatar
  • 1
0 votes
0 answers
52 views

Register composed structs with luabridge

I've the following GlobalStruct struct that I want to parse from a lua table: namespace N1 { struct DetailedStruct { int i1; int i2; }; } namespace N2 { struct GlobalStruct { int i1; N1::...
Jepessen's user avatar
  • 12.2k
0 votes
0 answers
60 views

How to get the functionality of one lua environment from another

I am involved in the development of a startup and our team is faced with the following problem. We have several lua environments in our C++ application, one environment runs on sol3, and the other is ...
noob_proger's user avatar
0 votes
0 answers
256 views

Using Sol2 to expose an interface to Lua and implementing the method in Lua

I am using the sol2 library to create a set of C++ class wrappers. About 10 years ago, I did the same with luabind and, as far as I remember, it was quite straightforward. However, now I want to use ...
Rodrigo's user avatar
  • 235
2 votes
1 answer
253 views

How to get better performance out of Lua when iterating array of structs

Problem: Iterating an array of structs in Lua and manipulating the data, that is than used in C++ later on. Backstory: I did some performance testing this week and I am kind of disappointed by the ...
thegabman's user avatar
0 votes
0 answers
171 views

Crash when passing a Lua function as a callback, works well with C++ lambdas

EDIT: Calling fn on set works, the Lua function is called. The problem is on the timer's callback. I suspect this conversion[*] from "std::function" to "void *" is the problem. &...
Rodrigo's user avatar
  • 235
1 vote
1 answer
233 views

Convert Lua array to C array when C function takes multiple inputs

I'm trying to figure out the interaction between Lua and C where a C function takes multiple inputs, one being a Lua array. Other articles on StackOverflow cover only an array being passed in to C, ...
user2205930's user avatar
  • 1,076

15 30 50 per page
1
2 3 4 5
96