Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7892779
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T06:57:11+00:00 2026-06-03T06:57:11+00:00

I am using luabind and I want to make this lua code work. print(hello..welcome

  • 0

I am using luabind and I want to make this lua code work.

print("hello..welcome to lua\n")
base:PrintMe("printing from base" )

From c++, I want to assign the lua global variable “base” as a pointer to “Base” class.

class Base {
public:
void PrintMe(const char *s) { ... }
};

Using Luabind I can bind the Base class. I am creating a Base class object in c++.
I want to push this pointer to lua and use it as lua global variable “base” as seen in the lua code above.

Can someone please help me, the most easiest way to do this (using luabind itself if possible) ??
I have tried pushing it as a lightuserdata, but the PrintMe is not getting called from lua.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T06:57:12+00:00Added an answer on June 3, 2026 at 6:57 am

    This line will take care of the issue 🙂

    globals(ls) ["base"] = baseObjPtr;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Luabind to expose a base class from C++ to Lua from
I'm having problems making Lua & Luabind work under Windows 7 using VS 2010.
I am currently having problems using Luabind to interface a Lua scripted AI with
I'm trying to export a simple class to Lua using LuaBind. I took the
all. I got a stranger problem by using luabind to read a array from
The luabind documentation says to call a Lua-derived virtual member from C++, you create
Using this code, the following execution yields strange results: C 100 R W The
using xmltextreader, how would I load a hashtable. XML: <base><user name=john>2342343</user><user name=mark>239099393</user></base> This was
Using restlet, I want to make a post to android's c2dm service. I have
I'm using Luabind to integrate LUA into one of my projects, and the following

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.