last day (14 days later) » 

12:25 AM
So did you look at the CMakeLists files?
 
Yep, thanks for replying quickly.
Do you have any further error output after fixing your configuration issues?
As in, what is the build output now?
 
In the compile output tab, it says Error while building/deploying project icg (kit: Desktop Qt 5.9.0 MinGW 32bit)
When executing step "CMake Build".
Then in the application output, it says transform.exe was not found.
 
I assume you're using a Makefile-based generator? If so, can you add VERBOSE=1 to your build command line? You can do that under the Projects tab in the sidebar, then expand the Details for the Build step. You should be able to add VERBOSE=1 to the tool arguments there.
Also, are you trying to build or run the app? What's the method by which you are triggering the build (what button, menu item or shortcut key)?
 
I'm using the run button or ctrl+r. Also I'm not sure what you mean by add VERBOSE=1 to the build command line.
 
Let me upload a couple of screenshots to help you. Gimme a sec....
I'm on Mac, but it should look reasonably similar on Windows too.
 
12:34 AM
Alright looks like I added it.
 
I think your build step is completing successfully, but then the run stage is failing. I just want to see how the build step is finishing to try to confirm that. You may need to do a make clean and then try to build again with VERBOSE=1 so we get to see the build details.
 
Ok so I cleaned my project and ran it again. The first time I ran it it, the compile output looked like this:
17:37:27: Running steps for project icg...
17:37:27: Starting: "C:\Program Files\CMake\bin\cmake.exe" --build . --target all -- VERBOSE=1
17:37:27: Elapsed time: 00:00.
 
That's where to find "clean", in case you haven't used it before (sorry, I don't know your level of familiarity with Qt Creator).
 
Then I ran it again and the compile output looked like this:
 
Ah, you beat me to it. ;)
 
12:38 AM
17:38:27: Running steps for project icg...
17:38:27: Starting: "C:\Program Files\CMake\bin\cmake.exe" --build . --target all -- VERBOSE=1
Error while building/deploying project icg (kit: Desktop Qt 5.9.0 MinGW 32bit)
When executing step "CMake Build"
17:38:27: Elapsed time: 00:00.
 
Hmm.... okay it's the build that's failing after all.
Let's be absolutely sure though. Can you right-click on the project and select Build? That should give the same error.
 
Yep, looks like it's the exact same error.
 
Let's dig into the CMakeLists.txt files for a bit. In your transform directory's CMakeLists.txt file, just before the add_executable() call, add the following:
message("EXERCISENAME = ${EXERCISENAME}")
 
Ok I added it
 
Re-run CMake (right-click on the project, select Run CMake).
You should see the newly added output line in your General Messages output pane.
 
12:43 AM
There's alot of lines there. What should it say?
 
Look for EXERCISENAME. It should all end with Configuring done followed by Generating done if it was successful.
There should be a line that says something like EXERCISENAME = transform, if it is all doing what I think it is.
 
There's alot of stuff in the general messages tab. Is there a way to clear it?
 
Each time CMake is re-run, it appends to the General Messages contents, it doesn't clear previous output. You can wipe the output with the button that looks like a paintbrush next to the heading General Messages.
 
Ok so I was supposed to right click on my project and click on run CMake? Then there should be something there that says EXERCISENAME?
 
Yes.
 
12:49 AM
whats going on here?
 
Ok I'm not seeing anything that says that. It just looks like this:
Running "C:\Program Files\CMake\bin\cmake.exe -E server "--pipe=\\.\pipe\{91a0d82f-a739-4421-af3f-1d87b6e546a4}" --experimental" in C:\Users\Brandon\Desktop\CSC 305\build-icg-Desktop_Qt_5_9_0_MinGW_32bit-Default.
Intro to Graphics - Loading Common Configuration
OPENGP: C:/Users/Brandon/Desktop/CSC 305/icg/common/../external/OpenGP/src/
Found GLEW: C:/Users/Brandon/Desktop/CSC 305/icg/external/glew/lib/win32/glew32s.lib
Found GLFW3: C:/Users/Brandon/Desktop/CSC 305/icg/external/glfw/lib-mingw-w64/glfw3.dll
 
I might have an idea. Can you comment out the line that sets EXECUTABLE_OUTPUT_PATH:
#set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_LIST_DIR})
 
Ok so I put the pound symbol in front of it. Then what?
 
