Results 1 to 20 of 22

Thread: Lua into Qt

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2015
    Posts
    10
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Lua into Qt

    okay, in other words if I have such .pri file:

    HEADERS += ./lua/lauxlib.h \
    ./lua/lua.h \
    ./lua/lua.hpp \
    ./lua/luaconf.h \
    ./lua/lualib.h \
    ./newluaqt.h
    SOURCES += ./main.cpp \
    ./newluaqt.cpp
    FORMS += ./newluaqt.ui
    RESOURCES += newluaqt.qrc
    DEPENDPATH += .
    INCLUDEPATH += .
    INCLUDEPATH += C:/Lua
    LIBS += -LC:/Lua -llua53
    I can click "import .pri file" and everything will be ok?
    No. C:/Lua - there's lua53.dll and lua53.lib and the rest. And again the linker error...

    Maybe somebody can upload working project? I have just tried all that I can. I tried to follow every advise, but they weren't work. I dont know why it is so

  2. #2
    Join Date
    Oct 2009
    Posts
    483
    Thanked 97 Times in 94 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Lua into Qt

    Try to break down the problem into smaller ones:
    1. Get some project to compile and link with Lua. In order to do that, just pick ChrisW67's minimal example, and build it like you do usually, e.g. with qmake and make.
    2. Get some project to compile and link with Lua within Visual Studio. Import ChrisW67's minimal example in Visual Studio and try to build it.
    3. Get your own project to compile and link with Lua within Visual Studio. One possibility is to start with ChrisW67's minimal example and edit the .pro file. I can already see two potential issues with your last attempt: you wrote a .pri file, unlike ChrisW67 who wrote a .pro file. You forgot the TEMPLATE and TARGET clauses in your project file.

    How far you get on this list will hint at the root cause of your problem. And remember: when someone posts a minimal, working solution, please at least try it to rule out installation/configuration/PEBKAC causes. Ignoring valuable input will not get you anywhere on this forum.

  3. The following user says thank you to yeye_olive for this useful post:

    d_stranz (18th June 2015)

  4. #3
    Join Date
    Jun 2015
    Posts
    10
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Lua into Qt

    I haven't seen any working solution

  5. #4
    Join Date
    Oct 2009
    Posts
    483
    Thanked 97 Times in 94 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Lua into Qt

    Quote Originally Posted by Defake View Post
    I haven't seen any working solution
    Well, I haven't seen anyone doing my work for me either. Right now you have not told us anything about ChrisW67's minimal example. We are left to wonder in which of the following situations you are:
    • you have not bothered trying to import and build it, because you had rather let others take over and magically post a working version of your project, even if they do not have access to its sources and your particular configuration;
    • you have tried to import and build it, but it failed with some error message only you know about;
    • you have successfully imported and built it, but the same cannot be told of your project, due to some difference only you may know about.

    I understand how frustrating it can be to be stalled by such a problem, but please do not confuse this forum with commercial support. People are willing to help you, but you have to show interest in working out a solution with all the advice they provide. Do yourself a service and start interacting with them.

  6. #5
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,323
    Thanks
    316
    Thanked 871 Times in 858 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Lua into Qt

    I haven't seen any working solution
    I refer you to ChrisW67's post #11 in this thread.

    What more do you need? It's a complete example. Copy the code, paste it into files on your PC, make sure your Lua directory matches his, load the .pro file either into Qt Creator (directly) or into Visual Studio (using the Qt VS plugin import capability), compile it, and run it. If you can do that minimal thing (without once again trying to roll your own solution before trying this first), then go to work on modifying that example to do what you actually need to do.

  7. #6
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Lua into Qt

    Just for the record, I got the Lua binaries I show from the Lua web site in precompiled form.
    http://sourceforge.net/projects/luab...aries/Dynamic/
    You will need to match the Microsoft compiler version and bit-ness if you use these.
    If you compile your own then the paths may be different but the result the same.

    I do not have VS and plugin or I would spell it it out from that perspective.

  8. #7
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,323
    Thanks
    316
    Thanked 871 Times in 858 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Lua into Qt

    I do not have VS and plugin or I would spell it it out from that perspective.
    Given the .pro file you posted, the Qt plugin for VS will import it and create a working VS project file just fine. One almost never hand-edits a VS project file; it's always done through the GUI.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.