문제

I wrote an app with luajit and lua-iup, and link my app with static libs. But I got the following error:

------ Build started: Project: ConsoleApplication1, Configuration: Release Win32 ------
     Creating library C:\Users\root\Documents\Visual Studio 2012\Projects\ConsoleApplication1\Release\ConsoleApplication1.lib and object C:\Users\root\Documents\Visual Studio 2012\Projects\ConsoleApplication1\Release\ConsoleApplication1.exp
iup.lib(iupwindows_main.obj) : error LNK2001: unresolved external symbol _main
C:\Users\root\Documents\Visual Studio 2012\Projects\ConsoleApplication1\Release\ConsoleApplication1.exe : fatal error LNK1120: 1 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Am I missing some libs and any idea about this?

도움이 되었습니까?

해결책 2

Here is the answer form the author of IUP, hope this would be helpful to someone that met the same problem as me

It seems that you are building a console application. This means you need a “main” function. If you try instead to build a Windows application without a console, then IUP will implement the WinMain function for you and call your “main” function. In both cases you need the “main” function.

다른 팁

As far as I know, IUP's Lua bindings are partially written in Lua. That wouldn't ordinarily be a problem, except that the Lua parts are compiled into the library as pre-compiled bytecode. Lua bytecode and LuaJIT bytecode are different.

The right answer is to change IUP so that it builds with Lua source compiled in rather than bytecode. That will conceivably slow down the startup of an IUP application, but it will make it easier to cross compile IUP and make it possible to use LuaJIT instead of standard Lua.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top