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 - problem compile linux (Arch / Ubuntu) #7021

Open
trigop opened this issue Jun 24, 2022 · 5 comments
Open

Qt Creator - problem compile linux (Arch / Ubuntu) #7021

trigop opened this issue Jun 24, 2022 · 5 comments

Comments

@trigop
Copy link

trigop commented Jun 24, 2022

I'm using the latest 'nightly' version and I've tested it on Arch and Ubuntu.
I'm using Qt Creator 7 (I've tested it on different previous versions, even on version 4).

I have the same problem. When I use QT to compile it crashes but it doesn't happen in the console.
When you include a library (any one) it always crashes: error: undefined reference to XXXX

Any help ?

@ludiccc
Copy link

ludiccc commented Nov 10, 2022

I'm having the same issue. It seems like Qt Creator is having a problem with boost::filesystem::path...

/home/XXXXXX/dev/openFrameworks/addons/ofxXmlSettings/src/ofxXmlSettings.cpp:76: error: undefined reference to 'ofToDataPath[abi:cxx11](boost::filesystem::path const&, bool)'
The same happens with a lot of other functions with similar calls.

@ludiccc
Copy link

ludiccc commented Nov 10, 2022

Perhaps this gives somebody a clue about this: if I do something like this:

ofImage img; string path="myImage.jpg"; img.load(path);

I get the 'undefined reference to XXXX' error. But if I use the depecrated function .loadImage(path) instead, it works fine. I still have problems with other functions in addons who are working fine in osx and window$.

@ludiccc
Copy link

ludiccc commented Nov 10, 2022

Just to clarify. I started an empty project from Qt Creator, with this code:

//--------------------------------------------------------------
void ofApp::setup(){
    img.load("mappingHelperImage.png");
}

//--------------------------------------------------------------
void ofApp::draw(){
    img.draw(0,0);
}

The compiler gave me this message:

/XXXX/test2/src/ofApp.cpp:5: error: undefined reference to 'ofImage_<unsigned char>::load(boost::filesystem::path const&, ofImageLoadSettings const&)'

@ludiccc
Copy link

ludiccc commented Nov 10, 2022

Solved!

Adding this to the .qbs file solves the problem:

of.cxxFlags: ["-std=c++17"] // flags passed to the c++ compiler

@trigop , can you confirm if this helps?

@ioadeer
Copy link

ioadeer commented Jan 31, 2023

of.cxxFlags: ["-std=c++17"] // flags passed to the c++ compiler

I was having the same issue on archlinux. Adding the flag solved the issue. Thanks.

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

3 participants