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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:06:04+00:00 2026-05-27T18:06:04+00:00

my code inline int DOFILE(string& filename) { printf(lua_open\n); /* initialize Lua */ lua_State* L

  • 0

my code

inline int DOFILE(string& filename) {

  printf("lua_open\n");
  /* initialize Lua */
  lua_State* L = lua_open();

  printf("lua_openlibs\n");
  /* load Lua base libraries */
  luaL_openlibs(L);

  printf("lua_dofile\n");
  /* run the script */
  int ret = luaL_dofile(L, filename.c_str());

  printf("lua_close\n");
  /* cleanup Lua */
  lua_close(L);

  return ret; 
}

compile options:

obj.cxxflags = ["-g", "-D_FILE_OFFSET_BITS=64", "-D_LARGEFILE_SOURCE", "-Wall", "-llua-5.1"]

also tried ‘-llua’, ‘-llualib’, all of them report warning

i686-apple-darwin11-llvm-g++-4.2: -llua-5.1: linker input file unused because linking not done

When I run, it report:

lua_open
dyld: lazy symbol binding failed: Symbol not found: _luaL_newstate
  Referenced from: /Users/gl/workspace/node-lua/build/Release/node_lua.node
  Expected in: flat namespace

dyld: Symbol not found: _luaL_newstate
  Referenced from: /Users/gl/workspace/node-lua/build/Release/node_lua.node
  Expected in: flat namespace
  • 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-05-27T18:06:05+00:00Added an answer on May 27, 2026 at 6:06 pm

    You should be using the obj.ldflags parameter for libraries.

    The build tool you are using produces its binaries in two steps:

    1. compile
    2. link

    The compile step uses the obj.cxxflags compiler flags. Libraries are not needed to compile, so passing linker flags (-lfoo) in there is no useful – the compiler doesn’t use them at all (hence the warnings).

    The link step should use both obj.cxxflags and obj.ldflags. (ld is the name of the linker.)

    (It is not uncommon for very simple code to do both compiling and linking at the same time, e.g. with g++ -o thing thing.cpp -lpthread. But for larger builds, separating compiling and linking is usual.)

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

Sidebar

Related Questions

Is there any difference to the following code: class Foo { inline int SomeFunc()
Will this code: inline int funcA(int a) __attribute__((always_inline)) { return a + 1; }
i have some code(inline assembly). void NativeLoop() { int m; __asm { PUSH ECX
There is such code: int fun1(){ return 2 + 3; } inline int fun2(){
that's the code: static inline void shrinkData(const vector<Data> &data, unsigned short shrinkType){ #define CASE_N(N)
i use some code for inline cell editing from Apples TaggedLocations Example and im
Why don't we get compile errors on inline code errors in asp.net mvc views
Can anyone explain why you can’t use inline code blocks within server control declarations
Here is the pseudo-code for my inline query in my code: select columnOne from
Let's assume my ASPX page has no inline C# code blocks. So, I can

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.