Program compiles on one machine but not the other - c++

I would like to point out that I am still learning and it could be something obvious that I am missing.
But to the point:
For my assignment, we had to make a simple game that would display an interactive scene.
So I wrote all the code on my computer and everything works fine, the code compiles and the program runs exactly as intended.
I've decided to move it to my laptop because it is due tomorrow and now I got a problem.
When I try to compile exactly the same code, visual studio shows me an error at line:
_programID = glCreateProgram();
Which works perfectly fine on my desktop.
It says "Exception thrown at 0x00000000 in Project.exe: 0x00000005: Access violation executing location 0x00000000."
The code is literally the same on both machines.
Both machines use windows 10 and exactly the same version of visual studio.
I have also linked my libraries relative to the solution directory so it is not a problem with a wrong path.
What could be the case? I really don't understand why is this happening. I have copied the entire folder with all the libraries and additional header files that I use along with the project.
I thought maybe it is because I am using libraries compiled on my desktop? Does that matter?
Please help.

I write this in case somebody had a similar problem in the future:
The problem was with my graphics card driver on the laptop. After my last format I didn't install the drivers (didn't really think about it since I use my laptop only for office and simple visual studio stuff) and that was causing OpenGL functions to throw errors. Installing drivers fixed the problem.
Thank you very much #Humam Helfawi.

Related

Getting "0xc000007b Application Unable to Start Correctly" error on only one computer

I am building an application, and I just pulled the source code onto a new computer. I am able to compile and build the program on the new computer, but when I try to run the executable I get an "Application start correctly" error.
I can take the executable that was built on the problem computer run it on my other machines and it works fine. Dependency Walker doesn't highlight any obvious deficiencies; the output looks similar to the output from the functioning machines. I also reinstalled the VS C++ redistributable.
It seems like there must be some way in which the environment on the new computer is different, but I don't know where or how to start looking.
All credit to #PaulMcKenzie in the comments above. My problem ended up being that I'm using an x64 application, and my Windows search path was finding and trying to use x86 DLLs, which caused the crash. I found this out through a closer examination of the Dependency Walker output.

Why won't Allegro initialize?

I tried installing allegro 5 to code blocks, but even though it seems the program compiles it won't initialize. I get an error saying the application failed to start because allegro-5.0.9-monolith-md-debug.dll was not found. It also says re-installing may help, but I've tried that several times already. I tried following online tutorials, but I still get this error. Am I doing something wrong? Please help.
Copy allegro-5.0.9-monolith-md-debug.dll into the same directory as your source code. I had this same exact problem. I was using Visual C++ 2010 express edition, paste it with the source not the .exe if you are running it from within the compiler, if you want to run it outside of the compiler it will need to in the same location as the .exe

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!

VC 2010 Executable Not Running on Other Computers - No Errors

I'm running into a strange thing while making a game in VC++. I'm using the Cocos2d-x platform and VC++ 2010 in Windows 7 and it works perfectly fine on my machine. However, I have another computer that is Windows XP. I am currently using /MT so there is no problem with the runtime library, but the program doesn't run in Windows XP and it doesn't even produce an error. I have tried with 2010 C++ redist on the other computer, and it doesn't work with or without. There is nothing in the console and no error log. Nothing appears odd in DependencyWalker, only missing internet explorer frame stuff. What can cause a program on windows XP to execute and close immediately without leaving an error?
Anyone has any ideas? I am using the game framework's dynamic linked libraries, so could that be a problem? Also, even though I linked statically, my executable is only about 140 KB. Is something messing up?
Thanks for any help.
EDIT: There's also an interesting problem with CRT I ran into before. When I ran the program with permission level "asInvoker" on windows 7, I got a "CRT Not Initialized" error. Once I set it to "highestAllowed", it started working but I was wondering if it had anything to do with CRT?
Okay, I've found the problem. It turns out that my other computer has an integrated Intel Graphics card that doesn't support the graphics renderer (OpenGL ES 2.0) that the framework uses. That's why it ends up crashing without outputting any errors.
Thanks to anyone who helped.

Problem starting old programs created in VS6

I have some old programs that I created 7-8 years ago in C++ in Visual Studio 6.0.
I tried to start them today, but I had no luck. When starting up the program (or any other program I created at the time), I get the following error message:
I can see at least that MFC42D.DLL and MSVCP60D.DLL is present in the program folder, but honestly I do not remember what is required to start these programs any more, and I obviously do not have VS6 installed on my current machine.
Do anyone know what this error message mean, and what I can do to resolve it? I would love to start up these old programs again to see what they look like :)
EDIT
I got a step further now, after I put a new DLL, but now the problem is that Direct X 8 is not getting set up properly. I thought DirectX was backwards compatible, but do I have to install DX8 as well? Will it work having two DirectX versions installed at the same time?
You need a program like dependencywalker, that would show you all the DLLs that your programs need. Then you would have to find all those DLLs.
Another option is to find a copy of VisualStudio 6 and install in on your machine.
A third option is to get a more recent version of Visual Studio, and to try to recompile your code.