Cocos2dx function definition for CREATE_FUNC not found - macros

There is a macro in cocos2dx called CREATE_FUNC, and this macro calls my game, but for some reason, it says it is not found.
Without 1CREATE_FUNC1 macro my scene init function won't work as far as I know, and I couldn't find any way to make this macro work.
When I go to definition and declaration, there seems to be no problem with this macro, it is well defined actually.
I tried to make another cocos2dx project and move everything old to the new project but surprisingly the issue was still going on.
I may have caused a problem by doing ctrl+r to rename something and renamed something else in the engine by mistake.

Related

Remote Swift Package: Xcode won't pause at this breakpoint because it has not been resolved [duplicate]

Shortly after updating to Xcode 13.2.1 I started seeing some weird behaviour of breakpoints. When I run an app (in a simulator) some of my breakpoints change their look and turn to dotted blue outlined. Xcode does not stop execution at these breakpoints although code has been compiled, loaded and executed. I checked it in Console by adding some prints.
When I hover over breakpoint Xcode shows a message:
Xcode won't pause at this breakpoint because it has not been resolved
Resolving it requires that:
The line at the breakpoint is compiled.
The compiler generates debug information that is not stripped out (check the Build Settings).
The library for the breakpoint is loaded.
All trivial solutions like reloading, reapplying breakpoints have not helped.
Did anybody else see something like this? Is there a way to solve it?
Screenshot for reference:
Ok, so in my particular case rebooting laptop has helped. All breakpoints are now good. But it would still be nice to know the cause of the problem.
Make sure that the file in which you are adding breakpoint is having correct target set in target membership.
Click on .m file in which you want to add breakpoint.
Select the file inspector.
Check if you have selected correct target for that file or not (check below image).
What worked for me, was to select the files, delete them with - Delete>Move To Trash - and then drag the files back from the trash to the project.
In my case the issue was happening, because class was not added to the target, which I was trying to build.
For my case somehow the code path was never invoked and very likely considered as dead code. The same thing applies when not adding the file to the target that you want to debug.
This can be the case or somehow debugger might not be able to resolve your breakpoint. The first thing in this case should be cleaning derived data and any caches.
But instead of recloning your repo you can just delete breakpoint config from the location described in this answer
In Xcode 14 the problem is much more prevalent and "consistent". I figured out one pattern where it always fails and how to mitigate it.
If you have a final class then breakpoints set on or inside a private method will have that issue. If you remove private from the method or final from the class the breakpoints will get resolved properly.
If tried everything and nothing worked I suggest the following:
Reclone your repo
This is what worked for me.
I just passed through this problem and the solution for me was recreating the files.
Note: The ones I was trying to originally breakpoint on were copied from another project. When I created the new files, even though their Identity and Type looked just the same (target membership, encoding, paths), for some reason breakpoints started to work again.
Note 2: When copying and pasting code to your new files (if done manually), migrated breakpoints - created in the older file - will continue to fail. Only the ones created in this new file will work properly.
Hope it helps.
My case
Working on framework development. Framework is injected into the sample app for development/run purpose. Breakpoints inside the framework won't work.
Fix
Just removing xcframework in sample app and replacing with framework.
Reason
xcframework are precompiled outside of the app, so lib isn't compiled when project is built and that's why breakpoints doesn't work.
For me reboot the Xcode, and it works~

Xcode 9.1 Refactoring not available

The refactoring menu in Xcode 9.1 is completely greyed out. I wanted to extract a method from existing swift code and got the following screen:
Do I have to enabled something special to get access to the new refactoring features?
Try cleaning your Xcode. Also try clearing out derived data and restart Xcode.
Clean Build --> (Command-Option-Shift-K)
Delete DerivedData folder in ~/Library/Developer/Xcode/DerivedData
Refactor option hides if you select version editor.
Thanks #paul
I had to change to the Active Schema to the one that matched the Target Membership of the file I was editing.
In other words:
In Project Navigator, select the file you're editing
Show the Inspectors panel on the right
Show the File Inspector
Observe the Target Membership values and set the Active Schema (at the top, by the Build and Stop buttons) to match.
Select text, right click, select Refactor
Observe all the Refactor options are now enabled.
This happened to me too and I could not find anything on it so...
My first post is born.
Mike T. hit on a small portion above (incomplete syntax).
Nothing is wrong. Xcode is amazing! It seems the Refactor/Extract feature is pretty smart. The option is not available if it does not make sense to extract a method.
It may not make sense to extract a method for many reasons. Xcode disables the feature when it encounters them in the selection. A few that I noticed are:
variable declarations
a solitary print statement
continue statements in the selection but I don't include the for loop container. (i'm impressed)
my guess is that there are a bunch of conditions...
Small thing for me was that the code I was trying to access was inside a closure so when I was selecting it and right clicking to Extract to a Method, it was greyed out. removing self on both instances, I could then select both lines to then extract to method
self?.activityIndicator.stopAnimating()
self?.activityIndicator.removeFromSuperview()
Both lines were inside a closure for a UIAlertAction. So removing self allows you to extract to a method in this case. Then just call self on the extracted method inside the closure and it should work.
self?.hideSpinner() //extracted method name
As other posters have already said, its best to make sure you're able to refactor what you want by selecting the right code.

What is Mono Behaviour?

I'm getting this message multiple times when I try to run my game:
The referenced script on this Behaviour is missing
For some reason, all my prefabs are missing a script that dictates something called their 'Mono Behaviour':
What is the Mono Behaviour component, and what does it do?
How can I fix this error? I can click the little target circle to bring up all my scripts, but that just gives me all of the scripts that I've written:
So I don't really know how to replace my missing Mono Behaviour script... Maybe if I knew what it was I could have a clue how to fix it.
I probably moved something. But how can I select the Mono Behaviour script (whatever it is) if the target just shows me my scripts?
Update
I've moved some assets in the project window, but not via the OS (Finder/Explorer) so why is this happening?
Also I am told that Mono Behaviour is a script I've applied...
Don't really get this...isn't the script component a reference to a script?
This happens when you have a script attached to a component, but then the script has been deleted (or its reference has lost in another way, such as the meta file being modified).
If you don't know which script used to be there, just delete those Mono Behaviour components.
MonoBehaviour is the Base Class of all scripts that you want to attach to a GameObject. I am not sure how you managed to create a MonoBehaviour Component with a script missing. What you normally do is write your script and then just drag it from the project view onto the GameObject you want it attached to.

Why is IntelliJ highlighting errors in one project, but not another?

I'm using IntelliJ 13 and the Scala plugin. In one project if I make an obvious type error I get a visual indication, like this:
But I just started a new project and a similar thing is not highlighted, even after I compile.
I'm giving a presentation on some Scala code and I'd like it if the type errors highlighted like in the first one, but I have no idea where the setting is.
One reason could be that the level of highlighting is set to a lower setting. Check your lower right corner for a button which adjusts this setting with a slider. It looks like (at least to me) a policeman face :)
Another thing is that you might not have declared what additional languages you're using besides the primary one. You can configure this in the project settings.
Also if you are using a tool to build a project (like Maven for example) try rebuilding or reimporting your project.
edit: One last thing. Make sure IDEA isn'currently reindexing or running some background tasks, this really messes up code correction.

AndEngine classes - problems with opening declarations: Source not found

Im working with AndEngine in eclipse (which is a 2d physics/tiling engine)
Everything works fine yet when i try to open declaration to classes I get Source not found
I can Change Attached Source...
but i wouldnt know what to change it too...
is there a way i can download the classes so i can view them on my computer (so far im stuck with googling each class and it slows down my progress immensely)
Is this suppose to be happening?
Can i somehow solve this problem or get my hands on some good documentation.
I fixed the problem by extracting the jar file with the JD GUI program. Then i simply opened the declaration and then clicked change attached source... and pointed it to the file (which is still zipped it doesnt work if you unzip it) Everything works well now :D