Author Topic: Help Required  (Read 8259 times)

Offline reazon1n1

  • Single posting newcomer
  • *
  • Posts: 6
Help Required
« on: February 21, 2011, 07:22:08 pm »
Hi, I just switched to CODEBLOCKS 10.05 from Code::Blocks 8. and Dev C++.
After i installed Code::blocks 10.05and tried to run my previously saved C++ programs, I couldnt run them.

With Code::Blocks 8.0
To be more clear, when I run a source file placed on desktop, it runs without any problem but if I place the same source file somewhere else in my hard disk other than the desktop,then the program doesnt run.
If the source file is not placed in the desktop, then Starting from the first line, error messages popup when pressed F9.
Why does this happen?? I keep my files and folders very organized in my PC and I dont want to keep all my source files on desktop. Can anyone tell me whats happening??

With Code::Blocks 10.05
After going through this site, I downloaded the new version(10.05) of Code::Blocks thinking that my above mentioned problem would be solved. But now in this new version, its more worse. Now, no matter where I keep my source files, they dont run. Infact this time, no error messages, nothing popups. The screen is just filled with my codes and nothing comes even I press F9 or click any of the options in the BUILD menu.

I really dont want to switch to Dev++,so please help me guys!!!
 :( :( :( :( :( :(
« Last Edit: February 21, 2011, 07:24:01 pm by reazon1n1 »

Online stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Help Required
« Reply #1 on: February 21, 2011, 08:03:38 pm »
The name and version of Compiler!
The name and version of your OS!
If you do NOT give the basic info needed to help; do not expect much help.
What ERRORS are you getting?

Tim S.
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 reazon1n1

  • Single posting newcomer
  • *
  • Posts: 6
Re: Help Required
« Reply #2 on: February 22, 2011, 03:55:24 am »
I am using XP SP2.
All I know is i cant write programs in Code::Blocks. I dont know the version of my copiler. Can u tell me how to see that?? Just to let u know, I donwloaded the latest Code::Blocks 10.05 from the official site og Code::Blocks.
I've already posted my problems in the first post. I hope am clear!

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Help Required
« Reply #3 on: February 22, 2011, 06:47:32 am »
No you're not clear, there are many people posting the same problem in the same way... no info at all to be helped...

There are two versions of C::B's installer one with and one without compiler included, which one you've used?
(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 seb_seb0

  • Almost regular
  • **
  • Posts: 166
Re: Help Required
« Reply #4 on: February 22, 2011, 09:46:50 pm »
Hi, I just switched to CODEBLOCKS 10.05 from Code::Blocks 8. and Dev C++.
After i installed Code::blocks 10.05and tried to run my previously saved C++ programs, I couldnt run them.

With Code::Blocks 8.0
To be more clear, when I run a source file placed on desktop, it runs without any problem but if I place the same source file somewhere else in my hard disk other than the desktop,then the program doesnt run.
If the source file is not placed in the desktop, then Starting from the first line, error messages popup when pressed F9.
Why does this happen?? I keep my files and folders very organized in my PC and I dont want to keep all my source files on desktop. Can anyone tell me whats happening??

With Code::Blocks 10.05
After going through this site, I downloaded the new version(10.05) of Code::Blocks thinking that my above mentioned problem would be solved. But now in this new version, its more worse. Now, no matter where I keep my source files, they dont run. Infact this time, no error messages, nothing popups. The screen is just filled with my codes and nothing comes even I press F9 or click any of the options in the BUILD menu.

I really dont want to switch to Dev++,so please help me guys!!!
 :( :( :( :( :( :(

Hi,

Since you did not gave a lot of information, the best way would be to de-install and reinstall. Try to follow these steps:
   1 - De-install Code::Blocks => Use Control Panel / uninstall software to do that cleanly
   2 - Download the following file: codeblocks-10.05mingw-setup.exe from here:
http://www.codeblocks.org/downloads/26
   3 - run the setup. It is pretty straightforward.
         Advice: avoid using path with spaces. "C:\Program Files" for instance.
         It is possible to use CodeBlocks + Mingw with such a path, but it requires more configuration. Keep it simple for now, and avoid it.
         Install on C:\ directly.

   4 - once done, it is time to configure. Start Code::Blocks. In the menu "Settings", select "Compiler & Debugger..."
         Select the category "Global Compiler Settings" on the left bar
         In the dialog pane, in the combo "Selected Compiler", select "GNU GCC Compiler"
         Click on the button "Set as default"

         Click on the tab "Toolchain Executable"
        
         In the text box "Compiler's installation directory", check that the path indicated leads to the Mingw compiler (this is the path of the folder containing the "bin", "include" and "lib" directories. A typical path is "C:\Mingw".)

     5 - Click on  the tab "Other settings"
           In "Compiler logging", select "Full Command line"
           Click OK

     6 - Quit Code::Blocks (menu File -> Quit). It will ensure that your settings are saved.

     7 - Restart it.

     8 - Go in menu "Settings" and select "Environment"
          In the category "General Settings" on the left, select "Check & Set files associations"
          Click on the button "Set now".

     9 - In the menu "View" / "Perspective", make sure that "Code::Blocks default" is selected.

     10 - Quit Code::Blocks and restart.

Now your problem should be solved.
Report back on your success (or failure...). In case of failure, make sure to :
      - tell us what you did
      - send the compiler error message and / or CodeBlocks error message
      - You can attach a screenshot, using www.imageshack.com for example.

I suggest you to take the time to explore the options in CodeBlocks (menu settings"). It is worthwhile, and it will save you a lot of trouble.
Granted, it can be intimidating (lot and lot of options), but this is what makes CodeBlocks so powerful.

Good luck !

Sebastien

        
« Last Edit: February 22, 2011, 09:59:05 pm by seb_seb0 »

Offline reazon1n1

  • Single posting newcomer
  • *
  • Posts: 6
Re: Help Required
« Reply #5 on: February 26, 2011, 01:16:57 am »
^^^

Hi, now its working fine without any problem.
Well, what I did was:
uninstalled the previous codeblocks 8.02, downloaded the codeblocks-10.05mingw-setup.exe setup and installed it.Now its working totally great.I didnt have to edit any of the settings. I tried to examine the new 10.05 version in my PC in every possible way, and I didnt find any problem. I'm happy that the setup with MINGW is running fine and I didnt face any of the problems that I was facing earlier and I alisted above.

thanx a LOT sebastian for ur help...

HURRAY  :D :D :D :D :D :D :D :D :D :D :D

Offline reazon1n1

  • Single posting newcomer
  • *
  • Posts: 6
Re: Help Required
« Reply #6 on: February 26, 2011, 09:10:39 am »
Ok, now here comes the second problem that I'm facing with Codeblocks 10.05 mingw.
Its a minor one but i want to know if anyone here can help me out.

I am using Codeblocks10.05 to run C++ programs rather than C-programs. So everytime I write a C++ program with header files, like #include<cstdio>
             #include<cstdlib>
             #include<iostream> , and save it, the default file extension is *.C, and the saved file becomes a C source file . So after I save the file and next time run it, error messages like
error: cstdio: No such file or directory
error: cstdlib: No such file or directory
error: iostream: No such file or directory
appear and the program doesnt run.

But then again, if I save the file by typing *.cpp, it saves the file as C++ source file and the same program runs smoothly.

is there any setting that I can change so that the default extension to save a file is .cpp rather than .c??? I dont want to type .cpp with my hand everytime I save a  new C++ source file. can anyone help me out with this problem???

Any ideas welcomed.

I am using Windows XP service pack 2. and Codeblocks 10.05 MINGW.
« Last Edit: February 26, 2011, 09:13:27 am by reazon1n1 »

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1441
    • CenizaSOFT
Re: Help Required
« Reply #7 on: February 26, 2011, 04:23:13 pm »
I already suggested separating the extensions and having cpp as default, but it looks like no one really cared. I do not feel like doing it on my own without others giving at least their opinion.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Help Required
« Reply #8 on: February 26, 2011, 09:10:22 pm »
I do not feel like doing it on my own without others giving at least their opinion.
<opinion>Sounds good. Patch?</opinion>
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1441
    • CenizaSOFT
Re: Help Required
« Reply #9 on: February 26, 2011, 10:51:46 pm »
I do not feel like doing it on my own without others giving at least their opinion.
<opinion>Sounds good. Patch?</opinion>

Issue: The filter in the save dialog is populated from the lexers, causing C and C++ to be merged into a single filter where .c comes first (a single lexer handles both).

A quick solution would be to split the lexer into lexer_c.xml and lexer_cpp.xml, but that would imply a color set for C and another one for C++. Chances are high users will want a shared color set for both C and C++ files, so it will cause complaints.

Another solution would be to extend the internal definition of the lexer files, so they can have multiple name/filemaks sets intended for the save dialog. For the open dialog it may still be handy to use them as they are right now, or also have a specific tag.

Example:
Code
<?xml version="1.0"?>
<!DOCTYPE CodeBlocks_lexer_properties>
<CodeBlocks_lexer_properties>
<Lexer name="C/C++"
index="3"
filemasks="*.c,*.cpp,*.cc,*.cxx,*.h,*.hpp,*.hh,*.hxx,*.inl">
<SaveFilter name="C" filemasks="*.c"/>
<SaveFilter name="C header" filemasks="*.h"/>
<SaveFilter name="C++" filemasks="*.cpp,*.cc,*.cxx"/>
<SaveFilter name="C++ header" filemasks="*.hpp,*.hh,*.hxx,*.inl"/>
<OpenFilter name="C/C++" filemasks="*.c,*.cpp,*.cc,*.cxx,*.h,*.hpp,*.hh,*.hxx,*.inl"/>
<Style name="Default"
index="0"
fg="0,0,0"
bg="255,255,255"
bold="0"
italics="0"
underlined="0"/>
...

An extra change required would be in sdk/cbeditor.cpp at line 1722 (as today's revision):

Code
Filter = mgr->Read(_T("/file_dialogs/save_file_as/filter"), _T("C/C++ files"));

The default value would most likely turn into "C++ files".

The implementation would require more time than I have at hand. At least the why and a how are known now.

Offline reazon1n1

  • Single posting newcomer
  • *
  • Posts: 6
Re: Help Required
« Reply #10 on: February 27, 2011, 08:36:06 pm »
Hey, its working....
I opened the lexer_cpp file and just flipped the position of  <Lexer name="C/C++" index="3" filemasks="*.c,*.cpp,*.cc,*.cxx,*.h,*.hpp,*.hh,*.hxx,*.inl"> to <Lexer name="C++/C" index="3" filemasks="*.cpp,*.c,*.cc,*.cxx,*.h,*.hpp,*.hh,*.hxx,*.inl"> and it worked.....
now the default extension is cpp...

thanx Ceniza
« Last Edit: February 27, 2011, 08:42:28 pm by reazon1n1 »