Re-run CMake and then try to build again. I think that you might be trying to create an executable target whose output file matches the name of the directory in the source tree.
 
carry on
 
12:52 AM
No, I still get the exact same error as before.
 
In your top level CMakeLists.txt just before the line add_subdirectory(transform), can you add another message line, something like this:
message("Entering transform subdir")
The re-run CMake again. You should see that message appear just before Configuring done.
 
Ok so I may have been editing the wrong CMakeLists file. You see when I was trying to get this to work, I may have created several other files in different directories. So I went back and added that exercise line and now I do see something in general messages that says EXERCISENAME = transform
 
Okay. Ensure the EXECUTABLE_OUTPUT_PATH line is commented out in the correct file and re-try the CMake and Build steps.
 
No, it still gives me the same error.
Also I am seeing Entering transform subdir in my general messages if I add message("Entering transform subdir") to my top level CMakeLists.txt
 
Weird. Can you open up a MinGW console (or whatever gives you a valid console for building MinGW apps), then cd into the build directory.
From there, type the following:
make VERBOSE=1
 
1:04 AM
Ok I did that.
 
What was the output?
 
It's just showing a ton of errors in the programs. It's showing things like variables that weren't declared in a particular scope and compiler errors like that. The weird thing though is that I was able to run this exact code on another computer and it ran perfectly with no problems. So how come I'm getting these compiler errors here?
 
Can you also open the CMakeCache.txt file at the top of your build tree in a text editor and look for CMAKE_GENERATOR:INTERNAL and tell me what that line says.
Maybe also show me the first few of those errors in the output of the make command.
 
How do I get CMakeCache.txt?
 
It should already exist at the top of your build tree (not the top of your source tree).
That's also where you should have run the make command from.
Your source tree directory and build tree directory should not be the same.
 
1:12 AM
So you said it should have been where I ran the make command from? I ran it from a MinGW console and I don't see any build tree.
 
Let's rewind a bit then.
In Qt Creator, go to your Projects tab and have a look near the top of the Build Settings page.
 
ok
 
There will be a line saying Build directory: .... That's where you should find the CMakeCache.txt file and where you need to be when you run the make command from the MinGW console.
 
Ok I found it.
 
So repeat from before, what is the CMAKE_GENERATOR:INTERNAL line in that CMakeCache.txt file?
 
1:17 AM
Should there be a line that says the exact words CMAKE_GENERATOR:INTERNAL?
 
It will have more things after it, but yes. Maybe not the INTERNAL part, so just look for CMAKE_GENERATOR.
 
Ok so it looks like that exact line says CMAKE_GENERATOR:INTERNAL=MinGW Makefiles
 
Good, that's what I wanted to confirm. Now if you run make VERBOSE=1 from that directory, what is the output?
 
Again, it's just a bunch of compiler errors.
 
Okay, can you show the first few? I need to see the specifics of what it is complaining about to have any idea what's happening.
 
1:22 AM
One of the errors looks like this:
In member function 'void OpenGP::ImageRenderer<PixelType>::main()':
C:/Users/Brandon/Desktop/CSC305~1/icg/external/OpenGP/src/OpenGP/Eigen/Image.h:40:13: error: 'uv' was not declared in this scope
uv = vtexcoord;
Another one looks like this:
0:18: error: 'vtexcoord' was not declared in this scope
uv = vtexcoord;
 
Are those the first errors?
 
I don't think so but there's a ton of errors and I can't really scroll up enough to see what the first errors were.
 
The first ones are the most important. Try re-running the command but only show the first 100 or so lines like this:
make VERBOSE=1 | head -100
I think that works on MinGW, but not 100% sure.
 
I don't think that's working. It's just showing me all the errors.
 
Maybe try building just your target then and see if that's any different:
make VERBOSE=1 transform
 
1:28 AM
No, it's still giving me just a ton of errors.
 
You said this project worked on another machine. Was that machine also 64-bit Windows, same version, same tools installed, etc.? Were there any differences between that machine and yours?
 
Actually the other machine was a Mac.
 
Ah..... that's kinda important. ;)
 
Ah. So is there any way to make it work for windows?
 
Well that really depends on the things your project is trying to use. It seems like you are using a number of dependencies: Eigen, OpenGP, OpenGL, GLEW, GLFW. Are these actually installed on your system?
Have you managed to compile a simple test program under MinGW (i.e. just a simple hello world or similar)?
 
1:32 AM
I don't know if I've used MinGW. I used QT creator to compile a simple hello world program.
The simple project also uses CMake.
 
You really need to see the start of the build output to have a hope of working out the problem. The first error is usually more informative and later errors are often just a consequence of the earlier errors.
It's odd that Qt Creator is showing you nothing in the build output, but at least you see it in the console window.
To be clear, does the MinGW console window look like a unix-y window or more like the usual Windows console? Can probably tell by the color of the text if that helps (grey or green).
 
It's weird because in the past QT creator always showed exactly what the error was but now it's not. Could it be a problem with my set up? Also it does looks like the usual windows console.
 
Hmm.... maybe that's not the MinGW console then, but I haven't used MinGW in a while so I can't be sure. Does it recognise the grep command, for instance?
 
yeah it seems to
Oh wait, I just restarted QT creator and it appears to now be giving me the errors.
The first one looks like:
C:\Users\Brandon\Desktop\CSC305~1\icg\external\OpenGP\src\OpenGP\Eigen\Image.h:34: warning: missing terminating " character
const GLchar* vshader = R"GLSL(
^
The second one says:
C:\Users\Brandon\Desktop\CSC305~1\icg\external\OpenGP\src\OpenGP\Eigen\Image.h:35: error: invalid preprocessing directive #version
#version 330 core
^
 
Is that Image.h file inside your project's source or is it coming from somewhere else?
 
1:41 AM
Yes. There's alot of different files I need for this project so they're in external folders.
 
We can't rule out that some of those dependencies might not build with MinGW. You could always try the free version of Visual Studio as an alternative. Might take a while to download, install and try out though.
The first error looks suspicious. I'm struggling to see how a line like that could be valid code.
 
Well it does run on a Mac so it must be valid.
 
That line might not be getting compiled on a Mac, depending on what the preprocessor logic is doing.
 
So are you thinking I should comment out all the parts that look like that?
 
I'm having a look on github now, gimme a few minutes
Okay, you made me learn something new. ;)
The R"foo form requires C++11.
Your top level CMakeLists.txt file isn't turning that on.
Add the following to your top level CMakeLists.txt file immediately after the project() command:
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
 
1:52 AM
And then it should work?
 
You may also want to have a ready of this page at some point to learn about that.
Potentially. It should at least get us past the current build errors.
 
Well that certainly fixed a ton of stuff. Before I got 105 errors. Now I'm just getting 2 errors. The first one doesn't recognize the file glfw3.dll and the second one says this:
collect2.exe:-1: error: error: ld returned 1 exit status
Ok I have to go do something right now. I'll be back in about 10 minutes. Let me know if you figured anything else out.
 
Sure
The first of those two errors is the one that matters. The second is a consequence of the first. Can you show the exact output of the first error?
 
2:20 AM
C:\Users\Brandon\Desktop\CSC 305\icg\external\glfw\lib-mingw-w64\glfw3.dll:-1: error: file not recognized: File format not recognized
 
Could be trying to link to the .dll instead of the .lib
Is the linker command line just above that error?
Would be good to see what the command was that led to the error.
 
Before the error, there's a line that says declared here:
C:\Users\Brandon\Desktop\QT_creator\Tools\mingw530_32\i686-w64-mingw32\include\c++\backward\binders.h:143: declared here
class binder2nd
^
 
Search back up from the glfw3.dll error until you find the linker command that mentions that specific dll.
 
2:36 AM
Ok it's not giving me anymore warnings, just errors which means there's nothing above the glfw3.dll error. If I remove glfw3.dll I then get this error:
:-1: error: No rule to make target 'C:/Users/Brandon/Desktop/CSC 305/icg/external/glfw/lib-mingw-w64/glfw3.dll', needed by 'transform/transform.exe'. Stop.
I know that glfw is important to this program since it's the main command that's called to create a new window or an animation.
 
In your transform/CMakeLists.txt there is a variable COMMON_LIBS being linked. Can you use message() to print the value of that variable please?
 
It looks like the value of COMMON_LIBS is glu32;opengl32;C:/Users/Brandon/Desktop/CSC 305/icg/external/glew/lib/win32/glew32s.lib;C:/Users/Brandon/Desktop/CSC 305/icg/external/glfw/lib-mingw-w64/glfw3.dll
 
