I'm using SDL for a little game and since I need a map in this game I was using SDLMappy to do that. Now on Windows everything worked perfectly fine, I had an example map designed, saved as a .FMP file and the program was loading and showing it perfectly.
Recently I switched to Linux (Manjaro). I am using CLion with Cmake now and the program compiles fine (after a lot of other stuff I had to change for linux), but the map can't load anymore. With debugging I found out, that the error occurs here:
if (mapfilesize!=static_cast<long int>(mapbyteswapl(mapgenheader.headsize) + 8)) maperror = MER_MAPLOADERROR;
mapfilesize is 3698985 and the other side of the inequality evaluates to 1179468120
I googled quite a while about this, but it seems like SDLMappy isn't used very much. Also the link to the linux version on the SDLMappy Site seems to be outdated, at least for me it's going nowhere.
Something else that may have to do with this is, that at some point in the SDLMappy code there is a fopen_s call which isn't working under linux. I used the define
#define fopen_s(fp, fmt, mode) *(fp)=fopen( (fmt), (mode))
to fix this, but I don't know if there are any differences in reading a file with fopen and fopen_s in Windows/Linux that may be causing the issue. I couldn't find anything.
Related
First off, I understand the inconveniences that may come with asking this kind of question and would like to at least state that for a relatively experienced C++ console programmer learning GUI in C++ is tasking compared to other languages like Java and Python (then again, what isn't tasking?).
Anyways, before I ramble on. The question (problem that needs a solution) is how do I get my template SFML program (https://www.sfml-dev.org/tutorials/2.5/start-vc.php) working in Visual Studio when I receive this error message in the console:
LNK1104 cannot open file 'sfml-system-d.lib'
I've followed multiple tutorials about a dozen times now leading to more frustration with this minor challenge each time I get this exact reason my first SFML program not working.
I've searched for the file sfml-system-d.lib as well and found absolutely nothing.
I'm using SFML v2.4.0 for Windows 32-Bit applications and also using MinGW's GCC v6.3.0 to compile my C++ console programs.
For additional references, here's what I got so far:
GitHub Repository - https://github.com/LapysDev/Learn/tree/master/C%2B%2B/GUI/sfml-visual%20studio/demo.v2
I know this question is off the mark here and I fully expect to be put in my place.
Anyways, thanks for reading through this far; And again my apologies for taking up anyone's time.
I am trying to write a DYLIB, (in Code::Blocks), which is to be called from a Mac application, that simply calls the standard C system() function, while giving the option of whether to wait for finishing, in the second argument, (1 or 0).
I put my sample code on pastebin, instead of embedding it here, because for whatever reason, the post editor is not letting me place the entire code snippet inside the code box, like it's supposed to, which is a little annoying.
http://pastebin.com/0ZfbD3Dx
Now when calling the DYLIB, (I can't remember the compiler I used, either GCC or LLVM), I use this code within GameMaker Studio:
ExecuteShell('open /Applications/Calculator.app',0);
However, calculator does not run. Trying to change the second argument to 1, and I get the same result. Calculator does not run. No errors. It seems to be ignoring my code all together, so I was wondering if there was something wrong with how I wrote my DYLIB.
I look at this question someone else had:
https://stackoverflow.com/questions/859517/osx-equivalent-of-shellexecute#=
string command = "open " + filePath;
system(command.c_str());
I see they used .c_str(). Should I be using .c_str()? Is that the problem? The code I use right now is system(fname);. Should I change that to system(fname.c_str());? Is it OK that I'm using the type char * for the argument fname? Or because I'm using that type, do I have to cast/convert it to the type string?
I'm using someone else's Mac to port this small project of mine to work on Mac, anyway I'm trying to get help on here, before trying to build it again, because I'm trying to minimize how much I'm asking to use my friend's Mac computer. The hope is, the next build I do, with very little tweak, will finally work and run calculator.
Thanks in advance!
I am really new to programming (actually trying to get this to work for my 1000 level intro C++ class) so I apologize for bad descriptions and lack of terminology.
I am having trouble getting a "Hello World" program to work on Geany. I have followed the instructions here http://wiki.geany.org/howtos/win32/getting-started , pretty much to the letter. My program gets a successful message when I hit compile/build. When I hit execute the terminal pops up but it is blank.
There is a flashing cursor in the spot where I would expect Hello World to be but instead it is blank, and I cannot type anything in the window. From what I've researched I think it may be a similar problem from here How do you make Execute do anything in Geany? but searches on changing the terminal form to work for windows has not yielded any results.
In fact, I have not found much help for Geany on windows at all, so if there is a better set of software to use that is pretty basic I would be interested, I am only really attached to Geany because that is what we will be using in class (on a Linux operating system)
Thanks for the help!
John
Avast Antivirus does, in fact, cause Geany to fail execution of the program. Windows 10 Pro 64-bit using Geany 1.26 full installer with MinGW. I just shut down shields for 10 mins and this allowed the program to execute.
Thanks.
Question Intro
I'm running an opencv project in Visual Studios 2010 and have implemented cuda support (refer to my previous question for precise info on my set-up). All cuda-functionalities are working fine - to the best of my knowledge - and are indeed improving speed on the image processing.
However, I now also wanted to attemp to speed up the video-writing function in this project by replacing the current cv::VideoWriter with the gpu::VideoWriter_GPU function. The reason for this is that the cv::VideoWriter seems to somehow cause processes running outside of the scope in which the VideoWriter is called to be slowed down, resulting in images available at the DirectShow driver being dropped by the VideoCapture-function, hence messing up an algorithm I've implemented.
Problem
To attempt to solve this issue, I've now replaced the VideoWriter-calls with VideoWriter_GPU-functionality (and corresponding syntax), but when I run my project (Compile & Run in Debug-mode), I get the following error-message (directly originating atthe calling of gpu::VideoWriter_GPU):
OpenCv Error: The function/feature is not implemented (The called functionality
is disabled for current build or platform) in unknown function, file
c:slave\builds\wininstallermegapack\opencv\modules\gpu\src\precomp.hpp, line 131.
and the program then ends with
code -529697949 (0xe06d7363)
I've purposely currently not included any of my code because the error-message originates so clearly from the call to the gpu::VideoWriter_GPU, which is making me think it's not a coding or syntax problem. (Please comment if you feel my code is necessary for answering this question.
My steps so far
I miss the natural gift of understanding what precisely this message means or how to interpret it. Does my opencv v2.4.4 simply not support what I want...? Does this function simply not work on my windows 7, 64bit system...?
I've checked out as many available google-hits I could find (relating to this error message and combinations of searchterms like "opencv, gpu, VideoWriter_GPU, disabled for current build") but have not understood what the problem is or how to solve it.
Corresponding header-file and error message can also be found here.
This post and this post suggest the error message is trying to tell me that opencv simply does not provide the option of using the function or functionality I am aiming to use. Or maybe even that cuda is not at all supported.. But that's all against my experience as every single opencv gpu-function I've tried to use has seemed to work fine.
Question
Could someone please explain to me why this is not working for me, and more importantly share with me what I should do to make the VideoWriter_GPU work?
Many thanks!
Maybe this link can give you a little idea of what the problem is: VideoReader_GPU not available, but built with NVCUVID?.
It seems to be that the problem is the CUDA_DISABLER var.
First things first: Platform is Windows 7 64-bit, language is VC++, IDE is VS2010. Graphics card is nVidia GTX 460, drivers are version 290.53.
So here's the situation. I am currently working in OpenGL using Glew 1.7 and Glut. I set everything up a few days ago and managed to successfully code and complete an assignment for my classes. The assignment ran beautifully and displayed and did everything it was supposed to. That was wonderful. So I submitted my assignment and didn't touch it again until tonight.
Now, tonight I tried running the code again and instead of my beautifully tessellated polygons I am getting a plain white window. As far as I know, nothing related to OpenGL has changed on my system since I last ran the code. I haven't changed the code at all, I haven't changed the graphics drivers, I haven't changed anything that I am aware of. I couldn't seem to find anything related to this kind of problem, and I am at a loss of what could possibly be causing the issue. I even tried recompiling Glew, but it didn't change anything. I know it's not a code issue since it was working fine a few days ago and nothing has changed, so it has to be a configuration issue.
Could someone please point me in the right direction?
Edit
One more thing to add to this. When I was originally doing the project in question, attempting to run it produced the error message "unable to find glew32d.dll" until I placed glew32d.dll and glut32.dll in the source folder of my project.
Now, I don't remember deleting them from my project folder, but when I tried to debug it last night, I noticed that both of them had disappeared from my project folder. However, I was not getting any .dll missing errors. Replacing them in the folder didn't solve the problem, but I am wondering if their disappearance has something to do with this. They are also located in the VC/bin/ directory of the VS2010 install path, and deleting them from both locations produces the error message, but having them in either location is now sufficient for building and running when previously I needed them in both.
One possibility is that you're scaling by an infinite value (1.#INF), or something of the sort. I've run into a very similar situation, and that turned out to be the problem. However, if you have not changed the code, then you may be able to rule this out. Have you tried throwing in some code to render a simple quad or triangle to the screen?
As for the .dlls, I recommend putting them in your C:/Windows/SysWOW64 and C:/Windows/System32 folders. SysWOW64 specifically houses all the 32-bit .dlls, but it's safe to put them in both locations. Visual Studio will look in both your project folder and these system folders for necessary dynamic libraries. The advantage of placing them in the system folders is that they are then available for all OpenGL applications you may write.
One last thing that might help in finding the issue is making use of OpenGL's error reporting. You can use a function such as:
void HandleGLError()
{
GLenum error;
int i = 0;
while ((error = glGetError()) != GL_NO_ERROR) {
printf("GL ERROR(%d) %s\n",i,gluErrorString(error));
i++;
}
}
Try calling that at the beginning and end of your render function, and in any other places you think might be causing a problem.