Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can`t build app #15

Closed
8fa94 opened this issue Aug 6, 2019 · 9 comments
Closed

Can`t build app #15

8fa94 opened this issue Aug 6, 2019 · 9 comments

Comments

@8fa94
Copy link

8fa94 commented Aug 6, 2019

Hallo .

qamel build -o output/desktop-app.exe --copy-deps
Starting build process.

Load config file...done
Removing old build files...done
Generating binding files...done
Generating Qt resource file...done
Generating syso file...icon file doesn't exist
Generating code for QML objects...done
Building app...
Failed to build app : exit status 1
go build github.com/RadhiFadlillah/qamel: E:\Go\pkg\tool\windows_amd64\cgo.exe:  exit status 2

How can i solve this problem?
Thanks.

@RadhiFadlillah
Copy link
Collaborator

Hi @8fa94, could you give me the output for go env and qamel profile print please.

@8fa94
Copy link
Author

8fa94 commented Aug 8, 2019

Hi, @RadhiFadlillah
This problem was solved, but brings new problem.
output:

C:\Users\root\go\src\hallo_world>qamel build -o output/desktop-app.exe --copy-deps
Starting build process.

Load config file...done
Removing old build files...done
Generating binding files...done
Generating Qt resource file...done
Generating syso file...icon file doesn't exist
Generating code for QML objects...done
Building app...
Failed to build app: exit status 2
# github.com/RadhiFadlillah/qamel
application.cpp:2:10: fatal error: QApplication: No such file or directory
 #include <QApplication>
          ^~~~~~~~~~~~~~
compilation terminated.


C:\Users\root\go\src\hallo_world>go env
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\root\AppData\Local\go-build
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\Users\root\go
set GOPROXY=
set GORACE=
set GOROOT=E:\Go
set GOTMPDIR=
set GOTOOLDIR=E:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\root\AppData\Local\Temp\go-build293066310=/tmp/go-build -gno-record-gcc-switches

C:\Users\root\go\src\hallo_world>qamel profile print
Details of profile default
OS      : windows
Arch    : amd64
Static  : false
Qmake   : E:\qt\qt5.13.0\5.13.0\mingw73_64\bin\qmake.exe
Moc     : E:\qt\qt5.13.0\5.13.0\mingw73_64\bin\moc.exe
Rcc     : E:\qt\qt5.13.0\5.13.0\mingw73_64\bin\rcc.exe
Gcc     : gcc.exe
G++     : g++.exe
Objdump : objdump.exe
Windres : E:\qt\qt5.13.0\Tools\mingw730_64\bin\windres.exe

@RadhiFadlillah
Copy link
Collaborator

Hi @8fa94, sorry for late response.

I reckon you are using Qt from official installer, correct? If so, It seems you are using the wrong gcc, g++ and objdump. You should use the one that provided by mingw, so your profile should look like this :

Details of profile default
OS      : windows
Arch    : amd64
Static  : false
Qmake   : E:\qt\qt5.13.0\5.13.0\mingw73_64\bin\qmake.exe
Moc     : E:\qt\qt5.13.0\5.13.0\mingw73_64\bin\moc.exe
Rcc     : E:\qt\qt5.13.0\5.13.0\mingw73_64\bin\rcc.exe
Gcc     : E:\qt\qt5.13.0\Tools\mingw730_64\bin\gcc.exe
G++     : E:\qt\qt5.13.0\Tools\mingw730_64\bin\g++.exe
Objdump : E:\qt\qt5.13.0\Tools\mingw730_64\bin\objdump.exe
Windres : E:\qt\qt5.13.0\Tools\mingw730_64\bin\windres.exe

@8fa94
Copy link
Author

8fa94 commented Aug 11, 2019

Hi, @RadhiFadlillah Thank you for your patient help.
I tried following your installation wiki,and same profiles as you ,but he said gcc is not in my %PATH% ,and appear the frist problem,and then I tried add E:\qt\qt5.13.0\Tools\mingw730_64\bin to environment PATH ,the frist problem was solved,but there is a second problem,

# github.com/RadhiFadlillah/qamel
application.cpp:2:10: fatal error: QApplication: No such file or directory
 #include <QApplication>
          ^~~~~~~~~~~~~~
compilation terminated.

profile is the same as you,but has the same wrong.

@RadhiFadlillah
Copy link
Collaborator

@8fa94 that's a bit weird. I can't reproduce it even on a freshly installed Windows 7.

but he said gcc is not in my %PATH%

Normally, even if gcc is not set in your environment variable, qamel should be still able to build because qamel will register the temporary environment variable automatically.

With that said, if you don't mind, could you give me more information :

  • Could you update qamel again and give me the output for qamel --version ? BTW, for updating qamel, you might need to delete the old files in directory %GOPATH%/src/github.com/RadhiFadlillah/qamel.
  • I forgot to ask what is your OS ? Is it Windows 7 or Windows 10 ?
  • Which shells that you use ? Is it the normal cmd, powershell, or third party shell like cmder ?

Thanks !

@8fa94
Copy link
Author

8fa94 commented Aug 14, 2019

@RadhiFadlillah I try in new environment OS:Windows 10
and just install QT and GO and i try again. Use cmd.

C:\Users\root\go\src\github.com\RadhiFadlillah\qamel\examples\hello-world>qamel build -o output/desktop-app.exe --copy-deps
Starting build process.

Load config file...done
Removing old build files...done
Generating binding files...done
Generating Qt resource file...done
Generating syso file...icon file doesn't exist
Generating code for QML objects...done
Building app...
Failed to build app: exit status 1
go build runtime/cgo: c:\go\pkg\tool\windows_amd64\cgo.exe: exit status 2

C:\Users\root\go\src\github.com\RadhiFadlillah\qamel\examples\hello-world>qamel --version
qamel version 715de5446c83d5543369f3a88891f4e170cc0d2a

C:\Users\root\go\src\github.com\RadhiFadlillah\qamel\examples\hello-world>qamel profile print
Details of profile default
OS      : windows
Arch    : amd64
Static  : false
Qmake   : C:\Qt\Qt5.13.0\5.13.0\mingw73_64\bin\qmake.exe
Moc     : C:\Qt\Qt5.13.0\5.13.0\mingw73_64\bin\moc.exe
Rcc     : C:\Qt\Qt5.13.0\5.13.0\mingw73_64\bin\rcc.exe
Gcc     : C:\Qt\Qt5.13.0\Tools\mingw730_64\bin\gcc.exe
G++     : C:\Qt\Qt5.13.0\Tools\mingw730_64\bin\g++.exe
Objdump : C:\Qt\Qt5.13.0\Tools\mingw730_64\bin\objdump.exe
Windres : C:\Qt\Qt5.13.0\Tools\mingw730_64\bin\windres.exe

Thanks!

@RadhiFadlillah
Copy link
Collaborator

Hi @8fa94, sorry for late response.

I've tested it in a freshly installed Windows 10, and I can confirm this issue happened when using cmd and powershell. However, the qamel works properly when I'm using cmder.

Unfortunately, after several days I still haven't found the cause which make qamel works in cmder but not in other terminal. So, for now, as far as I tested, cmder is the only terminal in Windows that compatible with qamel.

With that said, if you don't mind, could you test it out using cmder ? Even the cmder-mini should works fine.

Thanks !

@8fa94
Copy link
Author

8fa94 commented Sep 8, 2019

@RadhiFadlillah Thank you for your patience.
I solved the problem after i used cmder.

@RadhiFadlillah
Copy link
Collaborator

Hi @8fa94, glad it worked out for you.

I'll close this issue for now. For the problem with cmd and powershell, it will be tracked in #18.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants