• Advertisement
Sign in to follow this  

compiling luac "unresolved external symbol _luaP_opnames"

This topic is 4736 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i am trying to compile the lua compiler but i keep getting this error... --------------------Configuration: luac - Win32 Debug-------------------- Linking... print.obj : error LNK2001: unresolved external symbol _luaP_opnames Debug/luac.exe : fatal error LNK1120: 1 unresolved externals Error executing link.exe. luac.exe - 2 error(s), 0 warning(s) i have linked luacore and luastdlib correctly and i have googled it a couple of times and found out i need lopcodes.c but i still keep getting the same error... please help...

Share this post


Link to post
Share on other sites
Advertisement
For the lua compiler build, you'll need to define LUA_OPNAMES in the preprocessor under properties for that project. You might have to do a clean build afterwards, as depending on how you built your solution.

I have one solution, with both libraries, and compiler/interpreter in the one solution. And if you have it setup to put all the *.obj files under Debug/Release it'll see the built opcode.obj file from the library build and not build it for the lua compiler build. So what I like to do is have a them output the build files under Debug/(lua/luac/etc) and the same for Release/(lua/luac/etc).

HTH

Share this post


Link to post
Share on other sites
Some more info for the unintuitive:

If you open up lopcodes.c, you will see where LUA_OPNAMES needs to be defined.

So, in your MSVC C/C++ project options, add this line:

/D "LUA_OPNAMES"

Then recompile your library.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement