How to config cmake for strip file

Cleanest possible way is to modify CFLAGS or CXXFLAGS (depending on C or C++ code) set(CMAKE_C_FLAGS_RELEASE “${CMAKE_C_FLAGS_RELEASE} -s”) set(CMAKE_CXX_FLAGS_RELEASE “${CMAKE_CXX_FLAGS_RELEASE} -s”) But there is one more hack if you do not want to change your build system (figuring out exact place where to put above lines might be tricky). You may just use strip as … Read more

Javac is not found

As far as I can see you have the JRE in your PATH, but not the JDK. From a command prompt try this: set PATH=%PATH%;C:\Program Files (x86)\Java\jdk1.7.0_17\bin Then try javac again – if this works you’ll need to permanently modify your environment variables to have PATH include the JDK too.

Function pointers in C – nature and usage

Why should anyone compare function pointers? Here’s one example: #include <stdbool.h> /* * Register a function to be executed on event. A function may only be registered once. * Input: * arg – function pointer * Returns: * true on successful registration, false if the function is already registered. */ bool register_function_for_event(void (*arg)(void)); /* * … Read more

Maven compile mixed Java + Groovy 1.7 project, using gmaven-plugin

I had the same problem. I was missing the providerSelection configuration setting for 1.7. Try this configuration and it should work for you. <plugin> <groupId>org.codehaus.gmaven</groupId> <artifactId>gmaven-plugin</artifactId> <version>1.2</version> <configuration> <providerSelection>1.7</providerSelection> </configuration> <dependencies> <dependency> <groupId>org.codehaus.gmaven.runtime</groupId> <artifactId>gmaven-runtime-1.7</artifactId> <version>1.2</version> <exclusions> <exclusion> <groupId>org.codehaus.groovy</groupId> <artifactId>groovy-all</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.codehaus.groovy</groupId> <artifactId>groovy-all</artifactId> <version>1.7.0</version> </dependency> </dependencies> <executions> <execution> <goals> <goal>generateStubs</goal> <goal>compile</goal> <goal>generateTestStubs</goal> <goal>testCompile</goal> … Read more

How do I invoke the MinGW cross-compiler on Linux?

If you look at the file lists on the Ubuntu package webserver for mingw-w64‘s constituent packages: gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 binutils-mingw-w64-x86-64 mingw-w64-x86-64-dev gcc-mingw-w64-i686 g++-mingw-w64-i686 binutils-mingw-w64-i686 mingw-w64-i686-dev You can see that mingw-w64 provides a toolchain, i.e. a set of alternative tools (compiler, linker, headers, etc.) used to compile your code for another system. Assuming you want to compile … Read more

How to compile Ruby?

The simple answer is that you can’t, at least with MRI 1.8 (the standard). This is because 1.8 works by walking the Abstract Syntax Tree. Python, Ruby 1.9, JRuby, and Rubinius use byte code, which allows compilation to an Intermediate Representation (byte code). From MRI Ruby 2.3 it has become easy to do this, see … Read more

cmake: compilation statistics per transation unit

Following properties could be used to time compiler and linker invocations: RULE_LAUNCH_COMPILE RULE_LAUNCH_CUSTOM RULE_LAUNCH_LINK Those properties could be set globally, per directory and per target. That way you can only have a subset of your targets (say tests) to be impacted by this property. Also you can have different “launchers” for each target that also … Read more

Can I somehow “compile” a python script to work on PC without Python installed?

Here is one way to do it (for Windows, using py2exe). First, install the py2exe on your Windows box. Then create a python script named compile.py, like this: import sys from distutils.core import setup import py2exe entry_point = sys.argv[1] sys.argv.pop() sys.argv.append(‘py2exe’) sys.argv.append(‘-q’) opts = { ‘py2exe’: { ‘compressed’: 1, ‘optimize’: 2, ‘bundle_files’: 1 } } … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)