Okay, that's incorrect. On Windows, you don't link directly to the .dll file, you need to link to the .lib import library.
Can we eliminate some possibilities before going further. Can you please rename the CMakeLists.txt file in your build directory to something else and then re-run CMake from within Qt Creator. This should make it redo all its library finding logic rather than using any cached values.
I'm concerned that some of the library paths appear to be pointing into your source tree rather than the build tree. Does your source tree have pre-built libraries for some of these external packages?
 
I don't think there is a CMakeLists.txt file in my build directory.
 
Sorry, I meant CMakeCache.txt
 
2:47 AM
Ok I re-ran CMake
It says the configuration has failed
 
Full output of the command please, there will hopefully have been quite a bit of output before it failed.
 
Running "C:\Program Files\CMake\bin\cmake.exe -E server "--pipe=\\.\pipe\{e83de77e-13b4-4cae-a0c4-2f8c81c23ba5}" --experimental" in C:\Users\Brandon\Desktop\CSC 305\build-icg-Desktop_Qt_5_9_0_MinGW_32bit-Default.
CMake Error at C:/Program Files/CMake/share/cmake-3.8/Modules/CMakeMinGWFindMake.cmake:12 (message):
sh.exe was found in your PATH, here:

C:/WinAVR-20100110/utils/bin/sh.exe

For MinGW make to work correctly sh.exe must NOT be in your path.

Run cmake from a shell that does not have sh.exe in your PATH.
 
Let's do what it says then. In Qt Creator, you have the ability to customise the PATH used for the build. In the Projects tab, go to the Build Environment section, expand the Details and find the PATH variable. Edit it so that the WinAVR-20100110 path is not in there.
Re-running CMake after that should at least make that particular error go away.
 
I'm seeing two WinAVR-20100110 paths. Which one do I remove?
 
Remember I'm not seeing what you're seeing, you need to show me things you ask about. ;)
 
2:57 AM
One of them says C:\WinAVR-20100110\bin, the other one says C:\WinAVR-20100110\utils\bin
 
CMake is complaining about the second one, so remove that. You may need the first one depending on whether your project uses anything from there, so remove just the second from the PATH and re-try.
 
Ok I removed it but it still says it doesn't recognize the .dll file. Do I need to put back the old cache in my build directory?
 
What was the value printed out for the COMMON_LIBS variable this time? Still the same or different?
 
It looked like this:
glu32;opengl32;C:/Users/Brandon/Desktop/CSC 305/icg/external/glew/lib/win32/glew32s.lib;C:/Users/Brandon/Desktop/CSC 305/icg/external/glfw/lib-mingw-w64/glfw3.dll
 
Is the file you have in your source tree at common/GLFW.cmake available publicly somewhere? I suspect the logic in there is failing to do things properly.
 
3:07 AM
Yes. It's from a github repository. In order to get all the files from this repository, I needed to clone it instead of download it.
 
Can you tell me which github project/where to find it? I want to look at that file.
 
Gimme a bit to digest that
 
k
There are also several files that are not really important since the repository has alot of different projects in it.
 
This is strange. Inside common/FindGLFW3.cmake, there is a FIND_LIBRARY(...) call to find glfw3 and it looks sane, but it seems to be giving you the .dll instead of the .lib file. The find_library() command isn't supposed to do that, so I'm wondering how it is ending up like that.
Ah, your source tree contains a pre-built glfw3.dll but no glfw3.lib, so that's unlikely to work.
Wherever you got the external/glfw/lib-mingw-w64/glfw3.dll file from, you need to also get the corresponding .lib as well.
If you add the .lib to that directory (it must match the .dll in there) then delete the CMakeCache.txt file again, the next time you re-run CMake it should find that .lib file and hopefully your project will then build successfully.
Hmm.... wait, I'm reading stuff online which says MinGW may be able to link directly to a .dll
See comment from Rolf Eike Beer near the end of this thread: cmake.3232098.n2.nabble.com/…
Are you using a reasonably new version of MinGW?
 
3:28 AM
It should be new.
 
I'm wondering if it is a 32-/64-bit problem.
 
I'm still confused about what I'm supposed to do. You're saying I need a .lib file from somewhere but it needs to match the .dll file. I don't know what that means.
 
Sorry, that may have been mistaken. It seems recent MinGW doesn't need .lib, so your .dll may be enough. Since the build is complaining about the .dll though, I'm wondering if you're trying to use a 64-bit dll in a 32-bit build or vice versa.
 
