matheraum.de
Raum für Mathematik
Offene Informations- und Nachhilfegemeinschaft

Für Schüler, Studenten, Lehrer, Mathematik-Interessierte.
Hallo Gast!einloggen | registrieren ]
Startseite · Forum · Wissen · Kurse · Mitglieder · Team · Impressum
Forenbaum
^ Forenbaum
Status Mathe
  Status Schulmathe
    Status Primarstufe
    Status Mathe Klassen 5-7
    Status Mathe Klassen 8-10
    Status Oberstufenmathe
    Status Mathe-Wettbewerbe
    Status Sonstiges
  Status Hochschulmathe
    Status Uni-Analysis
    Status Uni-Lin. Algebra
    Status Algebra+Zahlentheo.
    Status Diskrete Mathematik
    Status Fachdidaktik
    Status Finanz+Versicherung
    Status Logik+Mengenlehre
    Status Numerik
    Status Uni-Stochastik
    Status Topologie+Geometrie
    Status Uni-Sonstiges
  Status Mathe-Vorkurse
    Status Organisatorisches
    Status Schule
    Status Universität
  Status Mathe-Software
    Status Derive
    Status DynaGeo
    Status FunkyPlot
    Status GeoGebra
    Status LaTeX
    Status Maple
    Status MathCad
    Status Mathematica
    Status Matlab
    Status Maxima
    Status MuPad
    Status Taschenrechner

Gezeigt werden alle Foren bis zur Tiefe 2

Navigation
 Startseite...
 Neuerdings beta neu
 Forum...
 vorwissen...
 vorkurse...
 Werkzeuge...
 Nachhilfevermittlung beta...
 Online-Spiele beta
 Suchen
 Verein...
 Impressum
Das Projekt
Server und Internetanbindung werden durch Spenden finanziert.
Organisiert wird das Projekt von unserem Koordinatorenteam.
Hunderte Mitglieder helfen ehrenamtlich in unseren moderierten Foren.
Anbieter der Seite ist der gemeinnützige Verein "Vorhilfe.de e.V.".
Partnerseiten
Dt. Schulen im Ausland: Mathe-Seiten:Weitere Fächer:

Open Source FunktionenplotterFunkyPlot: Kostenloser und quelloffener Funktionenplotter für Linux und andere Betriebssysteme
StartseiteMatheForenPraxisMakefile für dll
Foren für weitere Studienfächer findest Du auf www.vorhilfe.de z.B. Astronomie • Medizin • Elektrotechnik • Maschinenbau • Bauingenieurwesen • Jura • Psychologie • Geowissenschaften
Forum "Praxis" - Makefile für dll
Makefile für dll < Praxis < Informatik < Vorhilfe
Ansicht: [ geschachtelt ] | ^ Forum "Praxis"  | ^^ Alle Foren  | ^ Forenbaum  | Materialien

Makefile für dll: Korrektur
Status: (Frage) beantwortet Status 
Datum: 16:34 Mo 13.02.2012
Autor: Stoecki

Hallo zusammen,

ich muss zum Kompilieren einer dll ein Makefile schreiben. Ich stehe dabei ein wenig auf dem Schlauch. Hier der Inhalt meines Makefiles:

CC=g++

math_lib.dll: math_program.o internal.o misc.o ap.o
        $(CC) -shared -o math_lib.dll internal.o misc.o ap.o  -c math_program.cpp math_program.o


internal.o: internal.cpp internal.h ap.o
        $(CC) -O -c internal.cpp

misc.o: misc.cpp misc.h ap.o internal.o
        $(CC) -O  -c misc.cpp

ap.o: ap.cpp ap.h
        $(CC) -O -c ap.cpp

math_program.o: internal.o misc.o ap.o math_program.cpp
        $(CC) *.o -O -c math_program.cpp



Die Objectdateien ap.o, internal.o und misc.o erzeugt er fehlerfrei. Danach kommen folgende warnings:

g++: internal.o: linker input file unused because linking not done
g++: misc.o: linker input file unused because linking not done
g++: ap.o: linker input file unused because linking not done
g++ -shared -o math_lib.dll internal.o misc.o ap.o -c math_program.cpp math_program.o
In file included from math_program.cpp:6:
g++: internal.o: linker input file unused because linking not done
g++: misc.o: linker input file unused because linking not done
g++: ap.o: linker input file unused because linking not done
g++: math_program.o: linker input file unused because linking not done


Schaut man sich anschließend die größe der erzeugten dateien an, sieht es so aus, als ob die .o Dateien korrekt erzeugt werden, allerdings stimmt die größe der dll nicht. die ist mit 4kb deutlich zu klein. Weiß jemand, wie der korrekte Befehl im Makefile lauten muss um diese dll math_lib.dll zu erzeugen?

Schon mal danke vorab

Gruß Bernhard

PS: Ich habe die Frage in keinem anderen Forum gestellt.


        
Bezug
Makefile für dll: Antwort
Status: (Antwort) fertig Status 
Datum: 20:12 Mo 13.02.2012
Autor: Event_Horizon

Hallo!

Es ist etwas schwierig, das zu beurteilen, wenn man nicht ganz weiß, was in den Quelldateien so drin ist.

Aber ich sehe folgendes:

math_lib.dll: math_program.o internal.o misc.o ap.o
          $(CC) -shared -o math_lib.dll internal.o misc.o ap.o  -c math_program.cpp math_program.o


Warum -c math_program.cpp, wenn du in der gleichen zeile noch sagst, daß er math_program.o benutzen soll? math_program.o wird ja bereits in der letzten make-Anweisung kompiliert.

Nebenbei sind deine Warnmeldungen fast alle harmlos, sie sagen nur aus, daß du die Einzeldateien nicht zu was größerem linkst.Allerdings:


g++ -shared -o math_lib.dll internal.o misc.o ap.o -c math_program.cpp math_program.o
In file included from math_program.cpp:6:

klingt wie der Anfang einer Fehlermeldung des Compilers, aber wie die Fehlermeldung lautet, sagst du nicht. Das ist normalerweise aber wichtig, weil da gute Hinweise drin stehen, auch wenn es gerne was kryptisch ist.
Aber vielleicht liegts erstmal an dem erstgenannten Problem mit deinem makefile.


Bezug
                
Bezug
Makefile für dll: Mitteilung
Status: (Mitteilung) Reaktion unnötig Status 
Datum: 10:17 Di 14.02.2012
Autor: Stoecki

danke für die antwort. es hat mir sehr geholfen. für die, die ebenfalls mal dlls kompilieren müssen hier noch mal das letztliche makefile. das -fPIC musste wegen folgender fehlermeldung noch rein (could not read symbols: Bad value):

CC=g++
pathincl = -I ./
pathlib2 = -L ./




math_lib.dll: math_program.o internal.o misc.o ap.o
        $(CC) -shared -o math_lib.dll internal.o misc.o ap.o math_program.o

internal.o: internal.cpp internal.h ap.o
        $(CC) -O -c -fPIC internal.cpp

misc.o: misc.cpp misc.h ap.o internal.o
        $(CC) -O -c -fPIC misc.cpp

ap.o: ap.cpp ap.h
        $(CC) -O -c -fPIC ap.cpp



math_program.o: internal.o misc.o ap.o math_program.cpp math_program.h
        $(CC) *.o -O -c -fPIC math_program.cpp



clean:
        rm -rf *.o


gruß bernhard


Bezug
Ansicht: [ geschachtelt ] | ^ Forum "Praxis"  | ^^ Alle Foren  | ^ Forenbaum  | Materialien


^ Seitenanfang ^
www.matheraum.de
[ Startseite | Forum | Wissen | Kurse | Mitglieder | Team | Impressum ]