application configuration incorrect

I was trying to get my application which uses OpenMP to work under Windows XP without any service packs, I kept getting the error message “application configuration incorrect”.

To get it work in the end I copied OpenMP related files from my WinXP SP2 computer in the WinSxS folder over to the same folders on the older computer

C:\Windows\WinSxS\Policies\x86*OpenMP*\ (folder)
C:\Windows\WinSxS\Manifests\*OpenMP* (files)
C:\Windows\WinSxS\x86*OpenMP* (folder)

This could have easily avoided if I could install Vcredist.exe however it complained it couldn’t run certain DLLs

Advertisements

Command line copy & paste

I needed a way to copy a lot of text through a shell and couldn’t find an easy way to do it through the command line:
Now I can copy & paste like so:
cat 1.txt | copy

and on another shell:
paste | grep “test”

N.b. the copy program has to remain running to be able to paste text, I believe this is common to all Linux applications which provide clipboard functionality. As far as I am aware there is no specific memory set aside for a clipboard, so it is down to individual programs to provide this memory.

Compile the Copy.c file with:

gcc -I/usr/lib:. -lpthread -lgthread-2.0 -g -Wall Copy.c -o copy `pkg-config –cflags gtk+-2.0 gthread-2.0` `pkg-config –libs gtk+-2.0 gthread-2.0

Copy.c:

#include <gtk/gtk.h>
#include <gdk/gdk.h>
#include <glib.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>


int main( int   argc,  char *argv[] )
{
        GtkWidget *window;
        gtk_init (&argc, &argv);
        window = gtk_window_new (GTK_WINDOW_TOPLEVEL);

        GString* gstr = g_string_new (NULL);
        GtkClipboard* clip = gtk_clipboard_get(NULL);

        int c;
        while((c = fgetc(stdin)) != EOF){
                printf("%c",c);
                g_string_append_printf (gstr,"%c",c);
        }

        gtk_clipboard_set_text(clip,g_string_free(gstr,FALSE),-1);
        gtk_main (); // infinite loop
        return 0;
}

Paste.c

#include <gtk/gtk.h>
#include <gdk/gdk.h>
#include <glib.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>


int main( int   argc,  char *argv[] )
{
        GtkWidget *window;
        gtk_init (&argc, &argv);
        window = gtk_window_new (GTK_WINDOW_TOPLEVEL);

        GString* gstr = g_string_new (NULL);
        GtkClipboard* clip = gtk_clipboard_get(NULL);
        printf("%s",gtk_clipboard_wait_for_text(clip));

        return 0;
}