Hi!
I have a doubt about using .pro files.

I'm using QT4 under win32 with codeblocks to develop my apps.
I've been developing in c before using QT and never had this strange behaviour.
The basic question is, I need to use the #include directive if I add those files in .pro file??

Cause I'm have not clear the whole concept of how this works, I'm constantly problems every time I add a new file to the project and spent a lot of time trying to "hack" every file to get it work.

For example, the last problem I've got was a "multiple declaration" error at compile time.
I added a new class:
MapWidget.h
Qt Code:
  1. #include <QGLWidget>
  2.  
  3. class MapWidget : public QGLWidget
  4. {
  5. Q_OBJECT
  6.  
  7. public:
  8. MapWidget( int timerInterval=0, QWidget* parent=0, char* name=0 );
  9.  
  10. protected:
  11. void initializeGL();
  12. void resizeGL( int width, int height );
  13. void paintGL();
  14.  
  15. };
To copy to clipboard, switch view to plain text mode 

MapWidget.c
Qt Code:
  1. #include "MapWidget.h"
  2.  
  3. MapWidget::MapWidget( int timerInterval, QWidget* parent, char* name)
  4. {
  5. }
  6.  
  7. void MapWidget::initializeGL()
  8. {
  9. }
  10.  
  11. void MapWidget::resizeGL( int width, int height )
  12. {
  13. }
  14.  
  15. void MapWidget::paintGL()
  16. {
  17. }
To copy to clipboard, switch view to plain text mode 

Then in another already working file, I add MapWidget.c.
This causes the "multiple declaration" error over every MapWidget method.
I checked every file in the project and I don't duplicate the include of MapWidget.c .
If I delete the #include "graphics/MapWidget.c" then all compiles correctly.

What's wrong!?

This is my .pro file:
Qt Code:
  1. TEMPLATE = app
  2. TARGET =
  3. DEPENDPATH += . comm debug forms graphics release
  4. QT += opengl
  5. CONFIG += console
  6. CONFIG += qt debug
  7. DESTDIR = bin/
  8. INCLUDEPATH += .
  9. # Input
  10. FORMS += forms/gepeese.ui forms/gps_config.ui
  11. HEADERS += definitions.h \
  12. GuiGPS.hpp \
  13. comm/GPScomm.hpp \
  14. comm/NMEA.hpp \
  15. comm/SerialPort.hpp \
  16. forms/ConfigGPS.hpp \
  17. graphics/MapWidget.hpp
  18. SOURCES += GuiGPS.cpp \
  19. main.cpp \
  20. comm/GPScomm.cpp \
  21. comm/NMEA.cpp \
  22. comm/SerialPort.cpp \
  23. forms/ConfigGPS.cpp \
  24. graphics/MapWidget.cpp
  25. RESOURCES += resources.qrc
To copy to clipboard, switch view to plain text mode 

PD:Sorry about my english.