이전 블로그글
LUA Embedding 2005-07-08 10:51 카테고리 : 3D/엔진/Develop

 LUA는 가볍다는 이유(?)로 요즘 게임 개발에 대표적 스크립트가 되고 있다.

이전에는 Python이 주로 사용되었는데, LUA가 더 작다는 이유에서 이다.

문제는 이녀석이..-_-;;; static lib 로 만들어서 링크를 걸어주면...

살포시 링크에러가 난다.

LNK2019: "void __cdecl lua_close(struct lua_State *)"

대충 이런식인데... MSDN에 보면

Symbol definitions are in a file that was compiled as a C program and symbols are declared in a C++ file without an extern "C" modifier. In that case, modify the declaration, for example, instead of: extern int i;
extern void g();

  • use:

    extern "C" int i;
    extern "C" void g();

    Similarly, if you define a symbol in a C++ file that will be used by a C program, use extern "C" in the definition.

  • 결론적으로, 심볼을 인식하는게 C/C++이 달라서 그렇다라는 거다.

    일일이 따라가서 extern "C"를 붙여주는 것도 좋지만,

    extern "C" {

    #include "lua.h"
    #include "lualib.h"
    #include "lauxlib.h"
    }

    이렇게 바꾸어 주고, 링크를 걸면 OK 란다.

    by ArchAngel | 2005/12/04 19:08 | Diary | 트랙백
    트랙백 주소 : http://terry51.egloos.com/tb/998726
    ☞ 내 이글루에 이 글과 관련된 글 쓰기 (트랙백 보내기) [도움말]
    ※ 로그인 사용자만 덧글을 남길 수 있습니다.


    < 이전페이지 다음페이지 >