CSSTidy is driving me crazy! - django

I am on OS X + Python 2.6 + django 1.1.
I have tried all possible solution available on the net i.e.
http://thingsilearned.com/2009/01/02/installing-csstidy-and-scons-on-os-x-or-linux/
tried with python 2.5, 2.4 apple-python.. I just can't go past this error after installing scons
$ /usr/local/bin/scons
scons: *** No SConstruct file found.
File "/Library/Python/2.5/site-packages/SCons/Script/Main.py", line 829, in _main
I need csstidy for django-compress (yes I can turn that function off but why?) I mean the maintainer must see some value to have it in default and he knows better.
Unfortunately there is no port for csstidy...

Don't know if you managed to give up or not, or if you solved it.
For anybody who is still having trouble building CSSTidy, here was my solution. If you follow the tutorial in the URL linked above, there is one horrible error in it that I didn't realize until about an hour later.
$ wget http://downloads.sourceforge.net/csstidy/csstidy-source-1.4.zip?modtime=1184828155&big_mirror=0
$ unzip csstidy-source-1.4.zip
$ cd csstidy <<-- THIS IS WRONG. SConstruct isn't here. D:
$ scons
$ sudo cp release/csstidy/csstidy /usr/local/bin/
The errors the author ran into had nothing to do with the --standard-lib flag. When you unzip, the files don't get put into a subdirectory like tar usually does. So the SConstruct file that's magically missing is actually in the directory above csstidy, wherever you ran unzip in the first place.
Once I found that out, I saw the SConstruct file and was able to build it by running scons.

If you just want to build csstidy and don't care about incremental builds, just do this:
g++ *.cpp -o csstidy

Related

Vim, Help getting YCM working for c++

I am trying to install YouCompleteMe Plugin for VIM. This what I did so far:
I am using Vundle so I added the Plugin to my .vimc
I executed install.py --clang-completer
I added "let g:ycm_global_ycm_extra_conf = '.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py" to my vimrc
I tried testing it on very simple helloworld program however I am not getting any useful suggestions. For instance, when I type 'std::' I dont get any intelisense.
I confirmed that YCM server is running and there are no errors in the logs.
Interestingly when I execute 'ValueError: Still no compile flags, no completions yet.'
You have to provide a compilation database (easier) or provide compile flags manually.
If you are not using CMake chanches are that you will like Bear.
With bear just clean your project, cd to the build directory and use it to generate the compile_commands.json file. E.g.
$ cd /path/to/your/project/build/directory
$ bear make
$ cp compile_commands.json /path/to/your/project/source/directory

Building PostgreSQL driver for Qt

I trying to build psql driver but have some unexpected messages.
maxim#maxim-VirtualBox:~/Downloads/distrib/qt-everywhere-opensource-src-5.2.1/qtbase/src/plugins/sqldrivers/psql$ qmake psql.pro
Cannot read
/home/maxim/Downloads/qt-everywhere-opensource-src-5.2.1/qtbase/mkspecs/modules-inst/qt_lib_bootstrap_private.pri:
No such file or directory
...
Cannot read
/home/maxim/Downloads/qt-everywhere-opensource-src-5.2.1/qtbase/mkspecs/modules-inst/qt_lib_xml_private.pri:
No such file or directory
But all of these files exist. What is the problem?
The problem seems to be that you have "modules-inst" as the subfolder name, whereas it is only "modules" without the "-inst" suffix in reality.
See how it works fine on my end:
lpapp ~/Downloads/qt-everywhere-opensource-src-5.2.1/qtbase/src/plugins/sqldrivers/psql $ qmake psql.pro
lpapp ~/Downloads/qt-everywhere-opensource-src-5.2.1/qtbase/src/plugins/sqldrivers/psql $
I found a problem. After install qt-libraries I created new folder 'distrib' and move sources in there. That's why I got this problem.
I should have checked the existence of the directory by cd command.

Compiling SDL within Adobe Crossbridge's Cygwin

Crossbridge allows you to compile C/C++ programs to target the flash runtime. It comes with its own modified gcc within cygwin. Since SDL only provides developmental zips for VC or mingw, I'm trying to compile SDL within this cygwin environment. However Crossbridge's gcc is version 4.2.1 and according to google searches SDL cannot be compiled with gcc versions higher than 3 inside cygwin. When I run ./configure, it fails with:
*** Your compiler (/cygdrive/c/Users/Tom/Desktop/Crossbridge_1.0.1/sdk/usr/bin/g
cc.exe -jvmopt=-Xmx1G) does not produce Win32 executables!
When I just type gcc alone, I get:
bash: /usr/bin/gcc: cannot execute binary file
Does it make a difference if I compile SDL using one compiler (i.e., a lower version of gcc) and attempt to use it with the Crossbridge compiler?
Is there a workaround for this?
I checked the Crossbridge_1.0.1.zip, cc and gcc maybe are broken link (only 56 bytes?) but the gcc-4 seem to be good.
edit
type gcc-4 as you typed gcc from the bash and you'll see the usual expected no input files gcc's error message, try gcc-4 -v
the message Your compiler does not produce Win32 executables is given by the fact that whatever you've executed (or has been executed automatically) is using /cygdrive/c/Users/Tom/Desktop/Crossbridge_1.0.1/sdk/usr/bin/gcc.exe as your compiler, but as you already checked it doesn't work, and if you check it with ls -l /usr/bin/gcc.exe you'll see that this is only 56 bytes size, this can't be the real compiler, I guess it probably was a symbolic link to the real compiler, which for some reason isn't working as expected (on linux executing a symlink is as executing the real binary).
I'm not an expert of cygwin, but I guess at some level symlink are supported, reading this FAQ make me wonder if some attribute hasn't lost packaging/unpackaging the zip, so that the symlink aren't recognized.
Try to recreate it (it worked for me):
cd /usr/bin # change directory
rm gcc.exe # remove the broken link
ln -s gcc-4.exe gcc.exe # re-create the symlink
run gcc again, should return the no input files error as expected.
But this isn't the solution, because probably in the unzipped files there are many broken symlink.
I can't believe Adobe is distributing a broken SDK, so perhaps there's some instruction somewhere about how to properly unzip the SDK preserving the symlinks (maybe unzip have a preserve attribute option? I don't know much about zip sorry.
edit
execute the run.bat (the bash) and cd to the main directory where you unzipped the SDK (mine is /cygdrive/c/crossbrige)
cd /cygdrive/c/crossbrige
for f in $(find ./ -type f -print0 | xargs -0 grep '!<symlink>' -l); do attrib +S $f; done
this should hopefully fix all the broken symlink, the only side-effect is that any file containing !<symlink> will get set the attribute DOS SYSTEM, but cygwin check both this magic string at offset 0 and the S attribute to consider a file as a symlink, so hopefully will not break anything.
I used Alex find/ attribute loop to fix all broken links in my cygwin install. I have no idea why they appeared.
The first attempt failed with messages like:
Invalid switch - /usr/lib/terminfo
for each file attrib worked on.
Turned out that for my cygwin/Windows combo I had to cd into the directory and execute attrib from there. So the loop content was:
do cd $(dirname $f); attrib +S $(basename $f); done

Building log4cxx with APR

I need to build the log4cxx library on a SuSE linux system where I am not root. The package manager, zypper, apparently does not know about log4cxx.
I download log4cxx and try to build with autotools
./configure
checking for APR... no
configure: error: APR could not be located. Please use the --with-apr option.
I then search for libapr:
find / -name libapr*
/usr/share/doc/packages/libapr-util1
/usr/share/doc/packages/libapr1
/usr/lib64/libaprutil-1.so.0.3.12
/usr/lib64/libapr-1.so.0.4.5
/usr/lib64/libaprutil-1.so.0
/usr/lib64/libapr-1.so.0
So I try
./configure --with-apr=/usr/lib64/libapr-1.so.0
configure: error: the --with-apr parameter is incorrect. It must specify an install prefix, a build directory, or an apr-config file.
The same for --with-apr=/usr/lib64/libapr-1.so.0.4.5 and --with-apr=/usr/lib64/.
Which file does ./configure look for? What does --with-apr expect? Is one of the two *.so.* files the needed library?
You'll probably want to install libapr1-devel so that you can compile against it. Then try re-running ./configure.
I ran into the same issue, I think you're using the source code off of appache's site which I beleive is outdated. This issue has been fixed in the SVN trunk several years ago (lolol, I guess right around the time this question was asked).
Just pull the svn trunk's source and compile it:
svn checkout http://svn.apache.org/repos/asf/incubator/log4cxx/trunk apache-log4cxx
./autogen.sh
./configure
make
make check
sudo make install
On software.opensuse.org someone has packages built for recent versions of openSUSE as well as SLE at liblog4cxx10. Maybe that'll work for you instead of building your own.
MichaelGoren is right.
There is multiple ".h" file missing.
So you have to add them before launching make.
sed -i '1i#include <string.h>\n' src/main/cpp/inputstreamreader.cpp
sed -i '1i#include <string.h>\n' src/main/cpp/socketoutputstream.cpp
sed -i '1i#include <string.h>\n' src/examples/cpp/console.cpp
sed -i '1i#include <stdio.h>\n' src/examples/cpp/console.cpp
I bumped into the same problem on 3.3.4-5.fc17.x86_64 and resolved it by including the appropriate H files to the CPP files reported by the make utility.
In my case I should run the make utility 3 times each time getting a new error and fixing it by adding the appropriate include H to the reported CPP file.
The main idea is as following:
1) Check by running the man utility, where the function mentioned in the error defined.
For example, man memmove says that it is defined in the string.h header file.
2) Add the appropriate include file to the CPP file.
For example, the make utility complains that inputstreamreader.cpp does not find the memmove function. Open the inputstreamreader.cpp file and add string.h to its header files.
3) Run the make utility until the log4cxx is compiled without errors.

