|
Compiling
How to compile the preprocessed version of flex-htmlfilter
What is essentially the second version of flex-htmlfilter uses a project called flex2cpp to provide preprocessing on the code. Whilst I haven't used it much, it is in there and it would be a pain to create a version without it. Fortunately it can be compiled on both windows and linux. In most distributions of linux, the required software should be installed and all you have to do is cd to the directory where you have flex-htmlfilter and run "make" In Windows however, you first have to put in some effort. Fortunately most of the effort has been taken care of by the author of flex2cpp with an installation script that he has created. Compiling under Windows¶1. download this : http://sourceforge.net/project/downloading.php?group_id=193742&filename=installer103.zip&a=27834447 2. unzip that anywhere you like. for the purposes of these instructions, I'll assume you unzipped it into C:/installer. You can replace C:/installer with whatever directory you chose 3. open windows cmd prompt (start menu -> run box -> type "cmd" and press enter) and cd into the directory where you unzipped the installer
4. type "download.bat", press enter and wait 5. type "install.bat C:/MinGW", press enter and wait
6. right click on "My Computer" -> properties -> advanced tab -> "Environment Variables" at the bottom -> "System Variables" pane -> choose the "Path" variable and click edit 7. Append to the list "C:/MinGw/bin" (items are seperated with a semi-colon ";"), then click ok 8. edit the PATHEXT variable (should be below "Path") and add ".exe" to the end of it 9. keep pressing ok until all the dialog boxes are gone 10. open up a new cmd prompt, cd to where you have flex-htmlfilter and type "make" and it should magically work :) |
Appreciate the effort and many thanks for it.Just wondering if a straight forward swc component be made available so that people can download the same and start using it in their projects.
I have following error while compiling sources: process_begin: CreateProcess?(NULL, gcc -o filters\cppfilter.exe filters\cppfilter.c, ...) failed.
Please help or if it is possible just share with compiled swc.
Thanks
@chetan : I'll have a look at how to create a swc at some time in the future. Unfortunately I don't have much time on my hands and it may not happen for a long time, sorry.
@chimel : hmmm, I"m not sure. I'd have to see all output to even begin to guess :p
Hi I have the following error:
Microsoft Windows 6.0.6002? Copyright (c) 2006 Microsoft Corporation. All rights reserved.
C:\Users\mpereira>d:
D:\>cd temp/htmlfilter
D:\temp\htmlfilter>make make -r -R -f cpp2mxmlc.mak \ true' \ make1?: Entrando no diretório `D:/temp/htmlfilter' make1?: Dependência circular as <- base/index.swf abandonada. base\index.mxml base\index.swf base\assets\content\tester.txt base\assets\css\html.css base\assets\css\styles.css base\assets\images\background.gif base\com\htmlFilter\box.as base\com\htmlFilter\debug.as base\com\htmlFilter\htmlFilter.as base\com\htmlFilter\htmlList.as base\com\htmlFilter\htmlTable.as base\com\htmlFilter\htmlText.as base\com\htmlFilter\objectWrapper.as base\com\htmlFilter\special.mxml base\com\htmlFilter\Supported Tags and Attributes base\com\htmlFilter\tagsAndOptions.as base\com\htmlFilter\text.as base\com\htmlFilter\special\sp.mxml base\com\interactiveAlchemy\utils\Debug.as base\include\misc.h base\qs\caching\ContentCache?.as base\qs\controls\SuperImage?.as base\qs\utils\DLinkedList.as base\qs\utils\DLinkedListNode.as 24 File(s) copied gcc -o filters\cppfilter.exe filters\cppfilter.c process_begin: CreateProcess?(NULL, gcc -o filters\cppfilter.exe filters\cppfilte r.c, ...) failed. make (e=2): The system cannot find the file specified. make1?: filters\cppfilter.exe? Erro 2 make1?: Saindo do diretório `D:/temp/htmlfilter' make: release? Erro 2
D:\temp\htmlfilter>
how can I put this o work? thanks
After a quick search on google for """process_begin: CreateProcess?(NULL, "" , ...) failed.""" I found this http://tinyurl.com/ybggbsq which says it's a known problem with version 3.81, which it seems is what is installed by the installer I link to above.
Fortunately that link also has a solution with a comment by someone who says that solution works. Unfortunately I'm not sure how to apply patches in windows (I'm a linux user) but I'm sure if you search on google, you'll find a method.
You can find the source for make on windows here http://sourceforge.net/projects/gnuwin32/files/make/3.81
....
:D
to chmiel.slawek:
process_begin: CreateProcess??(NULL, gcc -o filters\cppfilter.exe filters\cppfilter.c, ...) failed.
because it can't find gcc.exe. There are something wrong with install MinGW command. so you need to unzip all files in install\download\ to \MinGW\ folder after step 5. and then it will works.
logs: H:\workspace\03_Flex\06_HtmlFilter?>make make -r -R -f cpp2mxmlc.mak \
true' \ make1?: Entering directory `H:/workspace/03_Flex/06_HtmlFilter?' base\index.mxml base\assets\content\tester.txt base\assets\css\html.css base\assets\css\styles.css base\assets\images\background.gif base\com\htmlFilter\box.as base\com\htmlFilter\debug.as base\com\htmlFilter\htmlFilter.as base\com\htmlFilter\htmlList.as base\com\htmlFilter\htmlTable.as base\com\htmlFilter\htmlText.as base\com\htmlFilter\objectWrapper.as base\com\htmlFilter\special.mxml base\com\htmlFilter\Supported Tags and Attributes base\com\htmlFilter\tagsAndOptions.as base\com\htmlFilter\text.as base\com\htmlFilter\special\sp.mxml base\com\interactiveAlchemy\utils\Debug.as base\include\misc.h base\qs\caching\ContentCache?.as base\qs\controls\SuperImage?.as base\qs\utils\DLinkedList.as base\qs\utils\DLinkedListNode.as 23 File(s) copied cpp -nostdinc -C -x c -I base/include -DNDEBUG base/com/htmlFilter/box.as | f ilters\cppfilter.exe -gcc > as/com/htmlFilter/box.as cpp -nostdinc -C -x c -I base/include -DNDEBUG base/com/htmlFilter/debug.as | cpp -nostdinc -C -x c -I base/include -DNDEBUG base/com/htmlFilter/htmlFilter .as | filters\cppfilter.exe -gcc > as/com/htmlFilter/htmlFilter.as cpp -nostdinc -C -x c -I base/include -DNDEBUG base/com/htmlFilter/htmlList.a s | filters\cppfilter.exe -gcc > as/com/htmlFilter/htmlList.as cpp -nostdinc -C -x c -I base/include -DNDEBUG base/com/htmlFilter/htmlTable. as | filters\cppfilter.exe -gcc > as/com/htmlFilter/htmlTable.as cpp -nostdinc -C -x c -I base/include -DNDEBUG base/com/htmlFilter/htmlText.a s | filters\cppfilter.exe -gcc > as/com/htmlFilter/htmlText.as cpp -nostdinc -C -x c -I base/include -DNDEBUG base/com/htmlFilter/objectWrap per.as | filters\cppfilter.exe -gcc > as/com/htmlFilter/objectWrapper.as cpp -nostdinc -C -x c -I base/include -DNDEBUG base/com/htmlFilter/tagsAndOpt ions.as | filters\cppfilter.exe -gcc > as/com/htmlFilter/tagsAndOptions.as cpp -nostdinc -C -x c -I base/include -DNDEBUG base/com/htmlFilter/text.as | filters\cppfilter.exe -gcc > as/com/htmlFilter/text.as cpp -nostdinc -C -x c -I base/include -DNDEBUG base/com/interactiveAlchemy/ut ils/Debug.as | filters\cppfilter.exe -gcc > as/com/interactiveAlchemy/utils/Debu g.as cpp -nostdinc -C -x c -I base/include -DNDEBUG base/qs/utils/DLinkedList.as | base/qs/utils/DLinkedList.as:113:2: warning: no newline at end of file cpp -nostdinc -C -x c -I base/include -DNDEBUG base/qs/utils/DLinkedListNode. as | filters\cppfilter.exe -gcc > as/qs/utils/DLinkedListNode.as base/qs/utils/DLinkedListNode.as:13:2: warning: no newline at end of file cpp -nostdinc -C -x c -I base/include -DNDEBUG base/qs/controls/SuperImage?.as cpp -nostdinc -C -x c -I base/include -DNDEBUG base/qs/caching/ContentCache?.a s | filters\cppfilter.exe -gcc > as/qs/caching/ContentCache?.as cpp -nostdinc -C -x c -I base/include -DNDEBUG base/index.mxml | filters\cppf ilter.exe -gcc > as/index.mxml cpp -nostdinc -C -x c -I base/include -DNDEBUG base/com/htmlFilter/special.mx ml | filters\cppfilter.exe -gcc > as/com/htmlFilter/special.mxml cpp -nostdinc -C -x c -I base/include -DNDEBUG base/com/htmlFilter/special/sp .mxml | filters\cppfilter.exe -gcc > as/com/htmlFilter/special/sp.mxml Update binaries mxmlc -use-network=false -compiler.debug=false -compiler.optimize=true -o base/ index.swf as/index.mxml >errors 2>&1 sed -e "s/\\/\//g" -e "s/H:\/workspace\/03_Flex\/06_HtmlFilter?\/as/H:\/workspace \/03_Flex\/06_HtmlFilter?\/base/I" errors Loading configuration file D:/04_ProjectSoft?/FlexBuilder3?/sdks/3.2.0/frameworks/ flex-config.xml H:/workspace/03_Flex/06_HtmlFilter?/base/index.swf (238642 bytes) test -f base/index.swf Success! make1?: Leaving directory `H:/workspace/03_Flex/06_HtmlFilter?'No target specified. Defaulted to: make debug Possible targets... make release Build release mode swf - default make debug Build debug mode swf make profile Build profiler mode swf make all Rebuild debug/release make run Build+run the swf make rundebug Build+run the debug swf in fdb make runprofile Build+run profiler mode swf make runhtml Build+run the swf in the browser make clean Wipe out intermediate files make cleaner Invoke clean on subdirectories make zip Archive project with Info-zip make prettyprint=true target? Use GNU indent on preprocessed code
I tried and tried and still can't put this to work! :-(
Now it gives me the following error
Microsoft Windows 6.0.6002? Copyright (c) 2006 Microsoft Corporation. All rights reserved.
C:\Users\mpereira>d:
D:\>cd temp/htmlfilter
D:\temp\htmlfilter>make make -r -R -f cpp2mxmlc.mak \ true' \ make1?: Entrando no diretório `D:/temp/htmlfilter' base\index.mxml base\assets\content\tester.txt base\assets\css\html.css base\assets\css\styles.css base\assets\images\background.gif base\com\htmlFilter\box.as base\com\htmlFilter\debug.as base\com\htmlFilter\htmlFilter.as base\com\htmlFilter\htmlList.as base\com\htmlFilter\htmlTable.as base\com\htmlFilter\htmlText.as base\com\htmlFilter\objectWrapper.as base\com\htmlFilter\special.mxml base\com\htmlFilter\Supported Tags and Attributes base\com\htmlFilter\tagsAndOptions.as base\com\htmlFilter\text.as base\com\htmlFilter\special\sp.mxml base\com\interactiveAlchemy\utils\Debug.as base\include\misc.h base\qs\caching\ContentCache?.as base\qs\controls\SuperImage?.as base\qs\utils\DLinkedList.as base\qs\utils\DLinkedListNode.as 23 File(s) copied cpp -nostdinc -C -x c -I base/include -DNDEBUG base/com/htmlFilter/box.as | f ilters\cppfilter.exe -gcc > as/com/htmlFilter/box.as cpp -nostdinc -C -x c -I base/include -DNDEBUG base/com/htmlFilter/debug.as |
cpp -nostdinc -C -x c -I base/include -DNDEBUG base/com/htmlFilter/htmlFilter .as | filters\cppfilter.exe -gcc > as/com/htmlFilter/htmlFilter.as cpp -nostdinc -C -x c -I base/include -DNDEBUG base/com/htmlFilter/htmlList.a s | filters\cppfilter.exe -gcc > as/com/htmlFilter/htmlList.as cpp -nostdinc -C -x c -I base/include -DNDEBUG base/com/htmlFilter/htmlTable. as | filters\cppfilter.exe -gcc > as/com/htmlFilter/htmlTable.as cpp -nostdinc -C -x c -I base/include -DNDEBUG base/com/htmlFilter/htmlText.a s | filters\cppfilter.exe -gcc > as/com/htmlFilter/htmlText.as cpp -nostdinc -C -x c -I base/include -DNDEBUG base/com/htmlFilter/objectWrap per.as | filters\cppfilter.exe -gcc > as/com/htmlFilter/objectWrapper.as cpp -nostdinc -C -x c -I base/include -DNDEBUG base/com/htmlFilter/tagsAndOpt ions.as | filters\cppfilter.exe -gcc > as/com/htmlFilter/tagsAndOptions.as cpp -nostdinc -C -x c -I base/include -DNDEBUG base/com/htmlFilter/text.as | filters\cppfilter.exe -gcc > as/com/htmlFilter/text.as cpp -nostdinc -C -x c -I base/include -DNDEBUG base/com/interactiveAlchemy/ut ils/Debug.as | filters\cppfilter.exe -gcc > as/com/interactiveAlchemy/utils/Debu g.as cpp -nostdinc -C -x c -I base/include -DNDEBUG base/qs/utils/DLinkedList.as | base/qs/utils/DLinkedList.as:113:2: warning: no newline at end of file cpp -nostdinc -C -x c -I base/include -DNDEBUG base/qs/utils/DLinkedListNode. as | filters\cppfilter.exe -gcc > as/qs/utils/DLinkedListNode.as base/qs/utils/DLinkedListNode.as:13:2: warning: no newline at end of file cpp -nostdinc -C -x c -I base/include -DNDEBUG base/qs/controls/SuperImage?.as cpp -nostdinc -C -x c -I base/include -DNDEBUG base/qs/caching/ContentCache?.a s | filters\cppfilter.exe -gcc > as/qs/caching/ContentCache?.as cpp -nostdinc -C -x c -I base/include -DNDEBUG base/index.mxml | filters\cppf ilter.exe -gcc > as/index.mxml cpp -nostdinc -C -x c -I base/include -DNDEBUG base/com/htmlFilter/special.mx ml | filters\cppfilter.exe -gcc > as/com/htmlFilter/special.mxml cpp -nostdinc -C -x c -I base/include -DNDEBUG base/com/htmlFilter/special/sp .mxml | filters\cppfilter.exe -gcc > as/com/htmlFilter/special/sp.mxml Update binaries mxmlc -use-network=false -compiler.debug=false -compiler.optimize=true -o base/ index.swf as/index.mxml >errors 2>&1 make1?: base/index.swf? Erro 1 make1?: Saindo do diretório `D:/temp/htmlfilter' make: release? Erro 2D:\temp\htmlfilter>
Does anyone know what maybe happening.
I'm using Windows Vista and Flex Builder with SDK 3.5.0
thanks
Will it really take that long to create a SWC file?
Also what is the whole point of compiling? Can we just take the action script libs?
@mauriciocgpereira, sorry I'm not sure
@ jerrygag :
When you create a swc, you don't have to compile it again until you make changes to the code. So it's only a one off thing and you just include the swc when you compile the rest of your code (whether it be by the ide or command line).
As for the point of compiling. I'm using preprocessor directives in my code to reduce repetition. (http://en.wikipedia.org/wiki/Preprocessor). This means the code has to be processed before it's completely valid actionscript.
I see thanks...just that i am having problems compiling...
any problems in particular ? :D
Hi, finally I was able to get this to work, but now there are some issues I'd like to discuss wih you: - is there any problem with <p align="....">, 'cause I wasn't able to get the alignment to work - the alignment doesn't work also with the table tag thanx
regarding the 'align' issue do you know if there is any kind of 'problem' with html 'source formating'? Because if I insert the code like this:
<p><b>1 - XPTO</b></p> <ol type="I">
</ol>the result is not aligned, but if I insert the code all in one line like this
<p><b>1 - XPTO</b></p><ol type="I"><li>...</li><li>...</li><li>...</li></ol>
it displays well!!!
Ahhh, I know what your problem is.
I actually had the problem in a recent project but I never committed the change.
I've committed it just then, so do an svn update and recompile.
Basically, the problem is when it reads in the html it flattens it (removes all the newlines and indentation) however if you use spaces to indent (Which I've started to do for everything recently) then it didn't find them. Now it does.
(please note however that it only looks for 4 spaces as an indentation. If you have a different number then change the "{4}" on line 60 of htmlFilter.as)
:D
GREAT!!!
I also found another possible issue, but I don't know if it is a problem of my 'precompilation'.
It's related to the align in <p> and <table> tag. When I tried your example the align works well, but in my project (with absolutely no modifications to your code) the align is ignored!!!
Is it a problem with the precompiling, OS, browser, flex version? !!!
umm, I doubt it be a problem of any of those....
So you ran my example program with no error. But when you use flex-htmlFilter in your program it indents incorrectly ?
Are you testing with the same or different input ?
when I ran your online demo with a basic code <p align="center">test</p> (for example) it worked fine, but when I ran the version I donwloaded and precompiled in my machine (without any changes), the same basic code didn't work!!! that's why I'm thinking that it may be a problem with 'my machine'
ahhh...
When you say online version do you mean http://stephen-m.appspot.com/htmlFilter or http://stephen-m.appspot.com/htmlFilterNew ??
The first one is the old version found under http://code.google.com/p/flex-htmlfilter/source/browse/branches/old
It seems the old version could but the new version can't. Off the top of my head I can't think why and I've unfortunately run out of time for this morning....
....
:-( When preprocessing I got the following error
Loading configuration file C:\Program Files\Adobe\Flex Builder 3.4\sdks\3.5.0\frameworks\flex-config.xml D:\temp\htmlfilter\as\com\htmlFilter\text.as(3): col: 1 Error: Syntax Error.
#include "misc.h" ^
D:\temp\htmlfilter\as\com\htmlFilter\text.as(3): col: 10 Error: Unable to open the file included: D:\temp\htmlfilter\as\com\htmlFilter\misc.h.
#include "misc.h"
do you imagine what this could be?
I made the changes in the text.as file manually and then I built my flex project.
It gave no errors but the align attribute of the <p> tag is ignored!!
@mauriciocgpereira surely if it complains that it can't find misc.h for text.as, then it complains it can't find it for other files ??
As for the align problem, I can't find what is causing the problem and I have massive time shortage atm because of uni and other stuff. By looking at the difference between the old version of text.as to the new one, the only difference is removing a getter/setter for the stylesheet.
Removing it from the old text.as doesn't break the align attribute (which is good cause in flex 3.5 it no longer lets me do that anyway, which is why it's gone)
This means that I have no idea why it's doing this. Please feel free to play around and experiment with it yourself till you find the problem..
Sorry I can't be more helpful...
the error, yes it's odd, but it happens!!!
the align issue I'll try a few things. I'll tell you if I find something.
I noticed you said the old text.as version?! Is there a new version? The one in the svn is from 2009!
This looks awesome! Can you recommend a particular Flex Rich Text HTML editor to match this with? I'm planning on taking this and creating a robust editor that reads / writes valid xHTML 1.0 Strict.
@chuckfrazier3378 Thankyou :D
As for an editor, I don't know of any, sorry....
:D
Hi Stephen,
Thanks for your contribution! Great project. I am having the same issue that chmiel.slawek mentioned up top. Unfortunately, patching make for Windows seems like it will take me way too long even if I do get it to work.
Could you possibly check in the "as" folder that gets generated when you run make? It is getting generated for me, but a lot of the # directives are still there.
Also, if you are interested in building a SWC, here is how to do it in Flex/Flash Builder: File > New > Flex Library Project Set it up as you do your current project Copy over the source that you want exported (e.g. no sample code) Right-click on the project, Properties, and select Flex Build Path. Make sure that all of your source folders are selected for export. Each time your project compiles error-free, it will drop a SWC in the bin-debug directory rather than a SWF.
Hello Brian,
>> Thanks for your contribution! Great project
Thankyou :D
As for giving out generated code, I don't like to do it, but seeing as Make is broken, http://flex-htmlfilter.googlecode.com/files/generated.zip .
(I also don't want to install eclipse :p)
........