Author Topic: (pictures) how codeblock find executabl file maked by custom Makefile to debug  (Read 9329 times)

Offline fei123

  • Single posting newcomer
  • *
  • Posts: 6
i use codeblocks in linux.

i have a program with source code.i  make it's own "Makefile"  in the program folder .then it will
get 5 executable files ,include "disksim" executable file.
i can debug the source code in the gdb ,use the command in the terminal of linux
"gdb --args ./disksim synthraid5.parv synthraid5.out ascii 0 1 " ,so the file "synthraid5.parv " can be add into the
the executable file "disksim" as a parameter.and raid5.out is the output filename.

now i want to use codeblocks to debug the program..
but i donot success.
here is my steps:
1.I make a project in codeblocks in /home/codeblocksproject1,the codeblocks project file  
codeblocksproject1cbp is in the folder .



2. then i copy the all the files of program include it's own Makefile into the folder of
codeblocksproject1 project. so the codeblocks can find the custom Makefile



3.then i add the files recursively into the project.



4.the i   Check "This is a custom makefile", change the build target   .and finally build sucess.




4. get 5 executable files ,include "disksim"


5.  after i input the parameter " synthraid5.parv synthraid5.out ascii 0 1 " in the "Project->Set programs' arguments" ,and choose
"disksim"executable file as "host application"
but i cannot run sucessly.



what is the problem?
i think maybe the codeblock can not find the executable file.
what can i do.
 please   as specific as possible and step by step..
thank you for your help .
 I'd appreciate it if you could help.





« Last Edit: June 07, 2010, 06:01:17 pm by fei123 »

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: (pictures) how to debug program with custom Makefile
« Reply #1 on: June 07, 2010, 05:57:43 pm »
Go to "Project -> Properties -> Build targets -> all" (in your case) and change the defaoult output filename to the one that is created by the build.
C::B does not parse the makefile and does not know what it does, so it can not find the exe itself.

Offline fei123

  • Single posting newcomer
  • *
  • Posts: 6
Re: (pictures) how to debug program with custom Makefile
« Reply #2 on: June 07, 2010, 06:13:54 pm »
Go to "Project -> Properties -> Build targets -> all" (in your case) and change the defaoult output filename to the one that is created by the build.
C::B does not parse the makefile and does not know what it does, so it can not find the exe itself.

thank u for your help ..
I change the defaoult output filename to the one that is created by the build(disksim executable file in the directory of  codeblockproject1/src/  )
there are another questions.





the path is wrong..disksim_main.c is in codeblockproject1/src/disksim_main.c
« Last Edit: June 07, 2010, 06:29:47 pm by fei123 »

Offline fei123

  • Single posting newcomer
  • *
  • Posts: 6
Re: (pictures) how to debug program with custom Makefile
« Reply #3 on: June 07, 2010, 06:59:33 pm »

i find the method .
it need to change the execution working dir as the same directory of the executable file that is created by the the Makefile.

Go to "Project -> Properties -> Build targets -> all" (in your case) and change the defaoult output filename to the one that is created by the build.
C::B does not parse the makefile and does not know what it does, so it can not find the exe itself.

thank u for your help ..
I change the defaoult output filename to the one that is created by the build(disksim executable file in the directory of  codeblockproject1/src/  )
there are another questions.





the path is wrong..disksim_main.c is in codeblockproject1/src/disksim_main.c