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 8831413
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T08:18:12+00:00 2026-06-14T08:18:12+00:00

I have successfully added Lua to a default Xcode template project by following the

  • 0

I have successfully added Lua to a default Xcode template project by following the process described by this very helpful post, and got the "Hello, world." text printing.

However, when I try to add Lua to my existing Cocos2D/Box2d project, following exactly the same process, I get a compile error:

Undefined symbols for architecture i386:

"luaL_newstate()", referenced from
…

My search results on this error refer to one of these possible problems, which I think are OK in my case:

  • The target’s Build Phases -> Compile Sources – but the same Lua.c files are in both the default template project and my Cocos2D/Box2d project
  • I set the header search paths of the default project to match those in the Cocos2D/Box2d project, and the template still compiles fine.
  • All the frameworks used by the template project are also in my Cocos2D/Box2d project.

What am I missing?

Any help would be much appreciated. Thanks!

  • 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-14T08:18:13+00:00Added an answer on June 14, 2026 at 8:18 am

    I’ve done this integration recently, and the problem that you have there is that the Lua files are written in C, and Box2D is C++.

    You will need to wrap the Lua includes like that:

    #ifdef __cplusplus
    extern "C" {
    #include "lua.h"
    #include "lualib.h"
    #include "lauxlib.h"
    }
    #endif
    

    That should fix the issues, if not post a comment with the error you are getting.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have successfully added other .dll files to other C# project this way: Right
I have a png icon, it's added successfully in my project, but not included
i have successfully added input element into div, which looks like this : $(document).ready(function()
I've just followed this example from Wordpress and I have successfully added an extra
Has anyone of you successfully added a lexer to scintilla? I have been following
I have successfully added a custom font to my project and it works just
I have successfully added information to shapefiles before (see my post on http://rusergroup.swansea.ac.uk/Healthmap.ashx?HL=map ).
I am building an Android app using phoneGap and I have successfully added the
I have successfully added and used a Get action in my new REST-service in
I have a 3rd party .dll that I have successfully added as a reference

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.