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

MacOs compilation error #1417

Closed
loewal opened this issue Sep 17, 2022 · 7 comments
Closed

MacOs compilation error #1417

loewal opened this issue Sep 17, 2022 · 7 comments

Comments

@loewal
Copy link

loewal commented Sep 17, 2022

[ 31%] Building CXX object sdrbase/CMakeFiles/sdrbase.dir/util/iot/visa.cpp.o
/Users/Loewal/Downloads/sdrangel/sdrbase/util/iot/visa.cpp:266:84: error: cannot pass object of non-trivial type 'const QString' through variadic function; call will abort at runtime [-Wnon-pod-varargs]
QString commands = QString::asprintf(control->m_setState.toUtf8(), state);
^
1 error generated.
make[2]: *** [sdrbase/CMakeFiles/sdrbase.dir/util/iot/visa.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [sdrbase/CMakeFiles/sdrbase.dir/all] Error 2
make: *** [all] Error 2

What could be the reason.....?

@srcejon
Copy link
Collaborator

srcejon commented Sep 17, 2022

Try:

QString commands = QString::asprintf(control->m_setState.toUtf8(), state.toUtf8());

@loewal
Copy link
Author

loewal commented Sep 17, 2022

Changed the error-line...
[ 21%] Building CXX object sdrbase/CMakeFiles/sdrbase.dir/util/iot/visa.cpp.o
/Users/Loewal/Downloads/sdrangel/sdrbase/util/iot/visa.cpp:266:70: error: cannot pass object of non-trivial type 'QByteArray' through variadic function; call will abort at runtime [-Wnon-pod-varargs]
QString commands = QString::asprintf(control->m_setState.toUtf8(), state.toUtf8());
^
1 error generated.
make[2]: *** [sdrbase/CMakeFiles/sdrbase.dir/util/iot/visa.cpp.o] Error 1
make[1]: *** [sdrbase/CMakeFiles/sdrbase.dir/all] Error 2
make: *** [all] Error 2

@srcejon
Copy link
Collaborator

srcejon commented Sep 17, 2022

Sorry, that should be:

            QString commands = QString::asprintf(control->m_setState.toUtf8(), state.toUtf8().data());

@loewal
Copy link
Author

loewal commented Sep 17, 2022

Thanks Jon,
That was it indeed!

srcejon added a commit to srcejon/sdrangel that referenced this issue Sep 17, 2022
@srcejon
Copy link
Collaborator

srcejon commented Sep 17, 2022

Thanks for trying the fixes.

@loewal
Copy link
Author

loewal commented Sep 17, 2022

Happy to early Jon,

/Users/Loewal/Downloads/sdrangel/plugins/feature/remotecontrol/remotecontrolgui.cpp:1008:61: error: cannot pass object of non-trivial type 'QByteArray' through variadic function; call will abort at runtime [-Wnon-pod-varargs]
formattedValue = QString::asprintf(format.toUtf8(), value.toString().toUtf8());
^
1 error generated.
make[2]: *** [plugins/feature/remotecontrol/CMakeFiles/featureremotecontrol.dir/remotecontrolgui.cpp.o] Error 1
make[1]: *** [plugins/feature/remotecontrol/CMakeFiles/featureremotecontrol.dir/all] Error 2
make: *** [all] Error 2

Solution:

1008 formattedValue = QString::asprintf(format.toUtf8(), value.toString().toUtf8().data());

ok?

Compiled well after above fix at line 1008

f4exb added a commit that referenced this issue Sep 17, 2022
@srcejon
Copy link
Collaborator

srcejon commented Sep 18, 2022

Solution:

1008 formattedValue = QString::asprintf(format.toUtf8(), value.toString().toUtf8().data());

ok?

Yep, thanks. I'll add a patch for that too.

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