I can't seem to get my C++ project working in CodeBlocks.
The errors I'm receiving are after trying to compile:
cannot find -lmingw
cannot find -lSDL2main
cannot find C:\C++Libraries\MingW\SDL2-2.0.3\lib\64: Permission denied.
Looking at your errors, I see you are trying to include SDL2.
Are you able to compile programs without SDL2?
If not, then I'm guessing your compiler isn't setup properly, in which case this link might help you:
Setting up codeblocks & mingw
If you have codeblocks and mingw (32 or 64) working and are struggling with including SDL2, then this might help you:
Setting up codeblocks & SDL2
If you are 100% sure that both are setup correctly and you still get the exact same error, then I'm assuming something is wrong with file permissions, but I think it's one of the first two.
Related
I'm using Visual Studio 2017 with OpenGLESApp template and I'm trying to put SDL2 into my project. I linked it by clicking Android.NativeActivity properties and in there I selected include folder and in linking part I linked against pre-compiled x86 binary which I downloaded from official SDL2 webpage.
Now since I'm using emulator with x86 base image I'm assuming that those things are compatible. Is my assumption wrong?
When I try to use SDL2 functions in my code compiler is complaining with the following error message:
Error MSB6006 "clang.exe" exited with code 1.
And when I delete all usages of SDL2 functions code compiles just fine. Now this would perhaps indicate that architectures are not compatible and that my initial assumption is wrong.
Can somebody help me to understand this? Is there any way I can see more information from the compiler to validate what the actual issue is?
Also, any help on how to get SDL2 to run in my project would be helpful.
You probably have undefined references in your output before the error you are showing.
You are trying to link windows libraries with Android binaries, which cannot work, they are not the proper type. Even if they both can be executed on a x86 machine, they have a different structure.
I set up OpenCV with Code::Blocks as per this tutorial: http://kevinhughes.ca/tutorials/opencv-install-on-windows-with-codeblocks-and-mingw/.
I've got as far as building the test program at the end successfully, but when I try to run it I get the following error: "The application was unable to start correctly (0xc00000be). Click OK to close the application."
The one thing that is certainly different from the tutorial for me is that I'm working with OpenCV 3.0.0, Code::Blocks 13.12 and the latest version of mingw (number not obvious from their website or the installer).
I found that other people had had this problem in the past, e.g. The application was unable to start correctly (0xc00000be)
However, it has been a long time since that thread was active, I'm working with newer versions of the software and, most importantly, the answer given there didn't help (I compiled openCV with the same mingw that I'm using with Code::Blocks), so I thought this question would be worth asking (sorry if it's not, I'm rather new to this).
Could anybody suggest a fix that might get rid of this error?
A few other things to note:
I didn't download the Code::Blocks that came with mingw as I was advised against it, I got them separately as per the tutorial
I have installed OpenCV and Code::Blocks on my E: drive, though mingw is still on my C:.
I have added both mingw and OpenCV to my PATH variable, and mingw to my Path variable
I have linked the libraries in both the main compiler settings for Code::Blocks and the Build Options of my project.
I'm working from a 64-bit Windows 7 Laptop, but I have done everything 32-bit style as advised in the tutorial.
Thanks in advance!
So, one solution I've found to this problem is to copy all the .dll files from "...\opencv\build\x86\mingw\bin" to the project file (build directory).
Having done that, the project will run fine. This still doesn't (directly) explain why it wont run without those files (at least, several sources including the tutorial imply it should), and so isn't really optimal. I will continue to look for a solution for this so I don't have to clutter every opencv project I make with the .dlls.
However, for anyone simply wanting to get stuck into coding who is having this problem, I recommend that solution.
I have been trying out using Eclipse CDT for a course I am taking. Previously I have been using Visual Studio Express but since that requires me to be online and I have to use the IDE+compiler offline, I switched to Eclipse + Cygwin GCC.
Now everything was working prefectly, until I got an error about file paths in my make file. After reading some of the posts online, the issue seemed to be that Cygwin's make does not resolve absolute Windows file paths because of the ':' symbol and confuses it with a new target definition. The proposed fix was to download a fixed make file. I diligently did so and the programs would compile fine.
But after I went into the first debug session, everything froze. I aborted eclipse and tried a clean build but now the compilation wont happen AT ALL, which is very weird for me.
I can't find a post for a similar problem so I am really stuck now. I was currently working the assumption that my CDT may be corrupt or something so I downloaded Eclipse Luna just today and tried building using that, but no joy. Even a fresh project in a new workspace wont compile.
Appreciate the help in advance.
Did you try redownloading Eclipse? Sometimes Eclipse gets a fatal error glitch that makes it unable to compile anything. I've had this problem before, the only way i was able to fix it was to uninstall and re download the latest version. If this doesnt work, try switching to Bloodshed Dev C++ or codeblocks.
So it seems like an issue with the new make (v3.80). upgating it to v4.08 fixed the issue of not building.
Version 4.08 however does not fix the Windows file paths not being recognized properly and treated as a target definition. I am still getting the multiple target patterns. stop error.
EDIT: Found this on Stack overflow to solve the issue... should have searched better previously.
Very simple application fails with "multiple target patterns" from Eclipse
I have just started to learn about how C++ works however it seems that any source code I get I can not get to compile. Even when I try to copy the tutorials in their own project I get errors. For example, when I want to follow along with this, http://www.directxtutorial.com/Lesson.aspx?lessonid=11-1-3 Visual Studio gives me back tons of errors. http://gyazo.com/7131e8d21a8aa5c44c68f3e846da7921 Can anyone tell me how to fix this? I have tried many different OpenGL and DirectX tutorials and none of them seem to work (on several computers). I then tried Code Blocks and got that doesn't seem to work either.
You need to do some changes in project settings.
Go to project properties->General->Character Set, use the "Use Unicode Character Set" and then compile the project. It will work perfectly.
I am trying to get the NetBeans IDE to work with the g++ compiler. I am downloading from cygwin. I've tried googling the problem and I have tried many things to get C++ to work on NetBeans. I can't figure out the magic trick so I am asking for your help.
I have two problems, I don't know if these problems are related to each other.
Problem one: I get this error when I try to run my small program.
Problem Two:I get a "Cannot find include file <iostream>". When I hold ctrl and hover over the include directory my compiler says Unresolved directive #include<iostream>
I followed this NetBeans Guide on how to install and configure C++ support. Following those directions I had received the two errors above.
Here is what my environment variable looks like: this
Here is what the C/C++ build tools look like for NetBeans: this
Here is the code I am trying to run; this
At the moment I am installing everything from the development tab in the cygwin setup program.
I've tried messing with different settings but the two problems were still there.
I've tried running NetBeans in admin mode but the two problems were still there
I've tried un-installing cygwin and installing minGW. That fixes problem number one, but the there is no output when the program runs.
I've tried adding C:\cygwin64\lib\gcc\x86_64-pc-cygwin\4.8.2\include\c++ to the "Include Directories and Headers" in Properties -> Build -> C++ Compiler. This resolved iostream, but the other directives under iostream had the same problem, that the other include files could not be found.
I've been at this problem for five hours or so. Any help would be appreciated.
Here is what I am running:
Windows 7 64 bit
NetBeans 7.4
If you need anything else, just ask.
The answer was that my firewall, comodo firewall, was sand boxing the files that needed to run. After disabling the sand boxing feature NetBeans ran fine.