PDA

View Full Version : I can't compile my program in windows!!



brevleq
25th November 2007, 21:46
I wanted to start the tests of my program in windows, but when I try to compile:

mingw32-make -f Makefile.Release
mingw32-make[1]: Entering directory `C:/Documents and Settings/Hudson/Meus documentos/caixa_xpress'
g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_NO_DEBUG -DQT_SQL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"..\..\..\..\Qt\4.3.2\include\QtCore" -I"..\..\..\..\Qt\4.3.2\include\QtCore" -I"..\..\..\..\Qt\4.3.2\include\QtGui" -I"..\..\..\..\Qt\4.3.2\include\QtGui" -I"..\..\..\..\Qt\4.3.2\include\QtSql" -I"..\..\..\..\Qt\4.3.2\include\QtSql" -I"..\..\..\..\Qt\4.3.2\include" -I"." -I"c:\Qt\4.3.2\include\ActiveQt" -I"release" -I"." -I"..\..\..\..\Qt\4.3.2\mkspecs\win32-g++" -o release\main.o main.cpp
main.cpp:3:27:ManipulaBanco.h: No such file or directory
main.cpp:4:27:TelaPrincipal.h: No such file or directory

.....a lot of errors.....

mingw32-make[1]: Leaving directory `C:/Documents and Settings/Hudson/Meus documentos/caixa_xpress'

I can't understand!! The files are the same I used in Linux!!

:crying:

jpn
25th November 2007, 22:36
How does the .pro file look like? Do these files:

main.cpp:3:27:ManipulaBanco.h: No such file or directory
main.cpp:4:27:TelaPrincipal.h: No such file or directory
actually exist in `C:/Documents and Settings/Hudson/Meus documentos/caixa_xpress'?

brevleq
26th November 2007, 17:05
These files are in caixa_xpress directory!!

My caixa_xpress.pro is:

################################################## ####################
# Automatically generated by qmake (2.01a) dom 25. nov 18:35:30 2007
################################################## ####################

TEMPLATE = app
TARGET =
DEPENDPATH += . \
bd \
cadastro \
criacao_caixa \
tela_principal \
listagem\.lista \
listagem\lista \
listagem\lista_grupos \
relatorio\emissao_caixa \
relatorio\relatorio_credito \
relatorio\relatorio_debito
INCLUDEPATH += .

# Input
HEADERS += bd/ManipulaBanco.h \
bd/ManipulaCaixaMensal.h \
bd/ManipulaGrupos.h \
bd/ManipulaRegistros.h \
bd/ManipulaTipos.h \
cadastro/Cadastro.h \
criacao_caixa/CriacaoCaixa.h \
criacao_caixa/InserirRegistro.h \
tela_principal/.tela_principal.h \
tela_principal/AbrirDialog.h \
tela_principal/TelaPrincipal.h \
listagem/.lista/lista_credito.h \
listagem/lista/Lista.h \
listagem/lista_grupos/Adicionar.h \
listagem/lista_grupos/ListaGrupos.h
FORMS += cadastro/Cadastro.ui \
criacao_caixa/CriacaoCaixa.ui \
criacao_caixa/InserirRegistro.ui \
criacao_caixa/RemoverTipo.ui \
tela_principal/AbrirDialog.ui \
tela_principal/TelaPrincipal.ui \
listagem/.lista/Lista.ui \
listagem/lista/Lista.ui \
listagem/lista_grupos/Adicionar.ui \
listagem/lista_grupos/ListaGrupos.ui \
relatorio/emissao_caixa/relatorio_emissao_caixa_Dialog.ui \
relatorio/relatorio_credito/relatorio_credito_Dialog.ui \
relatorio/relatorio_debito/relatorio_debito_Dialog.ui
SOURCES += main.cpp \
bd/ManipulaBanco.cpp \
bd/ManipulaCaixaMensal.cpp \
bd/ManipulaGrupos.cpp \
bd/ManipulaRegistros.cpp \
bd/ManipulaTipos.cpp \
cadastro/Cadastro.cpp \
criacao_caixa/CriacaoCaixa.cpp \
criacao_caixa/InserirRegistro.cpp \
tela_principal/.tela_principal.cpp \
tela_principal/AbrirDialog.cpp \
tela_principal/TelaPrincipal.cpp \
listagem/.lista/lista_credito.cpp \
listagem/lista/Lista.cpp \
listagem/lista_grupos/Adicionar.cpp \
listagem/lista_grupos/ListaGrupos.cpp
QT+=sql


you can see that the files the compiler isn't find, are in the caixa_xpress.pro and are in the correct directory!!

wysota
26th November 2007, 17:54
Are you sure there are no filename clashes due to the fact that Windows filesystem is case insensitive?

pdolbey
26th November 2007, 19:16
Try adding

INCLUDEPATH += ./bd

Pete

brevleq
27th November 2007, 16:29
Guys I putted

INCLUDEPATH += ./bd

in the .pro file, ok the messages telling that the file was not found hided! But anothers messages telling others .h files not found was showed. I tried putting the path to that files like:

INCLUDEPATH += ./tela_principal
...

but the messages don't hide and consequently the program isn't compilled!!

wysota
27th November 2007, 16:34
Try changing DEPENDPATH to INCLUDEPATH. And don't use the slashdot, it's not needed.

pdolbey
27th November 2007, 17:52
Try changing DEPENDPATH to INCLUDEPATH. And don't use the slashdot, it's not needed.

No its not needed, its just my style preference for include paths. I hoped that brevleq might have noticed that DEPENDPATH was the wrong choice for all the include folders. I also thought that he might have also noticed the discrepancy between \ used a path separator in the DEPENDPATH section (as well as line continuity) and / used in the HEADERS section. I hope that wysota agrees that you should use / to separate paths and \ as line continuation in qmake files. Or is this too many fish?

Pete

wysota
27th November 2007, 18:00
I agree that patience is a virtue and I agree that trial & error and reading the docs can help much to prevent the loss of the virtue by people answering one's questions :) Definitely too many fish :cool:

brevleq
28th November 2007, 11:14
Thanks guys!!

When I swap the DEPENDPATH to INCLUDEPATH the program compiled so well, but now I have another problem!!
When I do a double click in the exe generated, a message is shown saying:

This program couldn't be started cause mingwm10.dll wasn't found. The reinstall of application could solve this problem.

but I have this dll in these directorys:

c:\MinGW\bin
c:\Qt\4.3.2\bin

where should I put this dll? Should I reinstall MinGW?

jpn
28th November 2007, 11:18
Add a path to required dll to PATH environment variable.

brevleq
29th November 2007, 23:00
ok, but...

What's the name of file I should put the PATH variable?

jpn
29th November 2007, 23:08
When an application is launched, required DLLs (if any) are searched for in the current working directory and in paths listed in the PATH environment variable. Currently, as it says, mingwm10.dll cannot be found. So add "c:\MinGW\bin" to PATH so that it can be found.