Program compiled with VS2013 runs much slower than its equivalent in linux - c++

I downloaded an open source c++ project which is written linux. I wanted to run in on windows and installed MinGW in order to compile and run it. I have successfully compiled it with "make" command and program runs pretty fast. Later, I moved program to Visual Studio, modified few lines including deleting "sys/time.h" library etc.. but never made a big change in algorithm itself. When I run the code, it runs but much slower than it runs with its compiled version in MinGW.
I haven't change anything in the algoritm. What should be the reason and how can I make it faster again?
Project I mentioned is here: http://perso.esiee.fr/~coupriec/temporal_segm.zip
It basically segments a given image sequence and produces segments with colored randomly.

Related

C++ Code::Blocks program causes blue screen when run from command line

I was using Code::Blocks to try out parallel programming using OpenMP. MinGW compiler included in original Code::Blocks folder didn't support OpenMP, so I downloaded newer version (7.0.0) from Sourceforge and set up the project accordingly (-fopen parameter, path to libgomp-1.dll) and everything seemed to work as expected. Program is compiled and runs without problems when launched in Code::blocks. But when I tried to launch the .exe file from command line, I end up with Blue screen of death. The same thing happens with any code, even "hello world". Original MinGW given with Code::Blocks doesn't have this problem. I also tried another version (8.1.0) with the same result. It seems the crash happens even before any command from main function is performed. Using Win 7 64bit.

Why are my C++ and Fortran programs not running on Plato IDE downloaded from Silverfrost?

I am using Plato IDE from Silverfrost FTN95 to run programs on Fortran as well as C++. But for the last 2-3 months, I was busy and could not use them. So, yesterday when I opened the IDE and viewed some earlier written programs, I saw that the programs were not running properly.
The compiler was working and each time, the compilation was completed with no errors.
The executable was also built successfully but it just showed the following:
Also, on clicking "Run to Cursor" on any line of the program, it mentioned the following error.
What is wrong? And how do I make things work right? Do I need to uninstall and reinstall?
I could not realise what was wrong, in any way possible. So I uninstalled it and then performed re-installation. Things are working so fine now.

Same C++ code compiled on the same machine behaves differently

I have written a C++ code that uses some of the Qt static libraries.
I compile the code using MSVS2010 (on Windows 7) and then run the created .exe-file on a second machine.
I have compiled the exact same code on the same machine 2 different times and the .exe code that is generated crashes on the second machine when that machine's (Windows XP) screen saver starts, I have compiled the same code another time (nothing has changed in the code or the compiler or its settings) and the generated .exe-file does work fine.
Has anybody an idea on what can cause this?
Is there a way I can debug this issue?
Could the fact that at different times maybe different other programs are open affect the compilation?
The problem is not with the compilation process (it will always produce the same binary provided you didn't change the sources) but with the execution environment.
There seems to be something on your second machine that makes your program crash intermittently (or it could well be that it has nothing to do with that second machine, and that your program crashes intermittently everywhere). To debug that, you may end up having to install a debugging environment on the second machine and hope the problem arises again, or you could also try to reproduce the crash on your development machine.

How to make a c++ project run on a different PCs

I developed a small c++ program in Visual Studio 2012 on Windows7, 64bit (let's call it PC1). On that pc it runs fine!
Since I didn't have a versioning control system like SVN at hand, I copied ALL the project data (the exact folder structure, DLLs, source files, project files...) to a usb stick and moved it to another computer.
On that other engine there's Visual Studio 2010 on Windows7, 64bit (PC2).
So I just changed the platform toolset to v100 as described here.
I successfully compiled the project on PC2 (clean, build) and wanted to run the exe, but the command prompt stayed empty.
I then tried to debug and added a breakpoint at the very first line of main - which wasn't reached, the command prompt was still empty.
Ok, a usb stick is certainly not the most secure solution for data storage, so I gave it another try and moved it again - the problem remains.
Visual Studio's output on PC2 is the same as on PC1, so I couldn't find any anomalies there.
Yeah, there might be many error sources, so where can I start?
And how can I get a more verbose output for troubleshooting?
Or is this even a common phenomenon (perhaps due to different VS versions) and there's an simple way fix it?
This is not a full solution, but at least I'm a tiny step ahead:
In my last comment I wrote:
I took your advices into account and created a brand new project on PC2, VS2010. I exactly followed this guide: http://frozenhamster.wordpress.com/2011/02/11/lapack-on-windows-with-visual-studion-2010/
That didn't work either, so I removed I "out-commented" everything except for a single cout. Voila, that worked!
But as soon as I make use of the desired Armadillo (LAPACK and BLAS), the project compils but does not run.
What's going wrong here?
I don't get any compiler errors!

SSE2 - "The system cannot execute the specified program"

I recently developed a Visual C++ console application which uses inline SSE2 instructions. It works fine on my computer, but when I tried it on another, it returns the following error:
The system cannot execute the specified program
Note that the program worked on the other computer before introducing the SSE2 code.
Any suggestions?
PS: It works when I compile the code on the other computer and run it. I think it has something to do with the manifest from what I've scrounged off the net.
Most likely the use of the SSE2 instructions is requiring a DLL which isn't present on the second system.
Here's a blog entry on how to figure out exactly which one:
How to Debug 'The System cannot Execute the specified program' message
If you've built a debug version , a Release build might work on the other machine.
If not, you need to figure out which Microsoft Visual C++ Redistributable your program requires and install it on the other machine.