Recent Posts

Pages: [1] 2 3 4 5 6 ... 10
1
To hs:

Code
-mmcu=atmega8

The above is likely wrong.

You likely want
Code
-mmcu=avr4
along with
Code
-D__AVR_ATmega8__

This info found on https://gcc.gnu.org/wiki/avr-gcc

Note: Please tell us whether a CB Wizard or you the user set these values.

Edit: Looks like the CB Wizard and Compiler settings; I am guessing both being wrong is not likely; maybe the just the linker using
Code
-mmcu=atmega8
is wrong, instead.

Tim S.
2
Using Code::Blocks / Syntax highlight
« Last post by ben79 on Yesterday at 10:29:38 pm »
Hey there, I want that my editor will automatically highlight common keywords like "printf", "stderr", "malloc" etc in a color of my choice.

I tried manually adding those keywords to the "Keywords" list that's located in "Setting>Editor>Syntax highlighting" and it did worked, but I couldn't chose a specific color in which the added keywords will be highlighted (it just highlighted all of them in blue).

Much thanks to everyone that try to help,
Ben.
3
Help / Re: No such file or directory "error not input file" Build filed 2 errors
« Last post by hs on Yesterday at 08:36:22 pm »
please help for this error in code blocks

-------------- Build: Debug in 1 (compiler: GNU GCC Compiler for AVR)---------------

avr-gcc.exe -Wall -mmcu=atmega8 -DF_CPU=16000000UL -g -IC:\WinAVR\avr\include -c fuse.c -o obj\Debug\fuse.o
avr-gcc.exe -Wall -mmcu=atmega8 -DF_CPU=16000000UL -g -IC:\WinAVR\avr\include -c main.c -o obj\Debug\main.o
avr-gcc.exe -LC:\WinAVR\avr\lib -o bin\Debug\1.elf obj\Debug\fuse.o obj\Debug\main.o  -mmcu=atmega8 -Wl,-Map=bin\Debug\1.map,--cref 
avr-gcc.exe: fatal error: cannot read spec file 'device-specs/specs-atmega8': No such file or directory
compilation terminated.
Process terminated with status 1 (0 minute(s), 0 second(s))
 
avr-gcc.exe: fatal error: cannot read spec file 'device-specs/specs-atmega8': No such file or directory
compilation terminated.
Process terminated with status 1 (0 minute(s), 0 second(s))
2 error(s), 0 warning(s) (0 minute(s), 0 second(s))
 
4
General (but related to Code::Blocks) / Re: Exercise files
« Last post by SashaGT on Yesterday at 07:20:45 pm »
This forum isn't the place to be asking.

They're likely from a site that embedded the tutorial videos.
I'd suggest messaging the YouTube channel.. but it doesn't seem like it was originally their video. If you were to view the original video's description there's a bunch of dead social media links.

It's unlikely you'll find these files; the vibes of the account tells me they were behind a paywall that likely no longer exists.
5
Nightly builds / Re: The 04 June 2023 build (13311) is out.
« Last post by UberNewb2 on Yesterday at 04:45:11 pm »
Between 13215 and 13311 a change was made in the shift tab behavior. It now moves left in the tabs of open files, instead of un-indenting one tab stop. I *really* miss that.

For Windows, you can try renaming (or deleting) the File "default.cbKeyBinder20.conf" in "C:\Users\username\AppData\Roaming\CodeBlocks".

That works for me.
Ah thank you very much, that solved it. Closed CB, deleted the file, restarted, and it resumed the old behavior. You're awesome.
6
Help / compiler flag settings of wxWidgets project wizzard incompatible!
« Last post by myztmy on Yesterday at 02:47:21 pm »
C::B is latest nightly builds (svn 13311), compiler is winlibs-x86_64-mcf-seh-gcc-13.1.0-mingw-w64ucrt-11.0.0-r1.

when I click  menu   " file->new->project...->wxWidgets project"  using wxWidgets project wizzard  to create a  simple wxWidgets gui  project,  build  it I receive  following errors:
Code
||=== Build: Debug in HelloWxWidgets (compiler: GNU GCC Compiler) ===|
{standard input}|22729|Error: junk at end of line, first unrecognized character is `.'|
{standard input}|37534|Error: junk at end of line, first unrecognized character is `.'|
{standard input}|44118|Error: junk at end of line, first unrecognized character is `.'|
{standard input}|48427|Error: junk at end of line, first unrecognized character is `.'|
{standard input}|52616|Error: junk at end of line, first unrecognized character is `.'|
{standard input}|85397|Error: junk at end of line, first unrecognized character is `.'|
||=== Build failed: 6 error(s), 0 warning(s) (0 minute(s), 40 second(s)) ===|

It is assembler errors ,and I check the project build options and notice  wxWidgets project wizzard  auto add  a compiler flag "-pipe" to it  ,  remove that flag and rebuild the project  successfully.

