Qtcreator : msys2root detection failure

#1

can someone help me with this issue : https://github.com/openframeworks/openFrameworks/issues/6333

or can some one guide me through set path directly in openframeworks QT plugin , as i set paths multiple times but no success always getting same error

> warning: error : your PATH is incorrect. Please make sure that {MSYS2ROOT}\mingw32\bin;{MSYS2ROOT}\usr\bin is at the beginning of your PATH
warning: Product 'app2' had errors and was disabled.
warning: Error while handling product 'openFrameworks':
 warning: Product 'openFrameworks' had errors and was disabled.
#2

Hello zack1

Welcome to the forum :grinning:
There should be some extra logs in the ‘general messages’ panel (or equivalent) that should tell you the PATH QT is using.
I found out that QT may be forcing it’s own value of PATH.
Could you post these ?

#3

thanks for welcoming :slight_smile:

the general messages tab is blank only the issues tab have 6 messages

#4

issues tab

#5

The message is thrown because :

  • %MSYS2ROOT%\mingw32\bin doesn’t appear in PATH
  • %MSYS2ROOT%\usr\bin doesn’t appear in PATH
  • %MSYS2ROOT%\mingw32\bin appears after %MSYS2ROOT%\usr\bin in PATH

Could you try this simble qbs file (replace N:\openFrameworks as required)

import "N:/openFrameworks/libs/openFrameworksCompiled/project/qtcreator/modules/of/helpers.js" as Helpers

Project{
    property string of_root: 'N:/openFrameworks'
    property string msys2_root: {
        console.error("MSYSROOT =" +Helpers.msys2root() );
        return Helpers.msys2root();
    }
}

and post the result ?

#6

am new to openframeworks its my first time not familier with it , can you tell me where to put you code so that i can run it
these gbs files already have code in them

thanks

#7

Just replace your the test2.qbs file with the provided content (Save test2.qbs to revert after the test !!)

#8

hmmmm i did but when i save it openframeworks folders disappear on top left , and not print to console

#9

This is normal. The objective of this qbs was to have the PATH printed in the issues.
And from what I can see it is incorrect.
%MSYS2ROOT% should have been replaced by the value defined in the MSYS2ROOT environment variable.
Looking back at the issue in GitHub and the screenshots :

  • You shoud define MSYS2ROOT not %MSYS2ROOT%
  • You should not have curly braces {} around %MSYS2ROOT% in your PATH definition. It should be %MSYS2ROOT%\mingw32\bin; instead of {%MSYS2ROOT%}\mingw32\bin

Explanation : in Windows the %VAR% syntax is used to expand the variable to its current value.

PATH = %MSYS2ROOT%\mingw32\bin; %MSYS2ROOT%\usr\bin; 

will expand to

PATH = c:\msys64\mingw32\bin; c:\msys64\usr\bin; 
#10

hmmmm ya i had removed braces in 2nd screen shot on github issue page i shared

its bit strange why its not working

let me try : c:\msys64\mingw32\bin; and c:\msys64\usr\bin; directly to see if it work or not

#11

hmmm no success :frowning: any idea to over write this path in code of openframework

currently system paths variables :

#12

and QT ide output

#13

i did test it in cmd they are resolving there correctly

sorry hide my pc name as recently some vulnerabilities discovered in windows RDC

#14

This is really a PATH problem, not an openFrameworks problem.
May be there is a conflicting software.

in a windows command prompt (type cmd in windows search):

where find

should return

c:\windows\system32\find.exe
C:\msys64\usr\bin\find.exe

If we have something else we may have a conflict (may be with your GnuWin32installation ?)
I’ll try to write a minimal small batch file to start QtCreator with the correct path.

#15

hmmmm where find command in cmd return

C:\Windows\System32\find.exe
C:\Program Files\Git\usr\bin\find.exe

should i remove git

#16

I think Git is useful…
You can try to save the following in a batch file (testQTOF.bat)

setlocal

set MSYS2ROOT=c:\msys64
set PATH=%MSYS2ROOT%\mingw32\bin;%MSYS2ROOT%\usr\bin;c:\windows\system32;c:\windows

set CREATOR=C:\Qt\Tools\QtCreator
%CREATOR%\bin\qtcreator.exe

That should launch QtCreator with a minimal PATH

1 Like
#17

ya thanks :slight_smile: it worked

i have one Question , i have QT widgets application so am wondering can i used openframeworks libs in that widges app or not , i would like to use Serial and Ardunio libs of openframeowrks in it

#18

Cool glad it worked. Adapt the PATH as needed.
Could you change the title of the issue you’ve opened to something like “Qtcreator : msys2root detection failure”

Not sure about this one.
May this this post may help.

1 Like