Visualizzazione dei risultati da 1 a 5 su 5
  1. #1
    Utente di HTML.it
    Registrato dal
    Aug 2007
    Messaggi
    57

    [C++]Creazione di makefile

    Salve a tutti. Dovrei creare un makefile per un progetto. Fino ad ora non mi serviva perchè lavoravo su Eclipse, ora però devo lavorare in remoto via ssh, quindi devo compilare tramite make.
    I sorgenti sono i seguenti: Elaborato.cpp (dove c'è il main), Image.cpp, Image.h, Slice.cpp, Slice.h, Reader.cpp, Reader.h
    Elaborato include le altre 3 classi, Image include Slice, Reader include Slice e Image.
    Il makefile da cui voglio partire è il seguente:
    codice:
    CC = g++ 
    CFLAGS =-00 -g3 -Wall -fmessage-length=0 
    LIBS =-L/usr/lib -L/usr/bin -lcv -lcxcore -lhighgui -lcvaux -I/usr/include/opencv  
    progamma : prova.cpp
     	$(CC) $(CFLAGS) -c prova.cpp $(LIBS)
     	$(CC) prova.o $(LIBS) -o prova
    Le librerie di OpenCV che utilizzo sono highgui, cxcore e cv e sono contenuti nei path dell'esempio.
    Come modifico il resto?
    Grazie a tutti.

  2. #2
    Non sono un esperto di makefiles pero la guida fornita da Gnu direi che é abbastanza dettagliata.

  3. #3
    Utente di HTML.it
    Registrato dal
    Aug 2007
    Messaggi
    57
    Ho guardato e ho trovato che non aggiungevo le librerie alle compilazioni dei singoli oggetti, ora però mi da un'altro errore:
    codice:
    guess85:cartella guess$ make
    g++ -00 -g3 -Wall -c -g -fmessage-length=0 Elaborato.cpp
    Elaborato.cpp:9:16: error: cv.h: No such file or directory
    Elaborato.cpp:10:21: error: highgui.h: No such file or directory
    Slice.h:32: error: ISO C++ forbids declaration of ‘IplImage’ with no type
    Slice.h:32: error: expected ‘;’ before ‘*’ token
    Slice.h:33: error: ISO C++ forbids declaration of ‘IplImage’ with no type
    Slice.h:33: error: expected ‘;’ before ‘*’ token
    Slice.h:40: error: ISO C++ forbids declaration of ‘vector’ with no type
    Slice.h:40: error: expected ‘;’ before ‘<’ token
    Slice.h:42: error: ISO C++ forbids declaration of ‘vector’ with no type
    Slice.h:42: error: expected ‘;’ before ‘<’ token
    Slice.h:44: error: ISO C++ forbids declaration of ‘vector’ with no type
    Slice.h:44: error: expected ‘;’ before ‘<’ token
    Slice.h:46: error: expected ‘;’ before ‘(’ token
    Slice.h:47: error: ‘IplImage’ has not been declared
    Slice.h:50: error: ‘vector’ has not been declared
    Slice.h:50: error: expected ‘,’ or ‘...’ before ‘<’ token
    Slice.h:52: error: ‘IplImage’ has not been declared
    Slice.h:52: error: ‘vector’ has not been declared
    Slice.h:52: error: expected ‘,’ or ‘...’ before ‘<’ token
    Slice.h:53: error: ISO C++ forbids declaration of ‘IplImage’ with no type
    Slice.h:53: error: expected ‘;’ before ‘*’ token
    Slice.h:57: error: expected `)' before ‘*’ token
    Image.h:30: error: ISO C++ forbids declaration of ‘IplImage’ with no type
    Image.h:30: error: expected ‘;’ before ‘*’ token
    Image.h:34: error: ISO C++ forbids declaration of ‘vector’ with no type
    Image.h:34: error: expected ‘;’ before ‘<’ token
    Image.h:36: error: ISO C++ forbids declaration of ‘IplImage’ with no type
    Image.h:36: error: expected ‘;’ before ‘*’ token
    Image.h:37: error: expected ‘;’ before ‘(’ token
    Image.h:39: error: ‘vector’ has not been declared
    Image.h:39: error: expected ‘,’ or ‘...’ before ‘<’ token
    Reader.h:24: error: ISO C++ forbids declaration of ‘vector’ with no type
    Reader.h:24: error: expected ‘;’ before ‘<’ token
    Reader.h:25: error: ISO C++ forbids declaration of ‘vector’ with no type
    Reader.h:25: error: expected ‘;’ before ‘<’ token
    Reader.h:33: error: ISO C++ forbids declaration of ‘vector’ with no type
    Reader.h:33: error: expected ‘;’ before ‘<’ token
    make: *** [Elaborato.o] Error 1

  4. #4
    Utente di HTML.it
    Registrato dal
    Aug 2007
    Messaggi
    57
    Tutto risolto, non includevo il path nella compilazione.

  5. #5
    Adesso che me lo hai fatto notare mi sono dato dello sbadato

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.