Author Topic: Can't Open Code::Blocks (Windows 8.1 machine)  (Read 22935 times)

Offline DragonOsman2

  • Multiple posting newcomer
  • *
  • Posts: 12
Can't Open Code::Blocks (Windows 8.1 machine)
« 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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Can't Open Code::Blocks (Windows 8.1 machine)
« Reply #1 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.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline DragonOsman2

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: Can't Open Code::Blocks (Windows 8.1 machine)
« Reply #2 on: December 04, 2013, 05:58:51 pm »
What should I change its name to?  Sorry if this is a stupid question.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Can't Open Code::Blocks (Windows 8.1 machine)
« Reply #3 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.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline DragonOsman2

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: Can't Open Code::Blocks (Windows 8.1 machine)
« Reply #4 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.
« Last Edit: December 04, 2013, 07:08:16 pm by DragonOsman2 »

Offline scarphin

  • Lives here!
  • ****
  • Posts: 644
Re: Can't Open Code::Blocks (Windows 8.1 machine)
« Reply #5 on: December 04, 2013, 08:05:19 pm »
I get that, but what I should I rename the file to?  
Doesn't matter!

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Can't Open Code::Blocks (Windows 8.1 machine)
« Reply #6 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.....

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Can't Open Code::Blocks (Windows 8.1 machine)
« Reply #7 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.

Offline DragonOsman2

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: Can't Open Code::Blocks (Windows 8.1 machine)
« Reply #8 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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Can't Open Code::Blocks (Windows 8.1 machine)
« Reply #9 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.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline DragonOsman2

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: Can't Open Code::Blocks (Windows 8.1 machine)
« Reply #10 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.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline DragonOsman2

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: Can't Open Code::Blocks (Windows 8.1 machine)
« Reply #12 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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Can't Open Code::Blocks (Windows 8.1 machine)
« Reply #13 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.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline DragonOsman2

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: Can't Open Code::Blocks (Windows 8.1 machine)
« Reply #14 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.

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Can't Open Code::Blocks (Windows 8.1 machine)
« Reply #15 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.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Can't Open Code::Blocks (Windows 8.1 machine)
« Reply #16 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.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline DragonOsman2

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: Can't Open Code::Blocks (Windows 8.1 machine)
« Reply #17 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? 

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Can't Open Code::Blocks (Windows 8.1 machine)
« Reply #18 on: December 06, 2013, 09:18:29 pm »
Please respect our forum rules !!
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