I have the x64 project that works perfectly fine on my Windows 7 machine whether I run deployed version or in the Visual Studio 10. Now, I got a hand on 4 other machines with x64 Windows 7 platforms and tried to install on them, however those ones work fine except the bit of code which has to capture video always fail to load.
That bit is a typical openCV video capture bit:
cap = VideoCapture(file);
if (!cap.isOpened ())
{
cerr << "I have failed!" << endl;
return 0;
}
The file variable is generated when user chooses the file to load using file dialog it works perfectly fine on all machines if the file is, for instance, a picture, therefore that's not the reason.
Maybe the produced installer does not contain the necessary library or something like that. I really have no idea.
Cheers,
Vilius
Ok, As I suspected some libraries were missing in the installer package, I managed to load video files once I copied compiled OpenCV to another computer and added the path to find it.
Since many people had problems loading videos when ffmpeg was not configured, I added this library manually to the deployed software and it fixed the problem. Therefore, the problem was that Visual Studio was not adding opencv_ffmpeg241_64.dll library to the installer.
Cheers,
Vilius
If the installer packed everything correctly, you still have to take care of the codecs yourself.
Try to install a codec pack (K-Lite Codec Pack or something else) on those machines.
On the other machines, have you configured OpenCV with the ffmpeg option while installing it? Check the Cmake configuration list and print it out here if possible.
Also, it wouldn't hurt to check if you have the respective camera drivers installed correctly for those computers if you are capturing frames directly instead of from a file.
Related
I was making a Delphi application, and wanted to test it on another PC to see if everything was working properly. I compiled and built the executable file, of course and I transfered all of the files from the Project folder to the other PC. When I launched the .exe file on the PC, nothing would happen. I then ticked the "Build with runtime packages" option in Project Options:
This made the .exe go from around 300 KBs to around 30 KBs, but now, instead of being able to launch the application on another (non-Delphi) PC, that PC got an error saying it was missing various files required to open the .exe .
I sent the same thing to various friends and all reported the same problem.
My application is a rather simple lottery prototype application, so I don't understand why I'm having trouble opening it on other PCs. Are there other special options I need to enable for this to work?
When you use runtime packages, you need to distribute those packages. These are the .bpl files that your program links to. It will be a subset of the packages listed in the runtime packages edit box in your screenshot. You should just list the packages that you use.
The net result of doing this is that the total amount that you will have to distribute is much greater than a single monolithic executable. Because in a monolithic executable the unused code can be stripped. If you want to minimize the size of your program, and make life simple, do not use runtime packages.
It would be worthwhile reading Embarcadero's documentation:
Working with Packages and Components
Solve the first problem.
Using Runtime Packages will not solve the problem of your EXE not running on certain PC's. All it does is increase the complexity of deploying your application (as you have found).
Unless you need Runtime Packages for other, specific reasons, then you are far, far better off NOT using them, especially if you do not understand them (which based on the way you describe having discovered them does appear to be the case, if we're being honest).
Concentrate on finding out why your application does not run as a single, stand-alone EXE.
With all of the problems involving runtime packages your EXE is currently not even reaching the point of running your application code, and this may be where your original problem lies. Which means that once you have solved all the issues created by Runtime Packages, you will stil be left with an EXE which does not run. i.e. your original problem.
What does your application do when it starts ? Does it attempt to load files from any specific locations ? What are those locations ? What are the files ? Are you using any third party libraries which may expect DLL's to be present or other external files ? Are you trying to read or write settings to the registry or any external files (INI files etc).
What is the OS you are trying to run on ? This can be a very significant question for applications compiled with older Delphi versions. Have you tried configuring the EXE to run in Compatibility Mode for older versions of Windows ? (something that you do in Windows itself, not when compiling the EXE).
These are the questions you should be focussing on. Not runtime packages.
Gday,
A small tool that's been around for a while to help you with this is Dependency Walker. You can find it at http://www.dependencywalker.com. It's helped me out on more than one occasion. This will tell you what files (usually BPLs as stated in the other responses) need to be sent with your EXE.
Also look at NSIS to create a simple installer, and put your EXE and supporting BPLs and any other files in the same directory.
I have been having this issue with OpenCV 2.4.2 that it doesn't really get installed properly with Microsoft VS 2010 Express; It is always missing a dll file or two doesn't matter what I follow by Googling. Also, Visual Studio 2010 Express is only valid for a few days, so it is acceptable that VS will not behave well with OpenCV at that point. However, when I changed my IDE to CodeBlocks, it is even stranger because now I have missing dll files and also "Missing Entry Point" error because of a duplicate .dll file. I found this guide and followed what it told me to do:
http://conanhung.wordpress.com/2012/05/23/opencv-2-2c-codeblocks-and-mingw-got-it-working-on-windows/
But it still doesn't work!! What I am after is a complete and definitive solution to integrating OpenCV (preferrably 2.4.2 version) on a Windows 7 64-bit machine. I have been turning Stackoverflow inside out but no solution is working for me. The problems are
WHEN USING VISUAL STUDIO:
Missing dll file (e.g. libopencv_core242d.dll, etc.)
WHEN USING CODE BLOCKS:
First it complains that libstdc++-6.dll is missing. When I download it to my C:\MinGW\libexec\gcc\mingw32\4.7.0 folder, it stops complaining about this. But now it complains that there is any entry point problem and some other .dll file is missing!!!
If someone has managed to make it work by hook or crook, I will be more than happy to know what it is, IN DEPTH. I don't believe that such an important library can be so stupidly distributed so that developers have to struggle night and day to make this work.
FYI, I have tried even the OPenCV website and frankly their instructions are a bit useless. Also, all the necessary information e.g. adding PATH, adding includes and libraries, etc. Please someone point me to the right direction as it has been two days and I cannot get anywhere. It is literally stopping my job now :(
As an answer, but probably a very simple one, I did the following and got rid of the problem:
1) Uninstalled code::blocks completely from the PC and downloaded the IDE-only version (i.e. withouth MinGW compiler), then installed it.
2) Downloaded the latest stable version of MinGW, installed, and added C:\MinGW\bin to PATH
3) Followed rest of the instructions from [link] http://conanhung.wordpress.com/2012/05/23/opencv-2-2c-codeblocks-and-mingw-got-it-working-on-windows/
4) Just to be sure, copied the opencv .dll files from the build folder (i.e. the one that you have created "make" and "install" files using CMake) to the debug (i.e. the executables') folder.
This will fix the problems. In case, it doesn't it might be that you need to add some environment variables.
Okay, I have been looking all over to solve this problem before I actually broke down and decided to finally ask for my psecific problem. I am using ClickOnce installation and when I use the setup.exe to install nothing runs, not even on my personal computer that I know has all of the proper libraries and such. I'm not sure what I am doing wrong so it is difficult to explain the problem.
I have included dotNetFramework4.0 client x86 x64 , xna redistributable 4.0 and windows installer 3.1 along with my game and I have it set to install all of that with setup , also I have it set to download prereqs from same location as application. I've tried it on three separate computers , one that does not have XNA or VS C# installed and the same problem occurs.
Here is the problem , after I install the game nothing runs, I try clicking on the ClickOnce application file (the one with my game's icon image) and again nothing happens. The thing that really bugs me is that there isn't any errors or crashes or anything , it's almost like clicking on the desktop screen. (I looked at the properties of the "shortcut" that was installed with the game and the file size of the shortcut is like 300 bytes. Isn't that really small? I was thinking maybe there is a problem with a startup executable? I'm not sure though.)
I've tried tweaking some stuff in the Publish section of my project , such as un-checking the box that says "use .deploy extension files" (I don't know why, I've been grasping at straws here) I've been looking into some other installers such as NSIS but I don't know how to compile a list of files to include in other installers and I feel like that won't solve the problem anyway because I've gotten ClickOnce to work with me before.
On one computer there was an error report that said something about 'deployment and application do not have matching security zones.'
Game.application resulted in exception. Following failure messages were detected:
+ Deployment and application do not have matching security zones.
It's getting late so if I need to provide more information let me know.
ClickOnce can be a fickle thing. There are times that I've had errors occur that could only be solved by recreating an entire Windows user profile. Because there are so many different options for ClickOnce, it's going to be hard for me to diagnose your exact issue, so I can only offer what options I used to successfully install via ClickOnce.
Publishing Folder: local folder
Installation Folder URL: blank
Install Mode: offline
Application Files
Make sure the Publish Status of your game files is set to Include (Auto)
Make sure the Publish Status of the XNA libraries is set to Prerequisite (Auto)
Click Prerequisites
Microsoft .NET Framework 4 Client Profile
Microsoft XNA Framework Redistributable 4.0
Windows Installer 3.1
Do not check for updates
Everything else default under Options (publisher/suite name shouldn't affect anything)
Specify the version number
Publish Now
Install the game through the setup.exe provided in the publish location. I always distribute every file that is publishes. However, you can clean up old versions in the "Application Files" folder if you don't want the history to be distributed.
You can double check the "Application Files" folder to see if your version got published correctly (look at the files that were deployed and see if they match your project contents).
I am using OpenCV 2.4 in my project to process the images from webcam. Everything works fine in Visual Studio 2010 (both release and debug builds), but when I try to launch exes directly from explorer, the app does not the get input. The camera is started however - it's control LED is on.
Does someone know how to make it work standalone?
I have found something relevant here:
http://rafaelbarreto.com/2011/06/05/opencv-2-2-webcam-windows-not-working/
and here:
Can't access webcam with OpenCV
I tried to follow the steps, building OpenCV 2.4 with these prepocessor definitions, but it did not solve my problem.
Thanks
Solved. The problem was, that Visual Studio linked shader sources from somewhere else than during the exectution through IDE.
If the same happens to you, be sure to check it at least four times (I checked 3x).
I'm trying to use OpenCV with Kinect on Windows 7 x64, so I installed OpenNI, NITE and PrimeSense (by avin2).
I used CMake to compile the OpenCV 2.3.1, everything is correct with CMake Flags I checked, but I tried to use a simple code and it never found the Kinect.
All the samples of OpenNI and PrimeSense work fine.
I already installed x86 and x64 drivers and it still doesn't work!
I'm using VideoCapture, and isOpened, always returns 0.
Anyone know the solution?
I did that under linux ubuntu 12.04 last week end and that work fine.
Try to re-install componant by componant, and recompile your openCV.
I did that last week end.
But I agree there is things wich are not clear about how deal with that.
I replaced the kinect by an assus xtion and right now that don't work... but this an other topic.
About PrimeSense hardware, as I khnow kinect is made by PrimeSense... moreover PrimeSense is a member of the OpenNI project which is use in background of the libraries P.C.L. , openCV, and on the ros's openni_camera stack...
I have installed the opencv kinect on windows 7-64its (Professional) and works fine.
1.Drivers to kinect: here
Note
When you to install the dirvers make sure that the "Windows update" will not install aditional
drivers.
Tip: Disconnect the internet when you install it. ;)
Check in the "Device Manager" and search for PrimeSense.
Something like this:
PrimeSense
|- Kinect Audio
|- Kinect Camera
|- Kinect Motor
Check if it's working. Run a OpenNI sample.
2.OpenCV
Download it:
...://sourceforge.net/projects/opencvlibrary/files/opencv-win/2.3.1/OpenCV-2.3.1-win-superpack.exe/download
Configure the opencv on cmake. Remeber check to on the "OpenNI" option.
Maybe you'll get an erro like "warning: PrimeSense..." this happen because the OpenCVFindOpenNI.cmake is outdated.
You have to do some changes.
Go to here and download the changes:
Click here and download it (at bottom of page: "Download in other formats: Original Format").
You have to do the changes in the original file "OpenCVFindOpenNI.cmake".
It's in the root folder "OpenCV-2.3.1\"
The line that has "-" you delete and the line tha has "+" you replace/add.
Configure and compile the openCV.
After this it'll works fine, at least it should... :)
Sure.. You have to compile... ;)
I my case - Visual Studio C++ 9(2008) - (I compiled in the Release mode only)
You have to set the "bin" in the patch of system after compile..
Run a sample:
"OpenCV-2.3.1\samples\cpp\kinect_maps.cpp" and enjoy.
kinect for windows perhaps is not supported by Primesenser hardware drivers or even by avin2