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

  • Home
  • SEARCH
  • 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 8104843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T23:59:26+00:00 2026-06-05T23:59:26+00:00

Problem: $ clang++ -L../lib/osx/ -I../include/ -o test Script.cpp Main.cpp Verbose.cpp -llua -lUnitTest++ Undefined symbols

  • 0

Problem:

$ clang++ -L../lib/osx/ -I../include/ -o test Script.cpp Main.cpp Verbose.cpp -llua -lUnitTest++
Undefined symbols for architecture x86_64:
  "_lua_pcall", referenced from:
      LuaSystem::dostring(char const*) in Script-EgY0dM.o
     (maybe you meant: _lua_pcallk)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Let’s look at my lua build:

$ cd src/
stevenlu443@steven-mba(Jun 09 02:41:58)[~/Downloads/lua-5.2.0/src]
$ ls
Makefile   lcorolib.c ldump.o    llex.o     lopcodes.o ltable.c   luac.c
lapi.c     lcorolib.o lfunc.c    llimits.h  loslib.c   ltable.h   luac.o
lapi.h     lctype.c   lfunc.h    lmathlib.c loslib.o   ltable.o   luaconf.h
lapi.o     lctype.h   lfunc.o    lmathlib.o lparser.c  ltablib.c  lualib.h
lauxlib.c  lctype.o   lgc.c      lmem.c     lparser.h  ltablib.o  lundump.c
lauxlib.h  ldblib.c   lgc.h      lmem.h     lparser.o  ltm.c      lundump.h
lauxlib.o  ldblib.o   lgc.o      lmem.o     lstate.c   ltm.h      lundump.o
lbaselib.c ldebug.c   liblua.a   loadlib.c  lstate.h   ltm.o      lvm.c
lbaselib.o ldebug.h   linit.c    loadlib.o  lstate.o   lua        lvm.h
lbitlib.c  ldebug.o   linit.o    lobject.c  lstring.c  lua.c      lvm.o
lbitlib.o  ldo.c      liolib.c   lobject.h  lstring.h  lua.h      lzio.c
lcode.c    ldo.h      liolib.o   lobject.o  lstring.o  lua.hpp    lzio.h
lcode.h    ldo.o      llex.c     lopcodes.c lstrlib.c  lua.o      lzio.o
lcode.o    ldump.c    llex.h     lopcodes.h lstrlib.o  luac
stevenlu443@steven-mba(Jun 09 02:41:59)[~/Downloads/lua-5.2.0/src]
$ nm liblua.a | grep _lua_pcall
115:0000000000001a30 T _lua_pcallk
116:0000000000003b40 S _lua_pcallk.eh
1563:                 U _lua_pcallk
1839:                 U _lua_pcallk
stevenlu443@steven-mba(Jun 09 02:42:12)[~/Downloads/lua-5.2.0/src]
$ nm *.o | grep _lua_pcall
115:0000000000001a30 T _lua_pcallk
116:0000000000003b40 S _lua_pcallk.eh
597:                 U _lua_pcallk
977:                 U _lua_pcallk
2630:                 U _lua_pcallk
2760:                 U _lua_pcallk

Why does _lua_pcall not exist? The 5.2 doc seems to say pcallk does the same as pcall but has the benefit of being able to yield but pcall should still be available…

UPDATE: I just realized I am trying to link to 5.2 using older (5.1?) headers… Does anybody know where there is a list that says which headers are necessary? I don’t need all the headers from the Lua source.

We can infer from what we’ve seen here that in 5.2 pcall is implemented using _lua_pcallk.

  • 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-05T23:59:27+00:00Added an answer on June 5, 2026 at 11:59 pm

    To compile programs that use the Lua C API, you need to include lua.h and frequently also lauxlib.h and sometimes lualib.h.

    When you change the version of Lua, say from 5.1 to 5.2, you need to recompile your program. When you change releases of the same version, say from 5.1.4 to 5.1.5, you don’t need to recompile, just relink.

    Of course, in all cases, make sure you use consistent headers and libraries, that is, do not mix headers and libraries from different versions or releases.

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

Sidebar

Related Questions

Newbie-Problem: I have a small test-class (TestLibMain.cpp) in c++ an compiled it to a
While compiling I received 2 errors.. Undefined symbols for architecture i386: _IKImageBrowserNSURLRepresentationType, referenced from:
Problem Given a boolean expression consisting of the symbols 0, 1, &, |, ^
i guys i have a problem, i want to run a haskell script that
Problem: Been struggling to get my code to load external shaders and it is
Problem: I've written State Machine for my android application. It is separate class, extension
Problem: I have a table that prints out vertical but I would like it
Problem in MATLAB Code for solving desired 'n' number of simultaneous equations of the
Problem: I am trying to build a recursive tree using a function and data
Problem: I'm streaming my video from a php file with stream_get_contents(); using Flowplayer as

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.