C++ Linking error with LUA menu

Shout-Out

User Tag List

Results 1 to 3 of 3
  1. #1
    Master674's Avatar Elite User
    Reputation
    487
    Join Date
    May 2008
    Posts
    578
    Thanks G/R
    2/23
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    C++ Linking error with LUA

    <something used to be here... its gone now>
    Last edited by Master674; 10-15-2012 at 12:55 PM.

    C++ Linking error with LUA
  2. #2
    _Mike's Avatar Contributor
    Reputation
    310
    Join Date
    Apr 2008
    Posts
    531
    Thanks G/R
    0/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Master674 View Post
    Hi, I'm trying to implement LUA into one of my applications.

    For that reason I downloaded "lua-5.2_Win32_vc10_lib.zip" from LuaBinaries - Browse /5.2/Windows Libraries/Static at SourceForge.net
    I want to link it directly to my project without dll so I choose static.

    My program looks as following:

    Code:
    #pragma comment( lib, "lua52.lib" )
    #include "include/lua.hpp"
    
    int main()
    {
        lua_State *L = luaL_newstate();
    
        return 0;
    }
    I put everything in my project solution as well (lib + include headers)

    However... The linker tells me: error LNK2001: unresolved external symbol @luaL_newstate@0

    Anyone knows whats wrong ?
    I'm using Visual Studio 11 Beta

    EDIT: lua 5.1 works perfect
    Going by the name decoration in the error message it sounds like it's trying to link using fastcall when it should be using cdecl. As to why though, I have no idea. The same headers + lib works for me using VS11 Developer Preview (which I think is older than Beta, cl.exe 17.00.40825.2 link.exe 11.00.40825.2)
    Maybe your project settings are wrong (default calling convention?) or it's some obscure compiler bug
    Last edited by _Mike; 05-08-2012 at 10:02 PM. Reason: typo

  3. #3
    Master674's Avatar Elite User
    Reputation
    487
    Join Date
    May 2008
    Posts
    578
    Thanks G/R
    2/23
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <something used to be here... its gone now>
    Last edited by Master674; 10-15-2012 at 12:54 PM.

Similar Threads

  1. [Question] Need help with Lua Script error
    By Rempage in forum WoW Bots Questions & Requests
    Replies: 0
    Last Post: 11-12-2016, 08:06 PM
  2. Error with a level npc.lua
    By _DEFiANT in forum WoW EMU Questions & Requests
    Replies: 10
    Last Post: 09-09-2008, 05:47 PM
  3. Error with creature. again....
    By jokerjokes in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 11-26-2007, 08:29 PM
  4. Error with vendors.
    By jokerjokes in forum World of Warcraft Emulator Servers
    Replies: 4
    Last Post: 11-26-2007, 02:40 AM
  5. Ac Ultimate Repack Error With Mysql
    By Greatdrak in forum World of Warcraft Emulator Servers
    Replies: 1
    Last Post: 10-03-2007, 08:35 AM
All times are GMT -5. The time now is 11:39 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search