Category Archives: Operation Systems

Octave 3.6 kompilieren auf Ubuntu

$ sudo apt-get install libqhull-dev libpcre++-dev libblas-dev liblapack-dev libreadline-dev
$ sudo apt-get install libcurl4-openssl-dev libfltk1.3-dev libgraphicsmagick++-dev libhdf5-serial-dev libqrupdate-dev libsuitesparse-metis-dev
$ sudo apt-get install g++ gfortran gperf flex bison libfontconfig1-dev glpk

$ ./configure --prefix=/home/bachi/octave36

   ./run-octave    - to run in place to test before installing
   make check      - to run the tests
   make install    - to install (PREFIX=/home/bachi/octave36)

Quelle: Compiling octave 3.6.1 on Debian Testing

Rekursives make mit getrenntem Object-Verzeichnis

TOPLEVEL = .
SUBDIRS = \
    obj

all : all_sub Aufgabe9

include $(TOPLEVEL)/Makefile.inc

STATIC_LIBRARY = obj/lib.a \
                 obj/planet/lib.a

Aufgabe9 : $(STATIC_LIBRARY)
	$(CC) -o $@ obj/main.o $(STATIC_LIBRARY) $(LDFLAGS)
CC       = g++
AR       = ar
CFLAGS   = `sdl-config --cflags` -I/usr/glew/include -I$(TOPLEVEL)/include -D_REENTRANT -Wall -std=gnu++0x
LDFLAGS  = `sdl-config --libs` -L/usr/glew/lib -lopengl32 -lglu32 -lglew32 -lSDL_ttf
OBJECT   = $(SOURCES:%.cxx=%.o)

# CFLAGS  = -IC:\MinGW\msys\1.0\libsdl\include\SDL -D_GNU_SOURCE=1 -Dmain=SDL_main -I$(TOPLEVEL)/include -D_REENTRANT -Wall
# LDFLAGS = -LC:\MinGW\msys\1.0\libsdl\lib -lmingw32 -lSDLmain -lSDL -mwindows -lopengl32 -lglu32 -lSDL_ttf

all_sub:
	if test "$(SUBDIRS)" != ""; then \
		for subdir in $(SUBDIRS); do \
			(cd $$subdir; make all); \
		done; \
	fi;

clean: clean_sub
	rm -f *.o *.a $(CLEANFILES)

clean_sub:
	if test "$(SUBDIRS)" != ""; then \
		for subdir in $(SUBDIRS); do \
			(cd $$subdir; make clean); \
		done; \
	fi;

$(LIBRARY): $(OBJECT)
	$(AR) rcu $(LIBRARY) $(OBJECT)
#	$(AR) rcs $(LIBRARY) $(OBJECT)

%.o: $(TOPLEVEL)/$(CURRENT)/%.cxx
	$(CC) -c $(CFLAGS) $<

.SILENT: all_sub clean_sub
CURRENT  = src
TOPLEVEL = ..
LIBRARY  = lib.a

SUBDIRS = \
    planet

SOURCES = \
	main.cxx \
	GLSL.cxx \
	textfile.cxx \
	Vector.cxx \
	Matrix.cxx \
	Keyboard.cxx \
	Settings.cxx \
	Game.cxx \
	Camera.cxx \
	Light.cxx \
	Texture.cxx \
	TextureFactory.cxx \
	World.cxx \
	text.cxx \
	Debug.cxx \
	3ds.cxx \
	Ship.cxx \
	Shot.cxx \
	Billboard.cxx \
	Explosion.cxx \
	DisplayList.cxx

include $(TOPLEVEL)/Makefile.inc

all: all_sub $(LIBRARY)
CURRENT  = src/planet
TOPLEVEL = ../..
LIBRARY  = lib.a

SUBDIRS = 

SOURCES = \
	Planet.cxx \
	Ring.cxx \
	Sun.cxx \
	Earth.cxx \
	EarthMoon.cxx \
	Jupiter.cxx \
	Mars.cxx \
	Mercury.cxx \
	Neptun.cxx \
	Pluto.cxx \
	Saturn.cxx \
	Saturnring.cxx \
	Uranus.cxx \
	Venus.cxx

include $(TOPLEVEL)/Makefile.inc

all: all_sub $(LIBRARY)

Batch Files .bat an Windows 7 Taskleiste anheften

1. Die anzuheftende Batchdatei von batch.bat nach batch.exe umbenennen.

2. Die Batchdatei nun in die Taskleiste ziehen und anheften.

3. Nun die original Batchdatei wieder umbenennen in batch.bat.

4. Mit gedrückter Shift-Taste mit der rechten Mausstaste auf die Verknüpfung klicken und auf Eigenschaften klicken.

5. Unter Ziel nun den korrekten Pfad zur Batchdatei eingeben. Es reicht aus, aus dem .exe ein .bat zu machen.

Quelle: Windows 7: Batchdatei an die Taskleiste anheften

Erste Windows Programmierung unter MingW

#ifndef UNICODE
#define UNICODE
#endif 

#include <windows.h>

LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR pCmdLine, int nCmdShow)
{
    // Register the window class.
    const wchar_t CLASS_NAME[]  = L"Sample Window Class";
    
    WNDCLASS wc = { };

    wc.lpfnWndProc   = WindowProc;
    wc.hInstance     = hInstance;
    wc.lpszClassName = CLASS_NAME;

    RegisterClass(&wc);

    // Create the window.

    HWND hwnd = CreateWindowEx(
        0,                              // Optional window styles.
        CLASS_NAME,                     // Window class
        L"Learn to Program Windows",    // Window text
        WS_OVERLAPPEDWINDOW,            // Window style

        // Size and position
        CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,

        NULL,       // Parent window    
        NULL,       // Menu
        hInstance,  // Instance handle
        NULL        // Additional application data
        );

    if (hwnd == NULL)
    {
        return 0;
    }

    ShowWindow(hwnd, nCmdShow);

    // Run the message loop.

    MSG msg = { };
    while (GetMessage(&msg, NULL, 0, 0))
    {
        TranslateMessage(&msg);
        DispatchMessage(&msg);
    }

    return 0;
}

LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
    switch (uMsg)
    {
    case WM_DESTROY:
        PostQuitMessage(0);
        return 0;

    case WM_PAINT:
        {
            PAINTSTRUCT ps;
            HDC hdc = BeginPaint(hwnd, &ps);

            FillRect(hdc, &ps.rcPaint, (HBRUSH) (COLOR_WINDOW+1));

            EndPaint(hwnd, &ps);
        }
        return 0;

    }
    return DefWindowProc(hwnd, uMsg, wParam, lParam);
}

Dell3100cn mit Windows 7

Zuerst nur PS-Treiber installieren.
Danach neuer Drucker installieren mit Pfad zu Treiber.
Schlussendlich über Reiter “Anschlüsse” auf “NtwPort00” (RAW) wechseln.

Besser:
Geräte und Drucker -> Drucker hinzufügen -> Ein lokaler Drucker hinzufügen -> Neuer Anschluss erstellen -> Standart TCP/IP Port -> IP-Adresse -> Treiber angeben. Fertig!