DLL load failed: The specified module could not be found on Windows7 32-bit machine? - visual-c++

I am creating dll in windows7 professional 32 bit machine ,same dll registering another 32 bit windows7 professional service pack 1 machine this dll is not registered showing below error.
Unable to load DLL 'coredll.dll': The specified module could not be found.
How to resolve the compatabilty problem?
Regards
Narasimha

Loading a DLL requires that all dependencies of the DLL are resolved. You should use the Dependency Walker to get the list of DLLs that are required. When you copy the Dependency Walker to the target machine it should display the missing DLL immediately.
When you create a DLL from VC++ it requires usually the VCxxRT (Visual C++ run time) DLls. These DLLs come in different versions. When you target machine has not installed the correct version you get this error.
Check the installed version by looking at C:\Windows\winsxs for x86_microsoft.vcXX.crt_*.
EDIT: Hans' comment is correct. coredll.dll is a Windows CE DLL. It makes no sense to run regsvr32 with a DLL that requires coredll.dll at your PC. You can check this with:
dumpbin /headers IPTCExt.dll | find "subsystem"

Related

how to package and deply a VFP OlePublic (COM Object)?

How do I deploy a VFP OlePublic dll to a Windows Server 2016 machine that is called via COM Interop from .NET hosted in an IIS website? What other bits do I need to deploy beside my VFP dll?
I would think I would use InstallShield Express Visual FoxPro Limited Edition (included w/ the install of VFP9), no?
Define Class miked As Session OLEPUBLIC
FUNCTION HelloWorld as String
RETURN "Hello World"
ENDFUNC
FUNCTION Echo(thingToEcho as String) as String
RETURN thingToEcho
ENDFUNC
Enddefine
InstallShield MSI package
I included the following redistributable packages in my installer:
GDI Plus Redist Module
Microsoft C Runtime Library 7.1
Microsoft Visual FoxPro 9 Runtime Libraries
I'm able to manually register the dlls from an admin PowerShell prompt w/ regsv32 so that part seems ok.
I get the following when trying to instantiate an instance of this COM object.
Retrieving the COM class factory for component with CLSID {A55C4127-DDCB-4E5F-B69C-A7EAC83A83DC} failed due to the following error: 80004005 Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL)).
On my additional test server, I installed VFP 9 w/ SP2 and my error went away but doesn't seem right. I probably shouldn't have to install the IDE to deploy the DLL.
On my additional test server, I installed VFP 9 w/ SP2 and my error went away but doesn't seem right. I probably shouldn't have to install the IDE to deploy the DLL.
That was not correct. I reset my VM using a checkpoint, performed a fresh install of my app & it worked.
Packaging up a VFP COM dll as described in my question works!
Using Simon's comment & procman I was able to kinda solve my problem.
E_FAIL is a super generic error (but it seems the entry COM .dll is indeed registered otherwise you'd get another error). You can try to run Process Monitor on the machine, filter by .exe, and check registry and possibly file accesses if there are some missing .DLL dependencies
I found some not successes under my exe name trying to load vfp9r.dll:
those files got installed w/ my InstallShield package under C:\Program Files (x86)\Common Files\Microsoft Shared\VFP:
I copied the three DLLs:
vfp9r.dll
VFP9RENU.dll
vfp9t.dll
from C:\Program Files (x86)\Common Files\Microsoft Shared\VFP to my DLL install directory, restarted IIS & it worked 🎉. This off course is a workaround as it is finding those dll's on my other server but that's another question 😊.
restart IIS:

Unable to load DLL 'MFCapturer': The specified module could not be found. (Exception from HRESULT: 0x8007007E) in TokBox

I am making a video sharing tool with the help of TokBox.
This works fine in the Windows 7 / 8 / 8.1
But Same program is giving the
Unable to load DLL 'MFCapturer': The specified module could not be found. (Exception from HRESULT: 0x8007007E) error in the Windows 10.
Is there any way to fix it.
Official documentation OpenTok Windows SDK - for building WebRTC video apps on Windows states:
When creating an installer for your application, add Visual C++ Redistributable for Visual Studio 2015 as an installer package. Use the x86 version, the x64 version, or both, depending on the architecture of your application.
We installed 64-bit version because everything was 64-bit, had same problem as you and reported to vendor.
We observed that even with platform-agnostic .NET code, running on a 64-bit OS required installing 32-bit version of the C++ redistributable on the target.
Edit: download link for both versions https://www.microsoft.com/en-us/download/details.aspx?id=53840

Compiling x64 DLL on x86

I am working on a wrapper DLL using the technique described here: http://www.codeproject.com/Articles/17863/Using-Pragmas-to-Create-a-Proxy-DLL
I was able to successfully build it on Windows Vista 32 bit using Microsoft Visual Studio Express 2010. But I need to build the DLL for Vista x64 on my i386 machine.
Is it possible using MSVC express 2010?
Do I need a 64 bit copy of the DLL I intend to wrap?
Thanks
I just wanted to say thanks for the unexplained downvotes. Very helpful for a newbie.
Anyway I fixed this myself by installing the Windows 7.1 SDK. That in itself took
significant effort. I had to uninstall the Visual C++ Runtime 2010 before it would
install for some reason.
Then I had another problem: linker errors about uuid.lib when I tried to the build the DLL
I had to tell the linker where to look with /LIBPATH:"C:\Program Files\Microsoft SDKs\Windows\v7.1\Lib\x64"
That solved the problem

LNK1112 module machine type 'X86' conflicts with target machine type 'x64' (VC++ 2005)

I am trying to build a blank, 64-bit C++ application in Visual Studio 2005 Professional using these steps:
Create a new Win32 Console Application project
Go to Configuration Manager, create new Solution Platform of type x64, copy settings from Win32
Save & build
However, I get this error:
LINK : fatal error LNK1104: cannot open file 'kernel32.lib'
So, I tried updating the library directories to point to kernel32.lib:
Go to Project Properties, Linker, General, Additional Library Directories and set
"C:\Program Files\Microsoft Visual Studio 8\VC\lib\amd64"
Save & build
This gives me the error:
LINK : fatal error LNK1104: cannot open file 'user32.lib'
So, I tried updating the library directories to point to user32.lib:
Go to Project Properties, Linker, General, Additional Library Directories and add
"C:\Program Files\Microsoft SDKs\Windows\v7.1\Lib\x64"
Save & build
But now I am getting the error:
.\x64\debug\stdafx.obj : fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64'
Any ideas what I am doing wrong?
It sounds like the problem is with the object file stdafx.obj rather than the system libraries. The warning is saying that stdafx.obj is 32-bit so it can't link into a 64-bit target. Things to try:
Delete the build directories x64 and win32
Rebuild the project
Check the build settings for stdafx.cpp to ensure it's building as 64-bit
Must've been a broken installation of Visual Studio. A new installation of Windows and VS2005 fixed the problem.
Its been long since the question was asked, but for the benefit of others who happen to read this, the change required is in the linker flag setting. Change /machine:I386 to /machine:x64

fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'AMD64'

I am using VS 2003 .Net on 32 bit XP OS. I have also installed "Microsoft Platform SDK" on my machine. Can I build vc++ application (binaries) targeted for 64 bit OS?
I am using following project options :
Name="VCLinkerTool"
AdditionalOptions="/machine:AMD64 bufferoverflowU.lib"
OutputFile="\bin\Release\MM64.dll"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories=""C:\Program Files\Microsoft Platform SDK\Lib\AMD64""
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="\bin\Release\MM64.pdb"
GenerateMapFile="TRUE"
MapFileName="\bin\Release\MM64.map"
MapExports="TRUE"
MapLines="TRUE"
OptimizeReferences="2"
EnableCOMDATFolding="2"
ImportLibrary=".\Release/MM64.lib"
TargetMachine="0"/>
I am getting following error:
fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'AMD64'
Do I need to build project on 64 bit OS or I need to change project settings to resolve this error.
Please help me to resolve this issue.
I had the same problem today, here's how I solved it (in Visual Studio 2008):
Went to Project Properties -> Linker -> Command Line -> Additional Options and removed the /MACHINE:I386 from the linker additional options.
Hope it helps
Having the same problem in VS2008. My solution was to change the active solution platform located in Build -> Configuration Manager and creating a new solution platform using the x64 and copuing the settings from Win32. This allowed me to use the pre-build 32bit libraries in my 64 bit OS.
For 64-bit Windows users:
I had the same problem today, here's how I solved it (in Visual Studio 2008): I went to:
Project Properties -> Linker -> Command Line -> Additional Options
and added the /MACHINE:I364 from the linker additional options.
This worked fine for me.
I faced above error when I tried to build my custom library for ARM64 in Visual Studio 2017. And my target machine was already ARM64 as expected.
Apparently, problem was in ARM64 compiler which was not installed(though I could run build in ARM64). I installed it by running Visual Studio Installer Individual Components -> Visual C++ compiler and libraries for ARM64
Next I got error MSB8022: Compiling Desktop applications for the ARM platform is not supported.
It was resolved by adding
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
...
<PlatformToolset>v141</PlatformToolset>
<WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>
</PropertyGroup>
into my project file.
After all of above I could succefully build my project in ARM64.
Hope it will be useful.
This error comes up because something in you build is being compiled in the wrong architecture (say as a x86 binary when everything else is x64). The linker panics and doesn't know what to do with it, so it breaks your build.
I can speak for your problem because the error message you quoted is incomplete. Usually it goes something like this:
SOME_KIND_OF_OBJECT.obj: fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'AMD64'
You look at the name of the obj file and you'll find the root of your problem there. Whatever obj is listed will have some kind source code analog with the same name. Have a look at it and see how it's being compiled. Usually all that stuff is automated in VS but sometimes there are special build steps that were added in by the developer. Inspect the custom, pre- and post- build events to see if a x86 tool is being used to assemble it. The property sheet in VS2010+ will be specific to the obj and the platform so you can inspect the library directories being used to verify that they are not 32 bit.

Resources