open wizzard.script I find such code:
Code
        else if (GetCompilerFactory().CompilerInheritsFrom(Wizard.GetCompilerID(), _T("gcc*")))
        {
            project.AddCompilerOption(_T("-pipe"));
            project.AddCompilerOption(_T("-mthreads"));
            project.AddLinkerOption(_T("-mthreads"));
            project.AddCompilerOption(_T("-D__GNUWIN32__"));
            project.AddCompilerOption(_T("-D__WXMSW__"));
            if (IsDLL)
                project.AddCompilerOption(_T("-DWXUSINGDLL"));
            if (IsUnicode)
                project.AddCompilerOption(_T("-DwxUSE_UNICODE"));
        }

I don't understand why the author added the "-pipe" flag to gcc compiler on Windows but not add to gcc compiler on non Windows platforms  .Use pipes rather than temporary files for communication between the various  stages of compilation may work well on linux or unix, but maybe incompatible in windows.

I don't know which section of the forum is suitable for posting this content , just send it here .

Just a reminder for users who encounter this issue.

Regards



7
Nightly builds / Re: The 04 June 2023 build (13311) is out.
« Last post by jeRRy on Yesterday at 12:05:27 pm »
Between 13215 and 13311 a change was made in the shift tab behavior. It now moves left in the tabs of open files, instead of un-indenting one tab stop. I *really* miss that.

For Windows, you can try renaming (or deleting) the File "default.cbKeyBinder20.conf" in "C:\Users\username\AppData\Roaming\CodeBlocks".

That works for me.
8
Nightly builds / Re: The 04 June 2023 build (13311) is out.
« Last post by myztmy on Yesterday at 11:28:05 am »

Resolved Fixed:
  • fixed compiler detection of MinGW as supplied by installer is not working

Regressions/Confirmed/Annoying/Common bugs:

Yes, it can detect compiler  in my  MinGW64  directory now , but the compiler is judged as "GNU GCC Compiler" ,  not exactly as "GNU GCC MinGW64 Compiler" . Although this may not be relevant, the compiler still works normally,  but I can't stand it, just because I'm am a perfectionist ,virgo.

P.S.  Now that  every  nightly builds  C::B needs the other two files of the corresponding version  to run,  and  most easiest way is to unzip both of them into the same directory where you unzipped the nightly  , why not pack them together into a file,
Let's download once and unzip once  instead of  download three times and unzip three times :(.

Regards

9
Plugins development / Re: Code completion using LSP and clangd
« Last post by myztmy on Yesterday at 09:53:36 am »
@ myztmy

In order to be precise, we'll need you to paste your source code here between code tags. Paste the main.cpp code in your response using the "#" icon  above the face icons. For example the "#" icon produces code tags that look like this:
[ code ] your main.cpp source[/ code ] (without the spaces around "code".
The "#" icon and face icons appear when you  click on the "Reply" or "Quote" buttons.

I see that there are enough compile errors and warnings that it would confuse clangd. I think you're missing some #include statements. But we need to see your code first.

Regards

I've been struggling with "clangd"  for a whole day!

With another win7 machine I install "GCC 13.1.0 (with POSIX threads) + LLVM/Clang/LLD/LLDB 16.0.5 + MinGW-w64 11.0.0 (UCRT) - release 5" which Clang and Mingw are in the same  bin directory . This time , "clangd" can find the standard lib header files , add a string type variable it can identify the correct type and give the right hint. But it just made me happy for a few seconds. After using class wizzard add a simple class , clangd don't konw the new class and then don't give correct hint ,everything has become a mess again.

Go back to my MinGW-w64 and LLVM separate installation win7 machine , I try to throw clangd.exe into MinGW-w64 bin directory ,  the C::B always Pop up dialog box complain "can't dectect clangd.exe" . Placing clangd.exe in any other directory is no problem. In this machine clangd  although can find user class but can't find standard lib class, also not working properly.

Most of the existing bugs now of "clangd"  also existed  in  "Code completion" of C::B(win) 20.03 release ,  but the latest nightly builds version have fixed "Code completion" almost all bugs except freeze  (I only have used C::B for ten days, and only tested those two C::B versions ). "clangd" seems like "Yesterday Once More" . I guess "clangd" has referenced some code from "Code completion" of older versions. 

Now that you mention "#", let me show you a "funny" image(I really know what you mean ,but the imge explains everything, I don't think I need use "#" icon to post my so simplest source code :P ).

Regards

 
10
Help / Re: Printing loops doesn't show all answers
« Last post by Pecan on Yesterday at 06:59:15 am »
This forum is for questions relating to programming
 the CodeBlocks IDE, not a general programming help forum.

Use google to search for "general c++ help forum".

A hint though: Not all integers (or chars(in your case)) make a printable character.

Google for "chart of printable chars".
 
Pages: [1] 2 3 4 5 6 ... 10