Is there any way I can tell which version I have?
 
I'm just reading a few references online. Will update in a few minutes.
Does this answer help? The depends.exe tool is definitely your friend on Windows.
At your MinGW console, the file command might also be available. Not sure if it will tell you whether the dll is 32 or 64 bit though.
 
3:46 AM
Can't seem to get that depends tool to work. It keeps saying there's been errors while processing.
 
Are you on a 32- or 64-bit version of Windows? Unlikely to be 32-bit, but have to ask.
 
64
 
Okay I think I've pieced together enough to understand what is probably happening.
You seem to be using the 32-bit mingw, but the DLL is for use with mingw-w64. Qt Creator comes bundled with the 32-bit mingw, hence what you're using, but it does not come with mingw-w64. You will need to download and install that separately yourself.
15
Q: What is the difference between MinGW, MinGW-w64 and MinGW-builds?

RomainWhat are the differences between MinGW, MinGW-w64 and MinGW-builds? And which one should I use to compile c++ 11 source code with the Eclipse IDE on a Windows 8 machine?

 
I think I might already have a MinGW-w64 installed but how do I run it with QT creator?
 
Did you get your MinGW-w64 as part of the Qt installer or did you get it separately?
 
3:56 AM
seperatley
 
Open Qt Creator's options (go to Tools --> Options). In the Build & Run area, under the Kits tab you should see the set of currently defined kits.
 
yeah I see it
 
Okay do you know which kit your project is using?
 
I believe it's called Desktop Qt %{Qt:Version} MinGW 32bit
Desktop Qt 5.9.0 MinGW 32bit
 
If so, select it in the Kits tab. Then towards the bottom, find the CMake generator line and click the Change... button at the end of that line. We just want to see what generators Qt Creator knows about for now, not change anything.
 
4:01 AM
Ok I'm seeing the generators
 
In the dialog that pops up, see what choices are available to you in the Generator combo box. If you're really lucky, you'll see the 64-bit version of minGW, but if not we'll have to figure out how to get it to know about it.
MSYS2 might also be an option, if it's there.
 
I see something called MSYS Makefiles. My minGW-64 version is called cygwin and I don't see that anywhere.
 
What do you mean by "My minGW-64 version is called cygwin"?
Ah, nevermind. I think I see what you probably have from here:
 
So I assume if I have any one of those tools installed then I have minGW-64
 
Perhaps, but I don't have access to a Windows machine to confirm, sorry.
Can you list out all of the entries in your Generator combo box?
I have to duck out for 10-15 minutes, will be back a bit later.
 
4:08 AM
Borland Makefiles
Green Hills MULTI
MSYS Makefiles
MinGW Makefiles
NMake Makefiles
NMake Makefiles JOM
Ninja
Unix Makefiles
Visual Studio 10 2010
Visual Studio 10 2010 IA64
Visual Studio 10 2010 Win64
Visual Studio 11 2012
Visual Studio 11 2012 ARM
Visual Studio 11 2012 Win64
Visual Studio 12 2013
Visual Studio 12 2013 ARM
Visual Studio 12 2013 Win64
Visual Studio 14 2015
Visual Studio 14 2015 ARM
Visual Studio 14 2015 Win64
Visual Studio 15 2017
Visual Studio 15 2017 ARM
Visual Studio 15 2017 Win64
Visual Studio 7 .NET 2003
Visual Studio 8 2005
Visual Studio 8 2005 Win64
Visual Studio 9 2008
Visual Studio 9 2008 I64
Visual Studio 9 2008 Win64
Watcom WMake
And those are all the generators I have.
 
4:23 AM
Yeah, I don't think any of those are what you are looking for.
 
So how do I get the 64 bit version in there?
 
I'm reaching the limits of how much I can help you with whats available to me. It's getting down to googling for answers now.
 
Ok so basically all I have to do is get the 64-bit version of minGW in there and it should work?
 
potentially
Although I just noticed that the only libraries in your tree for glew appear to be for Visual Studio 12 (i.e. 2013), so if you need glew then the mingw path of any flavour might not be viable.
It would seem that you might be going down the wrong path here. I explored your project a bit more and came across the development environment setup wiki page. It calls for visual studio, not minGW.
 
4:54 AM
At this point, I would recommend you follow the lab directions and grab a copy of Visual Studio community edition. If you still have issues after trying that, you may need to consult with your lab supervisor.
 

last day (14 days later) »