I have been trying to do this for about a week with no good anyhow. I am building a .dll (UNDONE Engine .dll) that depends upon Assimp to load models. The .dll compiles and links with no problems at all, but when I try to use it with some application, I get the following error:
'Test_Game.exe' is the application I made that uses the .dll library that is using assimp.
I downloaded assimp from the sourceforge repository. I got the version 3.0 SDK for windows, installed it and I did do whatever was nessesary to get the project linked.
Here is how the directory with the .exe looks like:
I have included the right bitness of the lib, that is 32 bit versions.
Why does it not work? Is there some internal bug inside Assimp which prevents me from using it? Or is there something I am missing? Is it causing problems because i am using it from a dll? Can you please get me through the steps to install and use properly? I use visual studio 13.
EDIT
After running Dependency walker over my exe, I get this:
And I have very less idea of what that means, but, just guessin, does it mean that assimp.exe has some undefined functions?
What depends.exe is telling you is that undone_engine.dll's import table includes an entry for AssImp.exe, which includes an entry for the function ??0Importer#AssImp##QAE#XZ and some friends. Windows then expects to find the functions ??0Importer#AssImp##QAE#XZ and friends in the export table of AssImp.exe.
Depends is also telling you that there is nothing in the export table of AssImp.exe, which is unsurprising, as exe's seldom export anything. Interestingly, it's also telling you that assimp.exe imports assimp32.dll.
You're probably intending to link with assimp32.lib, not assimp.lib. (#Dirk hints at this in the comments; I suspect he's nailed it.) Do you have an assimp32.lib that you could try linking against instead of assimp.lib?
I wonder if AssImp32.dll imports code from the static library ButtGremlin.lib? /twelveyearold
Related
I am trying to make a "hack" for a really old game. My dll injector does not resolve dll import and everything work just fine except D3DCompile function that is causing access violation. After long debugging session I figured out that it is causing this error because my code is referencing to d3dcompiler_47.dll but game has only d3dcompiler_43.dll in it. My question is where can I get corresponding libraries that will (after including to project) use d3dcompiler_43.dll?
Only thing that I have found was a dll D3DCompiler_43.dll which was inside Jun2010_D3DCompiler_43_x64.cab.
Where can I find the header files and lib files for this d3d compiler version?
EDIT: Found all files in Unreal Engine source code.
D3DCompiler is normally part of the windows SDK, which can be found at here. Note that if your game is old enough you may need to download an older version of the SDK (if it uses Direct3D 9 or earlier for example) but I can't tell you exactly how far back you would need to go.
This only happens when I open a specific code in a project. Any other project on my computer using SDL2_mixer.dll is working just fine.
I've tried to put the .dll in the system file, but then this error code appears "0xc000007b".
I've tried to reinstall VS (I'm using 2017 version) and nothing.
I would really appreciate some help in this matter.
Thank you.
Try put dll in folder with executable file.
Try to build that library for your machine -
https://www.libsdl.org/projects/SDL_mixer/
Try bit another version of library.
Check library decencies. Possibly you not have 3rd party
libraries required for that library.
So I've finished my Qt application, and I need to implement testing using the Squish testing application (first time using). Apparently I require a working exe file, but I can't get the executable to run. I added all the .dll files to the same directory, only to get the error:
Prior to that I was getting errors saying that XXXX.dll is missing, but like I said, I've added them to the directory. I've tried using both debug and release builds of my project with the same results. I've also tried building a stand-alone executable, but that has it's own problems (one thing at a time). The program runs great in Qt Creator and VS2013...just not on its own.
Any solutions to this?
EDIT:
From Dependency Walker...
0x7B is the error code for invalid image format.
You're either trying to run a 64-bit application on a 32-bit system, or linking to a 64-bit library (ie you copied the wrong DLLs).
Or your binaries are just corrupted.
If you run the application standalone (i.e. not from Qt Creator) you also need the Qt library DLLs. which one you need, depends on the components you are using.
Dependency Walker is also a useful tool to find missing DLLs under Windows.
As for me it seems that something is missing. Qt on windows has the script windeployqt, it will provide all needed dependencies. See documentation http://doc.qt.io/qt-5/windows-deployment.html about use of this. On Windows you will be able to run cmd with loaded qt environment variables ( on Windows 7 see under windows applications menu - it will be available if qt is installed ). As Simon stated Dependency Walker is good tool.
My basic issue is this: my program (MyProgram.exe) has a dependency on a DLL from another program (OtherProgram), and I'm trying to avoid repackaging a new DLL every time OtherProgram updates. I'd like to have MyProgram.exe link in OtherProgram's DLL when it launches, but I'm not completely sure that Windows allows for this. So if there is some kind of workaround that would also be acceptable.
And just for some background, the platform is Windows 7 x64, and MyProgram.exe runs fine when I create a symlink in the MyProgram.exe project directory to the DLL in OtherProgram's install directory. When I try to run it without the symlink, I get the "program can't start because OtherProgramDLL.dll is missing from your computer" error.
Any advice or links to relevant info is greatly appreciated!
EDIT: Clarification: the DLL is not linked at compile-time, this issue crops up at runtime
There are two types of dynamic linking in the Windows world:
Load-Time linking is when a DLL is loaded automatically when your program starts up. Windows finds this DLL using a specific algorithm I'll discuss below.
Run-Time linking is when you specifically load a DLL by calling LoadLibrary in your code. Similar rules apply as to how the library is found, but you can specify a fully-qualified or relatively-qualified path to control the search.
In the case of Load-Time linking, MS recommends that your program's DLLs are stored in and loaded from the same directory where your application is loaded from. If this is at all workable, this is probably your best option.
If that doesn't work, there are several other options, outlined here. One is to leverage the search order by putting the DLL in either the working directory or the directory where the application was loaded from.
You can change the working directory of an application by:
Create a shortcut to your application.
Bring up the shortcut's properties
Edit the "Start in" property with the directory where the DLL is located.
When you launch your application using the shortcut, it will load the right DLL.
Other options for load-time linking include:
Adding a manifest to your application which specifies where your dependent assemblies are, or,
Setting the PATH.
You could use LoadLibrary, but you would need a way to guarantee the DLL's location. This Wikipedia article provides good example on how to use the DLL after it has been loaded.
You can add the directory where the dll is located to the PATH environment variable.
I have struggled with the same problem and also found a dead end with the suggested methods like LoadLibrary, SetDllDirectory, Qt's addLibraryPath and others. Regardless of what I tried, the problem still remained that the application checked the libraries (and didn't find them) before actually running the code, so any code solution was bound to fail.
I almost got desperate, but then discovered an extremely easy approach which might also be helpful in cases like yours: Use a batch file! (or a similar loader before the actual application)
A Windows batch file for such a purpose could look like this:
#echo off
PATH=%PATH%;<PATH_TO_YOUR_LIB>
<PATH_TO_YOUR_APP_EXE>
/edit: Just saw #SirDarius comment in Luchian's answer which describes that way, so just take my batch code bit as a reference and all credits go to him.
I have the same problem with one application I am working on.
I do not want to use runtime loading because there are tens of functions I would need to manually create function pointer for.
Mr Dibling's mention of manifest file opened a new door for me but I sadly found out that the oldest version of windows that supports the feature is Windows 7. It won't even work on Vista.
Long story short, a friend familiar with Windows Application development told me to look up Delay-Loaded DLL, which turns out to solve the problem perfectly with minimal effort. It delays the loading of DLL library to either the point you manually do, or the first time its function is called. So you just need to add your DLL path to the search path before that happens, where SetDllDirectory helps.
Here is the steps to make it work:
1) Specify the DLL to be delay-loaded to linker, either through your makefile, cmake or VS property page (Linker->Input of VS2015)
2) Call SetDllDirectory at the beginning of your program, before any call to the DLL is made.
Delay-loaded DLL is supported all the way back to VC6.
SetDllDirectory is supported after XP SP1.
Use Symbolic Links to the 3rd Party Executables
I found the approach advocated by Aaron Margosis useful. See:
Using NTFS Junctions to Fix Application Compatibility Issues on 64-bit Editions of Windows
Essentially, create symbolic links to each of the dependent 3rd Party executables. Place these symbolic link files in and amongst your own dependent executable files. Except for filename changes to the targets, the 'soft' symbolic links will resolve the load-time dependencies even as the target of the links are changed by future updates.
I'm teaching myself OpenGL and I'm implementing ttf text rendering using FreeType 2. I downloaded the library from
http://gnuwin32.sourceforge.net/packages/freetype.htm
and after a couple of minor issues I got it running properly. The thing that's bothering me is that I have to place a copy of freetype6.dll in the directory with my executable in order for the thing to run. I generally try to avoid a bunch of unnecessary dll files floating around. I'm sort of new to windows programming, but from what I understand most libraries can be built to run fully from a lib rather than requiring a dll at runtime. Looking through the documentation from FT is making my brain melt, so I thought I would ask here to see if there were any devs that have worked with FT before and if so, do they know how to build the library such that no dll is required at runtime.
Thank you in advance for any advice or support.
Check out this link. See the section Optional: Installing FreeType (by compiling it yourself)
Follow the instructions and you'll be good to go.
you can generate static lib by getting source code of it... then you won't need dll...and i think freetype2's source is available...
It is something DLL generic. All your DLLs should be in PATH similarly to LD_LIBRARY_PATH. Also under Windows (unlike Unix) the current directory is always in the PATH. So you just need to set your PATH variable to point to location of this dll.
Now, for Unix... you probably just have this library installed by default like hundreds of other useful libraries that are not present under Windows by default.
So... No unless you link statically you should use DLL somehow. And my suggestion - use dll.