   Lua can't find MSVCR90.dll even though I put it in system32
  So I compiled lua exactly how they tell you do but when I try adding lua to my program it can't find MSVCR90.dll even though I put it in system32, project folder and countless other places. What should I do!?   
  1. Don't put DLLs in your system directory, the OS will throw a hissy fit.2. use the Microsoft Visual C++ 2008 Redistributable Package to install the VS2008 runtimes.3. What's the exact error you get? How are you "adding lua to your program"? Are you compiling the code? As a DLL?   ;Quote:Original post by Evil Steve1. Don't put DLLs in your system directory, the OS will throw a hissy fit.2. use the Microsoft Visual C++ 2008 Redistributable Package to install the VS2008 runtimes.3. What's the exact error you get? How are you "adding lua to your program"? Are you compiling the code? As a DLL?I compiled it like this and I just added the headers and made a reference to the libs but as soon as I try to do anything with it, it gives me this error "This application has failed to start because MSVCR90.dll was not found. Re-installing the application may fix this problem." Also the Redistributable Package didn't help.   ;Quote:Original post by EmptyVoidQuote:Original post by Evil Steve1. Don't put DLLs in your system directory, the OS will throw a hissy fit.2. use the Microsoft Visual C++ 2008 Redistributable Package to install the VS2008 runtimes.3. What's the exact error you get? How are you "adding lua to your program"? Are you compiling the code? As a DLL?I compiled it like this and I just added the headers and made a reference to the libs but as soon as I try to do anything with it, it gives me this error "This application has failed to start because MSVCR90.dll was not found. Re-installing the application may fix this problem." Also the Redistributable Package didn't help.So you compiled it from source - did you compile it as a DLL, a static library, or directly into your application (By adding all the file to your project)? Are you running the app on the same machine it was compiled on?   ;Quote:Original post by Evil SteveQuote:Original post by EmptyVoidQuote:Original post by Evil Steve1. Don't put DLLs in your system directory, the OS will throw a hissy fit.2. use the Microsoft Visual C++ 2008 Redistributable Package to install the VS2008 runtimes.3. What's the exact error you get? How are you "adding lua to your program"? Are you compiling the code? As a DLL?I compiled it like this and I just added the headers and made a reference to the libs but as soon as I try to do anything with it, it gives me this error "This application has failed to start because MSVCR90.dll was not found. Re-installing the application may fix this problem." Also the Redistributable Package didn't help.So you compiled it from source - did you compile it as a DLL, a static library, or directly into your application (By adding all the file to your project)? Are you running the app on the same machine it was compiled on?It compiled out into lua.h, lauxlib.h, luaconf.h, lualib.h, lua5.1.lib, lua5.1-static.lib, lua.exe, lua5.1.dll and luac.exeI included the headers, then added lua5.1.lib and lua5.1-static.lib to the additional dependencies. I then added lua5.1.dll to my projects root folder, added this to my projects code:    lua_State *L = lua_open(); luaL_openlibs(L); luaL_dostring(L,""); lua_close(L);  Then when I run it, it reports the error.   ;Quote:Original post by EmptyVoidIt compiled out into lua.h, lauxlib.h, luaconf.h, lualib.h, lua5.1.lib, lua5.1-static.lib, lua.exe, lua5.1.dll and luac.exeI included the headers, then added lua5.1.lib and lua5.1-static.lib to the additional dependencies. I then added lua5.1.dll to my projects root folder, added this to my projects code:*** Source Snippet Removed ***Then when I run it, it reports the error.You only want to link to the lib OR the dll. The static lib file contains the same as the DLL, so you want to link to either lib file, not both.Also, did you create the project yourself, or are you using a project file (.sln and .vcproj) from somewhere else, or an upgraded / converted project?EDIT: And are you running your app via the IDE rather than the command line?   ;Quote:Original post by Evil SteveQuote:Original post by EmptyVoidIt compiled out into lua.h, lauxlib.h, luaconf.h, lualib.h, lua5.1.lib, lua5.1-static.lib, lua.exe, lua5.1.dll and luac.exeI included the headers, then added lua5.1.lib and lua5.1-static.lib to the additional dependencies. I then added lua5.1.dll to my projects root folder, added this to my projects code:*** Source Snippet Removed ***Then when I run it, it reports the error.You only want to link to the lib OR the dll. The static lib file contains the same as the DLL, so you want to link to either lib file, not both.Also, did you create the project yourself, or are you using a project file (.sln and .vcproj) from somewhere else, or an upgraded / converted project?EDIT: And are you running your app via the IDE rather than the command line?I build lua just like the manual I linked told me to."Although Lua compiles cleanly on Windows, the makefile that comes with the Lua source package isoriented toward Unix-style systems. Unless you are using a Unix emulation layer such as Cygwin, you’llneed to craft your own approach to the task of creating the Lua interpreter and byte-code compiler.A lot of C/C++ compilers exist for Windows, and many of them are available for free. The tools in theseSDKs generally have their own particular set of command line switches, configuration conventions, andsystem dependencies, making it impractical to cover more than one Windows SDK in this book. Theinstructions in this book assume you are using the Microsoft Visual C++ 6.0 SDK. Later versions of thiskit have been released, but Visual C++ 6.0 is still widely used in the industry because of its support for abroad range of Windows versions. You can configure it to generate programs that use MSVCRT.DLL, asystem library that is available on all 32-bit desktop versions of Windows. An effort has been made inthis book to provide instructions that will generate applications and libraries that are compatible withthe Lua binaries for Windows available on LuaForge. These binaries are easy to deploy, because theydepend only on libraries that come with Windows.If you have a later version of Visual C++ or are using another SDK (such as a product from Pelles C orBorland) you will need to consult the appropriate documentation to find how to build and deploy applicationsand libraries. Recent versions of the Microsoft C++ SDK require manifest files to be deployedalong with applications and libraries.The directions that follow create the Lua interpreter and compiler. Three approaches are shown. The firstworks well with Visual C++ 6.0. If you are some other large-scale C development system, follow thesedirections with the understanding that you may need to make toolkit-specific changes. The secondapproach is suitable for users of TCC, and the third applies to the MinGW SDK.First, make sure that the SDK’s bin directory has been included in your system’s search path. Under theSDK’s include directory, make a subdirectory named usr. Similarly, under the SDK’s lib directory,make a subdirectory named usr. Additionally, as covered in the environment section, you should set theLIB environment variable to the SDK’s lib and lib\usr directories, and the INCLUDE environmentvariable to the SDK’s include and include\usr directories. Your SDK may include a batch file namedvcvars32.bat that can help with this. If you modify these environment variables, exit and restart theshell to have your changes take effect.Create a directory in which to build Lua. The following lines assume that this will be c:\dev:c:cd mkdir devcd devDownload lua-5.1.1.tar.gz and place it in this directory. Extract the contents. Here are the commandsyou would use with 7-zip:7z x lua-5.1.1.tar.gz7z x lua-5.1.1.tarThis creates a subdirectory named lua-5.1.1. Delete lua-5.1.1.tar at this point, like this:del lua-5.1.1.tarDrop into the src subdirectory like this:cd lua-5.1.1\srcCreate a new text file and add the following lines:cl /MD /O2 /W3 /c /DLUA_BUILD_AS_DLL *.cdel *.oren lua.obj lua.oren luac.obj luac.oren print.obj print.olink /DLL /IMPLIB:lua5.1.lib /OUT:lua5.1.dll *.objlink /OUT:lua.exe lua.o lua5.1.liblib /out:lua5.1-static.lib *.objlink /OUT:luac.exe luac.o print.o lua5.1-static.libSave the file as build.bat in the current directory (c:\dev\lua-5.1.1\src).While you’re still in the src subdirectory, run the newly created batch script from the shell:buildThis compiles each of the source files into a corresponding object file. Prior to linking these object filesinto a dynamic link library, three object files are renamed to keep them from being included in thelibrary. These are the interpreter, the compiler, and a support file for the compiler. Finally, the interpreterand compiler executables are created. The Lua interpreter is quite small, because its main functionalitycomes from the dynamic link library. To test the Lua interpreter, execute the following command:.\lua ..\test\hello.luaThis should result in the following output:Hello world, from Lua 5.1!Copy the import library and header files associated with the dynamic-link library to standard developmentdirectories where your compiler and linker can find them. The approach taken here is to placethem in the usr subdirectory beneath the SDK’s lib and include directories. These subdirectories canthen hold third-party files where they won’t be confused with toolkit files.To install Lua, create a file with the following contents:xcopy lua5.1.lib “%SDK_DIR%\lib\usr\*.*” /yxcopy lua5.1-static.lib “%SDK_DIR%\lib\usr\*.*” /yxcopy lua.exe “%UTIL_DIR%\*.*” /yxcopy luac.exe “%UTIL_DIR%\*.*” /yxcopy lua5.1.dll “%UTIL_DIR%\*.*” /yxcopy lua.h “%SDK_DIR%\include\usr\*.*” /yxcopy luaconf.h “%SDK_DIR%\include\usr\*.*” /yxcopy lualib.h “%SDK_DIR%\include\usr\*.*” /yxcopy lauxlib.h “%SDK_DIR%\include\usr\*.*” /ySave this file as install.bat in the src directory. Copy the files by executing this batch script:install"My engine project is Tutorial 08 form the DX SDKs with heavy modifications.I also just noticed it sad this is for VS 6.0...   ;  Yeah, I'd stay well clear of any tutorial that says VC 6.0 is recommended or is widely used in the industry.Personally, I just create a new static lib project and chuck all of the relevant files in, and it compiles fine. I take out the ones I don't need (E.g. the luac.exe files), but it should be obvious which ones they are (You'll get linker errors if you try to use them I believe).   ;Quote:Original post by Evil SteveYeah, I'd stay well clear of any tutorial that says VC 6.0 is recommended or is widely used in the industry.Personally, I just create a new static lib project and chuck all of the relevant files in, and it compiles fine. I take out the ones I don't need (E.g. the luac.exe files), but it should be obvious which ones they are (You'll get linker errors if you try to use them I believe).OK I got it to work, thanks Steve!   