I've been coding an application for a couple months on linux, using Qt 4.7.0, and lately i decided to deploy it to windows.

In linux, i have no problem when compiling the whole application (containing a library, a designer plugin, and a executable), but when porting to windows I had some problems with the library (all solved thanks to this forum).

Now that I have both libraries working, the executable project won't compile, prompting a lot of "undefined reference to" errors when linking the libraries.

I have checked that the Qt Creator can compile using the Qt demos, so i guess it's an error in the project files, so i include the configurations i am using:

First library:

Qt Code:
  1. TEMPLATE = lib
  2.  
  3. QT += sql
  4.  
  5. TARGET = lib1
  6.  
  7. LIBS += -lstdc++
  8.  
  9. unix {
  10. UI_DIR = ../.ui
  11. MOC_DIR = ../.moc
  12. OBJECTS_DIR = ../.obj
  13. }
  14.  
  15. win32 {
  16. UI_DIR = ../ui
  17. MOC_DIR = ../moc
  18. OBJECTS_DIR = ../obj
  19. }
  20.  
  21. TARGET = $$qtLibraryTarget($$TARGET)
  22. target.path = $$[QT_INSTALL_PLUGINS]/designer
  23. INSTALLS += target
  24.  
  25. DESTDIR = ../bin
To copy to clipboard, switch view to plain text mode 

The second library (the designer plugin, using the first lib).

Qt Code:
  1. TEMPLATE = lib
  2.  
  3. TARGET = lib2
  4.  
  5. QT += sql network xml
  6.  
  7. CONFIG += designer \
  8. plugin
  9.  
  10. LIBS += -lstdc++ -L../bin -llib1
  11.  
  12. INCLUDEPATH += . ../model
  13.  
  14. unix {
  15. UI_DIR = ../.ui
  16. MOC_DIR = ../.moc
  17. OBJECTS_DIR = ../.obj
  18. }
  19.  
  20. win32 {
  21. UI_DIR = ../ui
  22. MOC_DIR = ../moc
  23. OBJECTS_DIR = ../obj
  24. }
  25.  
  26. TARGET = $$qtLibraryTarget($$TARGET)
  27. target.path = $$[QT_INSTALL_PLUGINS]/designer
  28. INSTALLS += target
  29.  
  30. DESTDIR = ../bin
To copy to clipboard, switch view to plain text mode 


And finally, the executable .pro:

Qt Code:
  1. TEMPLATE = app
  2.  
  3. TARGET = Contabilidad
  4.  
  5. QT += sql network xml
  6.  
  7. CONFIG += debug \
  8. qt \
  9. thread
  10.  
  11. INCLUDEPATH += ./ ventanas/
  12.  
  13. LIBS += -L../bin -L../sqldrivers -lstdc++ -lQtSql -llib1 -llib2
  14.  
  15. unix{
  16. UI_DIR = ../.ui
  17. MOC_DIR = ../.moc
  18. OBJECTS_DIR = ../.obj
  19. RCC_DIR = ../.rcc
  20. }
  21.  
  22. win32{
  23. UI_DIR = ../ui
  24. MOC_DIR = ../moc
  25. OBJECTS_DIR = ../obj
  26. RCC_DIR = ../rcc
  27. }
  28.  
  29. DESTDIR = ../bin
To copy to clipboard, switch view to plain text mode 

Any help would be really appreciated, because i've been trying to deploy to windows for a couple of days and I just can't see the problem (guess its a silly one).

Best Regards

Josep