Code::Blocks Forums

User forums => Help => Topic started by: DragonOsman2 on December 04, 2013, 04:54:30 pm

Title: Can't Open Code::Blocks (Windows 8.1 machine)
Post by: DragonOsman2 on December 04, 2013, 04:54:30 pm
Hey, there, everyone.

My problem, specifically, is that although the Code Blocks icon appears on my task bar when I try to open it, the window itself doesn't appear.  I tried uninstalling and then installing it again, but I get the same issue.  Until earlier in the day yesterday, it was working just fine, but then I started having this issue. 

Does anyone know how I could fix this?

Thanks.
Title: Re: Can't Open Code::Blocks (Windows 8.1 machine)
Post by: oBFusCATed on December 04, 2013, 05:51:40 pm
Find default.conf and rename if. The file is somewhere in your AppData under the codeblocks directory.
Title: Re: Can't Open Code::Blocks (Windows 8.1 machine)
Post by: DragonOsman2 on December 04, 2013, 05:58:51 pm
What should I change its name to?  Sorry if this is a stupid question.
Title: Re: Can't Open Code::Blocks (Windows 8.1 machine)
Post by: oBFusCATed on December 04, 2013, 06:30:38 pm
Sorry I wasn't clear enough. The idea is to remove the file and let C::B create a clean one.
But it you remove it then you'll loose all your settings, so renaming it will back it up and will let you restore it if this is not the cause for the problem.
Also if this is the cause of the problem you can copy parts of the old settings.
Title: Re: Can't Open Code::Blocks (Windows 8.1 machine)
Post by: DragonOsman2 on December 04, 2013, 06:56:33 pm
I get that, but what I should I rename the file to?  

And I got this error while trying to build a program: "LINK||fatal error LNK1104: cannot open file 'kernel32.lib'".

What should I do for that?

Edit: Okay, never mind.  I got that default.conf thing down.  Now it's just error, and also another problem: when I try to create a project, it gives me the message "couldn't save project invalid path" and also "maybe the file is write protected?".  I don't get it.
Title: Re: Can't Open Code::Blocks (Windows 8.1 machine)
Post by: scarphin on December 04, 2013, 08:05:19 pm
I get that, but what I should I rename the file to?  
Doesn't matter!
Title: Re: Can't Open Code::Blocks (Windows 8.1 machine)
Post by: BlueHazzard on December 04, 2013, 08:11:20 pm
Now it's just error, and also another problem: when I try to create a project, it gives me the message "couldn't save project invalid path" and also "maybe the file is write protected?".  I don't get it.

hmmm. lets look a bit: what does the error say:  "couldn't save project invalid path". What could this probably mean? Maybe your path to the project is not correct... But i'm only speculating right now.....
Title: Re: Can't Open Code::Blocks (Windows 8.1 machine)
Post by: Jenna on December 04, 2013, 08:14:45 pm
On Win 8 you can not save files in some directories, e.g. in the "Program files" folder, at least not from an editor or from C::B.
So make sure you have proper access rights to the folder you try to create the project in.
Title: Re: Can't Open Code::Blocks (Windows 8.1 machine)
Post by: DragonOsman2 on December 04, 2013, 09:04:44 pm
I'm saving it in Documents.  I don't think it's being saved in a folder that I don't have rights in.

Ah.  I think I see the problem now.  I was making a pretty dumb mistake.  I don't want to say what it is, though.
Title: Re: Can't Open Code::Blocks (Windows 8.1 machine)
Post by: oBFusCATed on December 04, 2013, 09:07:07 pm
I don't want to say what it is, though.
And then no one would benefit from your topic/experience, if he/she happens to do a search in the internet.
Title: Re: Can't Open Code::Blocks (Windows 8.1 machine)
Post by: DragonOsman2 on December 04, 2013, 09:18:21 pm
Okay, I'll say it then: I didn't specify a folder to save the Project in.  The translated path for the file was then designated as "<invalid path>".

And it seems l'm still getting that one error message when I try to build a program.  The error message is: "fatal error LNK1104: cannot open file 'kernel32.lib'".  So I still need help there.
Title: Re: Can't Open Code::Blocks (Windows 8.1 machine)
Post by: stahta01 on December 04, 2013, 10:16:53 pm
http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F (http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F)
Title: Re: Can't Open Code::Blocks (Windows 8.1 machine)
Post by: DragonOsman2 on December 05, 2013, 10:55:45 am
I downloaded Windows SDKs and Added the Kernel32.lib file into the Compiler in Linker settings.  Now I'm able to build programs without getting that error. 

