News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

how to design the template

Started by realmeat, May 16, 2006, 10:44:10 AM

Previous topic - Next topic

realmeat

I want to design a template for work

Have any document ?

thx a lot.


Michael

Hello,

Did you try to search in the forum?

I am quite sure that you will find your answer after a small search :).

Best wishes,
Michael
[url="http://img207.imageshack.us/img207/9728/411948picture4em.png"]http://img207.imageshack.us/img207/9728/411948picture4em.png[/url]

realmeat

#2
This is FLTK template file code

Xml
------------------------------------------------
<?xml version="1.0"?>
<!DOCTYPE CodeBlocks_template_file>
<CodeBlocks_template_file>
      <Template name="FLTK" title="FLTK Application" category="GUI" bitmap="fltk.png">
      <Notice value="This template expects FLTK to be located at C:\fltk-1.1.6.
                  If this is not the case, you will have to update the relevant
                  custom variable accordingly.

                  To do this, click on &quot;Project->Build options->Custom variables&quot;"
            isWarning="1"/>
      <FileSet name="s" title="Default">
         <File source="fltk-main.cpp" destination="main.cpp"/>
      </FileSet>
      <Option name="FLTK Application">
         <Project file="fltk.cbp"/>
      </Option>
   </Template>
</CodeBlocks_template_file>
-------------------------------------------------------------------------
In this template, i know how to do FileSet and Project Name
but how about the project linking to lib?
If I have a special lib,how shall I do?
Otherwise, I must set the linking before using the template

realmeat

#3
I find out the point.
In *.cbp

<Linker>
  <Add library = "lib path"/>
</Linker>

but, I have more one question.

have any variables which define the path of codeblocks dir ?
Just like $(FLTK_DIR) ,$(#WX.lib) defined some path.


sethjackson


realmeat

#5
thank you very much!! :D

but I have some problem in using the variable.

If I want to set the directory by using $(CODEBLOCKS )to C:\program files\CODEBLOCKS\personal_include,

(my code::blocks program dirctory is C:\program files\CODEBLOCKS)

I set the follow :(Build Options->Directorys->compiler)

    $(CODEBLOCKS)\personal_include

after the building , the compiler tell me it can't find directory / file.

   $(CODEBLOCKS)  ==  "C:\program files\CODEBLOCKS"   ??

I'm confused... :?

--
By the way,

(Build Options->Custom variables)
I set the Variable $(CODE) = "c:\program files\CODEBLOCKS"

and change the path to the follow:
$(CODE)\personal_include

No error.

realmeat

I solve this problem.

Maybe that's a bug.

$(CODEBLOCKS)  == "c:\program files\codeblocks";

but in compiling, $(CODEBLOCKS) becomes "c:\program" and "file\codeblocks",two variables.

so, it search "c:\program" and "files\codeblocks\personal_include\"

It's so ridiculous.....

But I use other way to slove this.

in the custom variable

<Environment>
    <Variable name="PATH" value='&quot;$(CODEBLOCKS)&quot;' />
</Environment>

and... 
   $(PATH)\personal_include

use another variable replace the default.

Maybe that's all fault because of WIN system.

thomas

This is a bug that has been fixed many months ago, so you must be using quite an old version (probably RC2).
If you were using a more recent version, you would want to use the $(#cb.include) global user variable for that purpose, too. That will do the same thing, but won't require you to set the path again and again with every project.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."