News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

(pictures) how codeblock find executabl file maked by custom Makefile to debug

Started by fei123, June 07, 2010, 05:48:28 PM

Previous topic - Next topic

fei123

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.






Jenna

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.

fei123

Quote from: jens 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.

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

fei123


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.

Quote from: fei123 on June 07, 2010, 06:13:54 PM
Quote from: jens 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.

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