I couldn't use the command "cl" on my Command Prompt; it kept saying that it's not a valid command for internal or external operations (I was using Command Prompt with Admin and Developer rights).  I might need to have it show me a list of commands so I can see what the valid command is for accessing the command line.  If there is one.  But I don't know the command for that.
Title: Re: Can't Open Code::Blocks (Windows 8.1 machine)
Post by: oBFusCATed on December 05, 2013, 11:04:10 am
I couldn't use the command "cl" on my Command Prompt;
You have to setup you env variables in order to get this. Most of the times there is a bat file that does this, but I don't know if the SDK ships with it.
The Visual studio installations have it.
Title: Re: Can't Open Code::Blocks (Windows 8.1 machine)
Post by: DragonOsman2 on December 05, 2013, 11:41:29 am
I have the Visual Studio C++ 2010 version.  The language I'm actually using right now is just C, though, not C++.  I'm a beginner in programming and I thought I'd start with C.

That said, I currently keep having errors all of a sudden; I got these errors: ..\ex0504\main.c|8|error C2059: syntax error : ')'|
..\ex0504\main.c|9|error C2065: 'OCTO' : undeclared identifier|
..\ex0504\main.c|9|error C2146: syntax error : missing ')' before identifier 'OCTO'|
..\ex0504\main.c|10|error C2065: 'OCTO' : undeclared identifier|
..\ex0504\main.c|10|error C2146: syntax error : missing ')' before identifier 'OCTO'|
..\ex0504\main.c|11|error C2065: 'OCTO' : undeclared identifier|
..\ex0504\main.c|11|error C2146: syntax error : missing ')' before identifier 'OCTO'|
||=== Build finished: 7 errors, 0 warnings (0 minutes, 0 seconds) ===|


And just in case, here's my source code: #include <stdio.h>

#define  VALUE 2 OCTO 8

int main()
{
    puts("Values VALUE and OCTO:");
    printf("Addition is %d\n",OCTO+VALUE;
    printf("Subtraction is %d\n",OCTO-VALUE);
    printf("Multiplication is %d\n",OCTO*VALUE);
    printf("Division is %d\n",OCTO/VALUE);
    return 0;
}

If there's something I'm doing wrong, please let me know. Thanks.
Title: Re: Can't Open Code::Blocks (Windows 8.1 machine)
Post by: thomas on December 05, 2013, 12:35:06 pm
Yes, there are several things wrong. First, this is not a general C programming forum, so it's the wrong place to ask why your code does not compile.

Second, you're using invalid syntax in your #define, third you're missing a closing brace for the second printf.

As a side note, learning C++ but starting with C for now is an approach that is discouraged. C and C++ are different languages. While it is perfectly acceptable to learn C (and later C++), experts recommend that if you plan to learn C++ that you start with that right away.
Title: Re: Can't Open Code::Blocks (Windows 8.1 machine)
Post by: oBFusCATed on December 05, 2013, 01:33:11 pm
And forth: Visual studio C++ (cl.exe) is the wrong compiler to use, because it is not a C, but C++ compiler.
Title: Re: Can't Open Code::Blocks (Windows 8.1 machine)
Post by: DragonOsman2 on December 06, 2013, 09:08:19 pm
Alright, I get all that.  I'm only going to bother you guys with hopefully just one question before I move on to C++ (after I'm done with C, I mean). 

I get this error when trying to use the getc() function in my code: main.c|9|error C2198: 'getc' : too few arguments for call|

The source code is:
Quote
#include <stdio.h>

int main()
{
    int c;
    int getc();

    printf("I'm waiting for the character: ");
    c = getc();
    printf("I waited for the '%d' character\n",c);
    return 0;
}


Anything you can help me with here? 
Title: Re: Can't Open Code::Blocks (Windows 8.1 machine)
Post by: Jenna on December 06, 2013, 09:18:29 pm
Please respect our forum rules (http://forums.codeblocks.org/index.php/topic,9996.0.html) !!
Yes, there are several things wrong. First, this is not a general C programming forum, so it's the wrong place to ask why your code does not compile.
And you should learn to search for documentation yourself, for C/C++ functions a site like cppreference.com is not the worst choice.
For your special question:
http://en.cppreference.com/w/c/io/fgetc (http://en.cppreference.com/w/c/io/fgetc)