Code::Blocks Forums
User forums => Using Code::Blocks => Topic started by: realmeat on May 16, 2006, 10:44:10 am
-
I want to design a template for work
Have any document ?
thx a lot.
-
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
-
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 "Project->Build options->Custom variables""
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
-
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.
-
Yes.
http://wiki.codeblocks.org/index.php?title=Builtin_variables
$(CODEBLOCKS) $(APP_PATH) $(APPPATH) $(APP-PATH)
-
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.
-
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='"$(CODEBLOCKS)"' />
</Environment>
and...
$(PATH)\personal_include
use another variable replace the default.
Maybe that's all fault because of WIN system.
-
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.