How to fix cb_console_runner.exe failed on CodeBlocks? - codeblocks

I could not run any program in CodeBlocks. When I click to run button, then log tab display this message. I was trying to fix this problem by reinstall codeblocks but It doesn't work. Also search google but can't find any solution.
Executing: C:\Program Files (x86)\CodeBlocks/cb_console_runner.exe "D:\Timus\test.exe" (in D:\Timus)
Execution of 'C:\Program Files (x86)\CodeBlocks/cb_console_runner.exe "D:\Timus\test.exe"' in 'D:\Timus' failed.
Here is my small program
#include <stdio.h>
int main()
{
printf("Hello World\n");
return 0;
}

I just found a solution from CodeBlocks Forum.
The default install directory for Code Blocks was, C:/Program Files (x86)/codeblocks, which MingW installer did not like due to the 'white spaces' in Program Files (x86).
So reinstall the full codeblocks in different directory with no spaces in its name e.g. C:/codeblocks from C:/Program Files (x86)
And it's now work and my problem is solved.

Related

Linker Error When Changing Visual Studio Output to System32

For a research, I'm developing a Proxy DLL for nvcuda.dll (NVIDIA CUDA runtime) which resides in System32. To ease up debugging I change linker output to System32, however, I receive
LINK : fatal error LNK1104: cannot open file 'C:\Windows\System32\nvcuda.dll'
Here are the solutions I have tried:
Disabled the UAC.
Took ownership of System32 folder.
Ran the program as admin.
There are no white-spaces in the path to the file and no other program uses the DLL (it can be removed and renamed manually). The linker works fine for any other location, am I missing something?
EDIT:
An interesting observation is that I am able to build the same solution using msbuild as follows:
msbuild nvcuda.sln /p:Configuration=Debug /p:Platform=x64

Using a DLL with Qt in Visual Studio

I'm trying to use a DLL with a Qt project in Visual Studio. Normally to use a DLL, it is put in the program's executable directory. However, after putting the DLL in just about every directory I could think of, it is still not being used by the program. Is there anything extra that I need to do aside from putting the DLL in the executable directory? Thanks.
The dll should be in the working directory of the executable. This is listed under the "Debugging" section of the Project Properties.
Almost all of the Qt plugin directories need to be in a specific folder next to the exe for it to be found (imageformats, platforms, etc).
Another way to find out if you are in the right directory is to add this line to your main.cpp:
#include <QDir>
#include <QDebug>
qDebug() << "Current Directory:" << QDir::currentPath();
Hope that helps.
PS also look at the order of dll search directories for windows. I'll post more later about it. https://msdn.microsoft.com/en-us/library/windows/desktop/ms682586(v=vs.85).aspx#search_order_for_desktop_applications

Visual Studio is unable to open include files

error C1083: Cannot open include file: 'X11/Intrinsic.h': No such file or directory
IntelliSense: cannot open source file "X11/Intrinsic.h"
IntelliSense: cannot open source file "GL/glx.h"
#include <X11/Intrinsic.h> /* Display, Window */
#include <GL/glx.h> /* GLXContext */
You're trying to compile unix software in msvc. Give up.
You may be able to succeed using mingw or cygwin, but in this case it won't be easy since compiling desktop software (as this seems to be) is always much more complex.

How to install and use YAML-Cpp

I want to learn YAML (and use it with C++) but i'm stuck trying to setup YAML-Cpp.
Let me explain what i've done so far.
I downloaded the source code (version 0.5.1)
Installed Cmake (for Windows)
Installed the Boost libraries (precompiled for Visual Studio 2010)
EDIT:
Built the solution and the INSTALL project
Then i got two folders on my C drive: include and lib
Then i moved it to another folder on my D drive (maybe it's relevant)
For testing, i created a project in V Express and tried to compile this:
#include "yaml-cpp/yaml.h"
int main()
{
YAML::Emitter out;
out << "Hello, World!";
std::cout << "Here's the output YAML:\n" << out.c_str();
return 0;
}
The new result:
d:\development\yamlcpp 0.51\include\yaml-cpp\node\ptr.h(10): fatal error C1083: Cannot open include file: 'boost/shared_ptr.hpp': No such file or directory
Can somebody please tell me what is the right way to build and configure this library?
It looks like you're not including the proper directory. In Visual Studio, there's an option for the "include directories" - make sure that the include directory for yaml-cpp is listed there.
marlon, you need to download boost-cpp (http://sourceforge.net/projects/boost/files/boost/1.58.0/), compile it and ensure to "include directory" in Visual Studio.

Still nmake problem with Unicode-Map-0.112 after trying vcvarsall.bat [duplicate]

This question already has answers here:
How do I use MS C++ Express 2008 to build Perl Unicode::Map on Windows?
(2 answers)
Closed 6 years ago.
Many thanks to ephemient for recommending to try vcvarsall.bat.
In DOS successfully ran vcvarsall.bat, which was part of MS C++ Express 2008
Next I continued to try to follow the PerlMonks advice by using ppm, i.e. http://www.perlmonks.org/?node_id=434813
So I tried to make, really nmake Unicode-Map-0.112 again. I received one more issue:
C:\perl\lib\core\win32.h (61) : fatal error C1083: Cannot open include
file: 'windows.h': No such file or directory.
NMAKE: fatal error U1077: 'C:\Program Files\Microsoft Visual Studio
9.0\VC\Bin\Cl.exe: return code '0x2'
Stop
I turns out that I do have the Windows.h file:
Windows.h is located in C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include
I'm guessing I just also need to Windows.h to the PATH as well.
Does this sound correct or is there another route I should be traveling as I'm stumbling ahead?
Thanks again.
The problem with going down this route is that your perl was compiled using a different compiler. You are much better off downloading the package and installing it via ppm as I described in How do I use MS C++ Express 2008 to build Perl Unicode::Map on Windows?.
As for the compilation to work, you need to invoke the SetEnv.cmd script which you can find in the Bin directory of your platform SDK installation after the vcvarsall.bat script.
You need to do all of your calls to nmake from an environment that is initialized with the variables for the SDK version you're using. (v6.0A in your case).
In your start menu, go to the 'Microsoft Windows SDK *' menu folder, and start the CMD shell from there.
Inside that CMD shell, cd to your code directory and run nmake from there.

Resources