Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The problem is that you have named the libraries on the link command line <em>before</em> the object files that require them. The linker loads modules from left to right on the command line. At the point on the line where you name <code>-llua51</code>, no undefined symbols that could be satisfied by that library are known. Then you name <code>li.o</code>, which does have unknown symbols.</p> <p>Some Unix-like environments don't treat this as an error because part of the link process is deferred to the program load when reference to <code>.so</code> files are satisfied. But Cygwin, MinGW, and Windows in general must treat this as an error because DLLs work quite differently from <code>.so</code> files.</p> <p>The solution is to put <code>-llua51</code> <em>after</em> all the <code>.o</code> files on your link line.</p> <p><strong>Edit:</strong> Incidentally, it appears you are linking against the Lua for Windows distribution, but building with GCC under Cygwin. You will want to use <a href="http://www.dependencywalker.com/" rel="noreferrer">Dependency Walker</a> to make sure that your program does not depend on the Cygwin runtime, and that it does depend on the same C runtime as the lua51.dll from Lua for Windows. IIRC, that will be the runtime for the previous version of Visual Studio. It is possible to make GCC link against that, but you will need to be using the MinGW port (which you can use from Cygwin), and link against a couple of specific libraries to get that version. I'm away from my usual PC, or I'd quote an exact link line. (I believe you need <code>-lmoldname -lmsvcr80</code> or something like that, as the last items on the link line.)</p> <p>It will cause mysterious and very hard to diagnose problems if more than one C runtime library is in use. The easy answer is to use the same one as your preferred Lua DLL. Another alternative is that the <a href="http://luabinaries.sourceforge.net/" rel="noreferrer">Lua Binaries project</a> has pre-compiled Lua DLLs for a wide array of C toolchains on Windows. If you need a Lua application that understands the Cygwin environment, you will want one that is built by GCC for Cygwin and not the Lua for Windows flavor. Lua Binaries will be your friend, or you can build Lua your self from source.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload