Mac OSX 10.7 Lion Audio Unit Effect template Failing to compile - c++

I just upgraded to Mac OSX 10.7 Lion. First of all, I hate the new spaces, I dislike not being able to access any directories deeper than my user directory, but lets get to the question.
I develop Audio Unit Plugins. I have a few whose code is compiling and working perfectly (they're even released for sale) in XCode 4.0.
But after upgrading to Lion and XCode 4.1, there are now two major compiling failures in the main audio unit .cpp file (mine is named TestAU.cpp) where the Process method resides. Below is the code that fails.
#include "TestAU.h"
COMPONENT_ENTRY(TestAU) // FAIL c++ requires a type specifier for all declarations.
TestAU::TestAU(AudioUnit component) : AUEffectBase(component) // FAIL Expected ';' after top level declarator.
{
CreateElements();
Globals()->UseIndexedParameters(kNumberOfParameters);
SetParameter(kParam_One, kDefaultValue_ParamOne );
#if AU_DEBUG_DISPATCHER
mDebugDispatcher = new AUDebugDispatcher (this);
#endif
}
I'm having trouble solving this failure. Any help would be great. Thanks.

Search in the Xcode documentation for Technical Note TN2276 for instructions on updating an existing audio unit for Lion.
You have to replace
COMPONENT_ENTRY(TestAU)
with
AUDIOCOMPONENT_ENTRY(TestAU, Filter)
But there is a little more so read the document.
Edit:
BTW regarding your comment about not being able to access all directories you can find many locations in the Go menu of finder.

Related

Qt creator could not parse stddef.h --> incorrect code completion and highlighting

I am developing a QT GUI for my application using QT Creator (4.11.0).
Recently, our IT updated my OS to Ubuntu 20.04 (from 18.04) - maybe the error is related to that.
I have not touched to project in some month but yesterday wanted to continue developing it.
However, within the IDE there are now thousands of errors highlighted at almost every line of my code. (with highlighted I mean that there is this red background and a red dot beside the line number)
On the very top, it says:
Warning: The code model could not parse an included file, which might lead to incorrect code completion and highlighting, for example.
cstddef:50:10: fatal error: 'stddef.h' file not found
...
The errors that are listed in the IDE are very wired like:
type `QMainWindow`is not a direct or virtual base of `MainWindow` (my class is called `MainWindow`)
I'm pretty sure it is not related to my code:
the code compiles and works fine - it is really just the IDE that is highlighting errors at every line of my code.
I have the same code on a Windows Computer and there no errors are listed in the IDE.
even if I start a brand new QT Widget project the errors appear within the template code provided by the QT Creator.
Since the GCC version changed with the update of the OS, I thought maybe I have to define a new KIT but this also did not help.
Is there anything I can do to fix the issue?
Do I have to reinstall the QT Creator?
I know, pictures are not very well-liked but here I think it might help to understand what I mean with "IDE is highlighting errors":
1. First
~/.profile :
CPATH="/usr/include/clang/10/include:$CPATH"
C_INCLUDE_PATH="/usr/include/clang/10/include:$C_INCLUDE_PATH"
CPLUS_INCLUDE_PATH="/usr/include/clang/10/include:$CPLUS_INCLUDE_PATH"
export CPATH
export C_INCLUDE_PATH
export CPLUS_INCLUDE_PATH
maybe /usr/include/clang/10/include see in you file system.
2. Second
Logout / login.
3. Third
Specifying Build Settings (Projects -> Build -> in every config build) in Build Environment section: [unset] CPATH, C_INCLUDE_PATH and CPLUS_INCLUDE_PATH
or [edit] replace this variable with the necessary values
I fixed this issue by sudo apt install clang-8.
Source: https://bugs.launchpad.net/ubuntu/+source/qtcreator/+bug/1890434

SwiftUI app crash on run in macOS environment [duplicate]

I build an app with the 2nd beta of Xcode 11, using SwiftUI, and everything worked completely fine, but now, with the 3rd beta, the app isn't even build. I get errors like "Use of undeclared type 'View'", "Unknown attribute 'State'" etc. What can I do? Is the problem in my code or is it just a bug?
The problem is when I'm trying to build the app to run on my Mac (with UIKit for Mac)
#State var score = 0
The error is "Unknown attribute 'State'"
struct ContentView : View {
/*...*/
}
The error is "Use of undeclared type 'View'"
Got same issue on Xcode 11.2. Found out that the reason was that somewhere in same module I declared protocol State {}. This breaks compiler without any reasonable errors.
This is from the Xcode 11 Beta 3 Release Notes.
Known Issues
Xcode 11 doesn’t support working with SwiftUI in an iPad app brought to macOS. (41416222, 51201699)
I downloaded the Xcode 11 Beta 3 myself just to confirm the errors you mentioned, and I had the same issues when trying to build a SwiftUI project for Mac.
I would suggest going back to using Xcode Beta 2 if possible. Unfortunately, Apple doesn't provide download links to previous betas, so hopefully you have a Time Machine backup or Beta 2 still installed on your computer. Otherwise, you might be out of luck until the next beta is released.
I was getting the same "Unknown attribute 'State'" issue in Beta 5. But I was doing "#state" and not "#State". Case matters. It's hard to notice because both ways are shown as purple.
If you are doing a Kotlin multi-platform project, check if your shared module has a component named "State".
Instead #main, please replace #UIApplicationMain.
I've attached screenshots.
https://prnt.sc/vimvwn
I got the same error while trying to compile a Swift project created with Xcode 13 on Xcode 11. The problem was that the newer version uses the SDK 12.1 while the older one uses the SDK 10.15. To let the project compile on the older Xcode/SDK I just performed these steps:
remove the #main attribute from the swift source code
add Cocoa.framework in the section Frameworks, Libraries, and Embedded Content
add a file named main.m to the project (no bridge header) with this content:
#include <Cocoa/Cocoa.h>
int main(int argc, const char * argv[]) {
return NSApplicationMain(argc, argv);
}

Is it possible to use Kotlin Native on macOS 10.12?

I'm trying to port a simple Go macOS application over to Kotlin Native. After struggling with various errors I decided to take a step back, and have a look at the official examples provided with Kotlin Native.
I found a basic OpenGL example here:
https://github.com/JetBrains/kotlin-native/tree/master/samples/opengl
But so far I haven't been able to get this to compile.
I tried downloading the complete sources for Kotlin, but that wont build. I followed a few suggestions generated at build time, including the change to 'ignoreXcodeVersionCheck' and downloading prebuilt binaries for the compiler, but at this point I'm wondering if this just isn't supported by my environment? I do understand that this is all experimental.
I've attached a sample of errors below, but I'm not sure whats relevant.
Question: Does anyone else have this setup / environment working please? can I expect to get it working?
macos 10.12.4, kotlin 1.3.11, xcode 8.2.1
.konan/dependencies/clang-llvm-6.0.1-darwin-macos/include/c++/v1/cmath:551:28: error: expected a qualified name after 'typename'
_LIBCPP_CONSTEXPR typename enable_if<is_floating_point<_A1>::value, bool>::type
.konan/dependencies/clang-llvm-6.0.1-darwin-macos/include/c++/v1/cstddef:44:15: fatal error: 'stddef.h' file not found
#include_next <stddef.h>
A problem occurred evaluating root project 'kotlin-native-master'.
expected Xcode version 10.1, got 8.2.1, consider updating Xcode or use "ignoreXcodeVersionCheck" variable in konan.properties
kotlin-native-master/runtime/src/main/cpp/ObjCExportErrors.mm:73:23: error: no type or protocol named 'NSErrorUserInfoKey'
NSMutableDictionary<NSErrorUserInfoKey, id>* userInfo = [[NSMutableDictionary new] autorelease];
.konan/dependencies/clang-llvm-6.0.1-darwin-macos/include/c++/v1/cmath:313:9: error: no member named 'signbit' in the global namespace
using ::signbit;
I did manage to get a "hello world" working under the above environment, but I have given up with the OpenGL stuff. I cant update my environment currently, and I guess this issue doesn't affect many people. So I'm going to close it with this 'answer'.

Where is "nvinfer.h" from tensorrt located?

I have been trying to compile a basic tensorRT project on a desktop host -for now the source is literally just the following:
#include <nvinfer.h>
class Logger : nvinfer1::public ILogger
{
} glogger;
Upon running make, though, I receive the following message:
fatal error: nvinfer.h: No such file or directory #include <nvinfer.h>
The error is correct, too - I used locate to try to find it, but there's nothing on my machine that matches. I followed the install instructions for desktop installation of TensorRT 2.1 as described here: https://developer.nvidia.com/nvidia-tensorrt-download
So my question is, does anyone know where nvinfer.h is supposed to be? In other words, am I missing a needed package that contains it, or did I miss something else that's essential?
Small addendum: one thing I noticed is that libgie1 is not installed, and it was not included as a debian with the provided TensorRT download like the other packages such as gie-dev were.
Before using locate, if you recently added new files is a good practice to run sudo updatedb, if the file is on the pc you should see it after.
Anyway googling a bit it looks like the header your looking for is NvInfer.h, caps matters.

playing with GCC 4.6 on windows

I am very pleased to find out that GCC 4.6 supports the range-based for loop. I found an experimental release of MinGW 4.6 on xvidvideo.ru, is that a well-known, reliable website? What other options do I have (besides compiling myself from source code)?
I wanted to try out GCC 4.7 using the latest Code::Blocks under Windows 7.
Here's how I did it for myself, YMMV:
I downloaded the latest Equation GCC file at:
ftp://ftp.equation.com/gcc/ and installed it under the directory C:\gcc\ on my local machine. The installer makes the necessary changes to the path environment variable. Logging off and on will pick them up.
I downloaded the Code::Blocks latest nightly build at: http://forums.codeblocks.org/index.php?board=20.0
and followed the setup instructions.
After following the setup instructions (including about the needed DLL files), and starting C::B for the first time;
I chose 'GNU GCC Compiler', and 'Set as default' for the 'Compilers auto-detection' window.
Under the 'Settings > Compiler... > Compiler settings' tab:
I ticked the 'Have g++ follow the coming C++0x ISO C++ language standard [-std=c++0x]' checkbox on.
Under the 'Settings > Compiler... > Toolchain executables' tab:
I changed the 'Compiler's installation directory' entry field to C:\gcc\bin\.
I changed the names of these files physically located in the C:\gcc\bin\ directory
i686-pc-mingw32-gcc.exe -=to=- mingw32-gcc.exe
i686-pc-mingw32-g++.exe -=to=- mingw32-g++.exe
make.exe -=to=- mingw32-make.exe
to match the listed name requirements in Code::Blocks. You can simply browse to set the correct files (I just personally preferred renaming to match C::B's entries).
If everything went correctly, you should be able to create this program:
#include <iostream>
#include <vector>
int main() {
using namespace std;
vector<int> my_vec = { 1, 2, 3, 4, 5 };
for (auto x : my_vec) {
cout << x << endl;
}
}
and run it OK under Code::Blocks with F9.
Thanks to everyone for all the excellent work put into bringing this great new language to us. Happy C++0x computing!
Bud Alverson
(sorry for the very basic nature of this post) :)
I'm not really familiar with the site you linked as it's in Russian. The only other place I've found that offers current snapshots of GCC's build is from Equation Solution. I downloaded gcc4.5.1 from there and it's been working fairly well for me. I haven't tried the 4.6.x release yet however. Rumor has it that gcc 4.6.x is slower than its predecessors.
Please do report back what kind of results you're seeing if you do decide experimenting. I'm curious about what improvements they've done in the 4.6.x series.