Can't get cygwin to compile C++ Boost libraries

I'm trying to get up and running with Boost, so I'm trying to compile the simple example problem from Boost's "Getting Started" page. I've had two issues, and I'm not sure they're related (I'm better than a novice, but not by much) but maybe they're related...
1st issue: the "tar --bzip2 -xf /path/to/boost_1_49_0.tar.bz2" command didn't work (yes, I put the correct path in, but it gave me some errors, I forget what they were) so I used "tar -xjvf " from the directory where boost_1_49_0.tar.bz2 was located. That de-compressed the zip file and I proceeded with the example...
2nd issue: The example.cpp file will not compile, the first statement in the code is #include "boost/lambda/lambda.hpp" but then for every header file lambda.hpp is trying access, there's a "No such file or directory" compile error. For example, here are two (of the six, and I get errors for all 6) header files within lambda.hpp and the errors displayed by the cygwin compiler:
boost/lambda/lambda.hpp:14:33: boost/lambda/core.hpp: No such file or directory
boost/lambda/lambda.hpp:21:52: boost/lambda/detail/operator_actions.hpp: No such file or directory
If it helps, this is the command I'm running to compile (I generally create the executable in a separate -o command):
g++ -c example.cpp
Why can't the system find these? I added the installed directory (path/to/boost_1_49_0) to the PATH variable before I started so I know that's no it. Thanks for any advice...
(I've looked on stackoverflow and there were similar issues, but no solutions that worked)
It looks like you've already solved the first issue: namely, that you must specify the -j flag on tar to untar a bzip2'd file.
For the second issue, you need to specify boost on your include path, either by specifying it with the -I command line option or via the CPLUS_INCLUDE_PATH environment variable.