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

Qt Creator Mac: Error parsing ofApp.qbs #5572

Closed
c-mendoza opened this issue Apr 24, 2017 · 14 comments
Closed

Qt Creator Mac: Error parsing ofApp.qbs #5572

c-mendoza opened this issue Apr 24, 2017 · 14 comments

Comments

@c-mendoza
Copy link
Contributor

c-mendoza commented Apr 24, 2017

The error is:

(...)/openFrameworks/libs/openFrameworksCompiled/project/qtcreator/ofApp.qbs:35: error: TypeError: Result of expression 'CORE.includes' [undefined] is not an object.

Which means that no apps can be compiled. It seems like the problem began in [this commit].(62346e0)

I would love to help, but unfortunately I'm new at Qt Creator.

c-mendoza added a commit to c-mendoza/openFrameworks that referenced this issue Apr 25, 2017
Changes to qbs files so that Qt Creator can compile again in macOS. Only tested in 10.11, someone should test in Linux.
arturoc added a commit that referenced this issue Apr 25, 2017
@arturoc
Copy link
Member

arturoc commented Apr 25, 2017

can you check if my last commit fixes this?

@c-mendoza
Copy link
Contributor Author

It doesn't parse out of the box. It complains about minimumOsxVersion not being a string, but that is solved by just putting it in quotes (line 51 in openFrameworks.qbs).

After fixing that, compilation and linking completes, but the binary produced is called "($PRODUCT_NAME).app" (literally... the variable name does not expand), and the .app produced is not runnable (it has the strikethrough on its app icon).

@c-mendoza
Copy link
Contributor Author

Also, neither libfmodex.dylib nor the Resources folder are copied to the app bundle.

@bakercp
Copy link
Member

bakercp commented Apr 26, 2017

I now have this problem with the latest commit:

example__master__-_qt_creator

@Daandelange
Copy link
Member

I figured out that's because of newer qt versions that now depreciate cpp.minimumOsxVersion in favour of cpp.minimumMacosVersion. Also it has to be a string, not a number. (add apostrophes around the value)

Still that does not resolve the $PRODUCT_NAME error... ( usingQt Creator 4.3.1, Based on Qt 5.9.1 (Clang 7.0 (Apple), 64 bit )

@bakercp
Copy link
Member

bakercp commented Aug 14, 2017

When I apply the fixes mentioned above by @Daandelange, it begins to compile for me and I get
ofconstants_h___volumes_superfasthd_openframeworks_libs_openframeworks_utils___testqt___master__-qt_creator_and_qt_creator_mac__error_parsing_ofapp_qbs issue__5572 _openframeworks_openframeworks

I also get the PRODUCT_NAME warnings. I'm using the same version of Qt Creator as @Daandelange above.

@bakercp
Copy link
Member

bakercp commented Aug 15, 2017

Just to go further, unordered_map should be included with c++11, which is set in ofApp.qbs and openFrameworks.qbs and those vars are defined in modules/of/of.qbs, but it doesn't seem to be picking up the correct c++11 value ...

    cpp.cxxStandardLibrary: of.coreCxxStandardLibrary
    cpp.cxxLanguageVersion: of.coreCxxLanguageVersion

@bakercp
Copy link
Member

bakercp commented Aug 15, 2017

Just a few more notes on this - I just wanted to make sure the variables were being passed down the line to the application and it appears that they are ...

So, not sure why unordered_map in particular is causing the error.

c___code_model_inspector_and_ofapp_qbs___volumes_superfasthd_openframeworks_libs_openframeworkscompiled_project_qtcreator___testqt___master__-_qt_creator

@Daandelange
Copy link
Member

Daandelange commented Aug 17, 2017

Hmm, weird, I haven't got anything like your errors. Maybe there's something with lib STD missing ? Did you set the qt kit's compiler to use /usr/bin/clang++ ? (sometimes I had to reconfigure a kit switching from other QT Creator versions (4.1).

Another side note: The errors shown @bakercp 's image 26th April referring to (PRODUCT_NAME) can partially be fixed pressing reset here (bottom right):
PRODUCT_NAME error Qt

Further more, I can add that at a given moment I had to manually add curl to the linker flags, using the following lines in my testQt.qbs : (also see screenshot below)

        // general compilation fixes for OF0.9 + OSX 10.12
        Properties {
            condition: qbs.targetOS.contains("osx")
            of.linkerFlags: outer.concat([
                '-L'+Helpers.normalize(FileInfo.joinPaths(sourceDirectory,"../../../libs/curl/lib/osx/")),
                '-lcurl'
            ]);
        }

Then I get it to build and compile but the packaging / deploy /run step fails. The app packages in different sub dirs and PRODUCT_NAME still appears in the "Generated files". See screenshot below.
Weird OF packaging in Qt

I'm not sure this is still related to the same (initial) issue.
Moreover we're using an unsupported Qt version while this is the only version I get the current OF master to compile with.
But anyways, it would be great to get Qt working again on current master. :)

@bakercp
Copy link
Member

bakercp commented Aug 18, 2017

OK, a few updates from here to get it to match with yours:

  1. With 4.3 installed, delete my ~/.config/QtProject folder.
  2. Run openFrameworks/scripts/qtcreator/install_template.sh script.
  3. Open Qt Creator 4.3.
  4. Open preferences and make sure my default

The automatically detected defaults that DON'T work ...

preferences

The updated version that does compile ...

preferences

  1. Then create a new project.
  2. Modify the project.qbs to include the curl linker / include flags block as you noted. This should be added to the base App qbs, I suspect.

Then compile. Everything compiles and I get to the same point as you do with the mis-named $(PRODUCT_NAME) executable and the fmod dynlib is not copied.

Right now my main problem is understanding the mechanics of how QT qbs build system works -- I'm unable to find any references to $(PRODUCT_NAME).

Additionally the release target fails -- I believe that it fails because it can't find 64bit release for libopenframeworks.a. But that's just a first guess.

@bakercp
Copy link
Member

bakercp commented Aug 18, 2017

P.S. I'd also really like to get this working because I'm teaching OF in all of my courses this fall and would like to use Qt Creator if at all possible. :)

@bakercp bakercp mentioned this issue Aug 18, 2017
5 tasks
@bakercp
Copy link
Member

bakercp commented Aug 18, 2017

Also, I'm accumulating fixes here:

#5728

Please feel free to add to that PR / checklist. etc.

@bakercp
Copy link
Member

bakercp commented Dec 19, 2017

QT Creator 4.5 is now working on macos 10.13 with the latest master branch. Closing this. Thanks @arturoc

@bakercp bakercp closed this as completed Dec 19, 2017
@arturoc
Copy link
Member

arturoc commented Dec 19, 2017

It was actually @i-n-g-o who fixed this a while ago in #5813

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

Successfully merging a pull request may close this issue.

4 participants