Recent Posts

Pages: 1 2 [3] 4 5 6 7 8 ... 10
21
Help / Re: set the proportion to 0 will cause codeblocks crash
« Last post by Miguel Gimenez on September 19, 2023, 06:54:40 pm »
Created ticket 1415.
22
Development / Re: Error when compiling C::B svn 13356 with msys2/gcc
« Last post by Miguel Gimenez on September 18, 2023, 05:17:22 pm »
Looks like the modified compiler.cpp with the new overload for CheckForWarningsAndErrors() was not commited.
23
Development / Error when compiling C::B svn 13356 with msys2/gcc
« Last post by gd_on on September 18, 2023, 01:21:55 pm »
When I compile C::B svn 13356 with last g++ version form msys2 on windows (version 13.2.0), I obtain this error :
Code
compiler.o:compiler.cpp:(.rdata$_ZTV8Compiler[_ZTV8Compiler]+0x230)||undefined reference to `Compiler::CheckForWarningsAndErrors(wxString const&, long&, wxString&)'|
||error: ld returned 1 exit status|
probably in relation with modifications introduced in svn 13355 in compiler.h and advancedcompileroptionsdlg.cpp.
I tried a full rebuild.
24
Development / Re: compiling error
« Last post by Miguel Gimenez on September 18, 2023, 12:52:46 pm »
Post a full rebuild log, read this carefully for instructions.

EDIT: You are using the wrong forum, this is for C::B development only. Next time select another, for example Help.
25
Development / Re: compiling error
« Last post by MichaelAgarkov on September 18, 2023, 11:40:10 am »
Code
error: ld returned 1 exit status
is usually fixed by reinstalling the compiler. Here's others who got the same error.
26
Development / compiling error
« Last post by cpp_fanatic on September 18, 2023, 06:37:02 am »
I'm writing a lesson code from a C++ for dummies book and ran into this error.

Code
/*
        CallMemberFunction - define and invoke a function
                             that a member of the class Student

*/
#include <cstdio>
#include <cstdlib>
#include <iostream>
using namespace std;

class Student
{

 public:
     // add a completed course to the record
     double addCourse(int hours, double grade)
     {
       // calculate the sum of all courses times
       // the average grade
       double weightedGPA;
       weightedGPA = semesterHours * gpa;

       // now add in the new course
       semesterHours += hours;
       weightedGPA += grade * hours;
       gpa = weightedGPA / semesterHours;
       // return the new gpa
       return gpa;
     }
  int semesterHours;
  double gpa;
};

int main(int nNumberofArgs, char* pszArgs[])
{
    // create a Student object and initialize it
    Student s;
    s.semesterHours = 3;
    s.gpa = 3.0;

    // the values before the call

    cout << "Before: s = (" << s.semesterHours
         << ", " << s.gpa << ")" << endl;
    // the following subjects the data members of the s
    // object to the member function addCourse()
    cout << "Adding 3 hours with a grade of 4.0" << endl;
    s.addCourse(3, 4.0); // call the member function

    // the values are now changed
    cout << "After: s = (" << s.semesterHours
         << ", " << s.gpa << ")" << endl;

    // wait until user is ready before terminating program
    // to allow the user to see program results
    cout << "Press Enter to continue...." << endl;
    cin.ignore(10,'\n');
    cin.get();
    return 0;
}

Code
||=== Build: Debug in CallMemberFunction (compiler: GNU GCC Compiler) ===|
||error: ld returned 1 exit status|
||=== Build failed: 1 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|

I started this on a windows 11 home laptop and then tried to compile it on a windows 11 pro computer and ran into this problem. I added these two compiler flags to the IDE -static-libgcc -static-libstdc++ and still getting this error, any help greatly appreciated.
27
Using Code::Blocks / Re: I can't run a command only build target
« Last post by ollydbg on September 16, 2023, 03:35:33 pm »
Then, should the Run button be disabled always for Command only targets?

I think for a command only targets, when I build this target, it just run some commands.
What is the result of the running commands, maybe it generate an exe file? In this case, "Run" button is needed.

In-fact, I have other minor issues about the "command only targets", I see that the "Search directories" in the Build option is disabled. Which means if I have a to add some code in my command to add a directory to the PATH variable when I "Build" the target. I'm not sure you understand this, I mean in normal Console or GUI targets, the "Linker's search directories" is automatically added to the PATH when I "Build" or "Run" the targets. But currently I can't edit that field.

This is a example cmd(named AAA.cmd), the contents are like below:

Code
@echo off
set "current_path=%~dp0"
set "new_path1=%current_path%lib"
set PATH=%new_path1%;%PATH%
start "" /wait "C:\Program Files (x86)\AAAAA\ABC.exe"

Then I have put the below code in the "pre or post build steps" in the command only target's build options.

Code
cmd /c AAA.cmd
28
Using Code::Blocks / Re: I can't run a command only build target
« Last post by Miguel Gimenez on September 16, 2023, 12:55:41 pm »
Then, should the Run button be disabled always for Command only targets?
29
Using Code::Blocks / Re: I can't run a command only build target
« Last post by ollydbg on September 16, 2023, 12:43:38 pm »
The commits in that ticket are related to the Run button enabled state, not to execution. See my reply in the ticket.

Oh, sorry, I think I have made a mistake.

For a commands only target, it can be "build", I mean The commands I wrote in the "pre-build" and "post-build" option, which can be run if I click the "Build" button.

But this kinds of targets can NOT be executed, so the "Run button" get disabled.

That's a normal behavior, and I have made a mistake, I should click the build button, not the run button. Sorry about the noise.
30
Using Code::Blocks / Re: I can't run a command only build target
« Last post by Miguel Gimenez on September 16, 2023, 11:48:14 am »
The commits in that ticket are related to the Run button enabled state, not to execution. See my reply in the ticket.
Pages: 1 2 [3] 4 5 6 7 8 ... 10