Compilation errors setting up Box2D with Cocos2d in Xcode - xcode4

I notice several other people have had similar problems, however this is a bit strange...
I have a new install of scode 4.2 and the most recent cocos2d from a few weeks back. I have changed all files that include Box2D to the C++ .mm file extension. I have also set a user header search path for appName/libs**.
When I compile either b2BroadPhase.cpp and/or b2CollideCircle.cpp are missing, or even more rare, Box2d.h is missing. I have checked and all of these files are in the correct location in my applications directory.
Can anyone tell me why the files are not being found and why the number of files missing is randomly fluctuating?
EDIT:
Ok, so I obviously don't understand Header Search Paths... Are they designed to point towards folders that wouldn't normally be searched? If I add a Header Search Path then I get 200+ errors saying box2D files cannot be found. If I don't add a header search path I get 1-3 errors saying files cannot be found.

Your issue is that you have set the "User Header Search Path". However, Box2D requires you to specify the path in the "Header Search Path" build setting. This is because Box2D is using C++ style angle bracket include statements:
#include <Box2D/Dynamics/b2Body.h>
If that should not solve the (or all of the) problem(s), check this:
If you assume the same Box2D path as it is in cocos2d-iphone:
cocos2d-iphone/external/Box2d/Box2D
Then your Box2D Header Search Path must point to
cocos2d-iphone/external/Box2d/Box2D
You may have specified the "Box2d" folder instead of the "Box2d/Box2D" folder. That is also a common mistake.

Your header search paths are most likely wrong. Would you mind posting what it is?
If your Box2D folder is in your Xcode folder (look in finder), it should be as simple as this:
$(SRCROOT)
or
$(SRCROOT)/Box2D

My problem was that I was having an #import "Box2D.h" statement on a file with a ".m" extension instead of ".mm" .. Changing the file extension (select file, press enter, add extra "m") got rid of all the box2d errors.
Hopefully this helps someone else!

Related

Saving <file.php>: Running 'phpcbf' Formatter (configure)

I've recently set up WP coding standards in VSCode by following https://www.edmundcwm.com/setting-up-wordpress-coding-standards-in-vs-code/.
With this setup files aren't getting saved and shows this message at the bottom right:
Saving ‘plugin.php’: Running ‘phpcbf’ Formatter (configure).
The only way to save is to press Cancel when this appears.
Any idea?
Please use which phpcs & which phpcbf to find the paths.
which phpcs
e.g. "C:\Users{Your username}\AppData\Roaming\Composer\Vendor\bin\phpcs
which phpcbf
e.g. C:\Users{Your username}\AppData\Roaming\Composer\Vendor\bin\phpcbf
once you find the paths to the executables, open your vscode json settings and add double check that the executable settings for phpcs & phpcbf match the paths.
Examples:
"phpcs.executablePath": "C:\Users\{Your username}\AppData\Roaming\Composer\Vendor\bin\phpcs.bat",
"phpcbf.executablePath": "C:\Users\{Your username}\AppData\Roaming\Composer\Vendor\bin\phpcbf.bat",
I think this issue is pretty widespread despite the lack of answers in this thread. Setting the paths as above does not fix things. For me, this happens when saving a file and there is nothing for the formatter to fix.
There is an open pull request for this issue that has been open for over a year now.
A fork of the project has popped up that specifically fixes this issue. Look for phpcbf in VSCode and find the one by Simone Baldini.
Try installing that to see if it resolves the problem.

Scene Builder isnt starting in Netbeans cause of non-English Letters in Path

my Problem is the follows. My Notebook is owned by my employer, so i cant really change my Username. I have Admin rights whatsoever, but he made my Username with an 'ö' in it.
That really messes up most things that come up with parsing Paths.
So right now. After hours spent, i finally made JavaFX in NB to work. Not with a build-up jar, but at least in the IDE. For the Jar i gave up for now.
But the Scene Builder just throws a FNF-Exception. The Path shown is the correct one (generated by the IDE), but the "ö" is awfully missplaced. So i think it cant read the Path. NB is started with UTF-8 and every code i wrote so far i managed to do a workaround for that.
But not for this.. i dont know where i should specify a charset for that, if its even possible. i cant change the Path, so i have to get this to work.
Any hints?

R Working Directory "cannot change"

Working Direcotry Cannot Change It's saying that there's an error in my code but I've tried it multiple times with countless variations on the code (I wiped my past attempts sorry) and it refuses to change the working directory. It won't change to other things either so it's not just this folder. What's the issue?
This probably means that the directory you want to change to does not exist. From the image I think you are using Windows, in which case the proper path to the directory would look like this:
setwd("C:/Users/$USER$/Desktop/r-novice-inflammation"
Change the $USER$ to your own username and it should work.
Paths always start with the letter of the hard drive in Windows. The easiest way to find the proper path to a directory is, in my opinion, to right click on the folder and look for the "Location" in properties. The IDE RStudio has a menu which you can use to change the working directory, which may be easier than using vanilla R.
The exception is setwd("~") which links to the Documents folder of your current user (i.e. C:/Users/$USER$/Documents). Based on the comments I realised that other commands such as setwd("..") (i.e. one folder up in the hierarchy) can be combined with ~ which explains what you are doing. In this case the following works for me:
setwd("~/../Desktop/")

Missing performance-now.map in bower-collide folder

What could be the reason of this error?
It doesn't exist before.
Chrome is trying to load Source Map file for your minified performance-now.js file. Why he does that? Well, if you look at performance-now.js file you definitely will see the comment like
//# sourceMappingURL=performance-now.map
This is not an actual error, at least for production, because loading of Source Maps takes a place only when DevTools are open. So you can ignore that.
Read more about Source Maps.

cmake: qt resources inside a module

i have this tree structure:
repository/modules/module1
repository/modules/module2
repository/modules/module..
repository/apps/application1
repository/apps/application2
repository/apps/application..
where the applications are using some modules.
now, I'd like to put some resources inside a module (like a very colorfull icons inside a widget used by several applications) but.. something gets wrong.
inside the module CMakeLists.txt if I use only:
set(${MODULE_NAME}_RCS
colors.qrc
)
...
qt4_add_resources (${MODULE_NAME}_RHEADERS ${${MODULE_NAME}_RCS})
no qrc_colors.cxx are created anywhere. so I've tried to add:
ADD_EXECUTABLE (${MODULE_NAME}
${${MODULE_NAME}_RHEADERS}
)
but.. I get this weird error:
CMake Error at repo/modules/ColorModule/CMakeLists.txt:51 (ADD_EXECUTABLE):
add_executable cannot create target "ColorModule" because another
target with the same name already exists. The existing target is a static
library created in source directory
"repo/modules/ColorModule". See documentation for
policy CMP0002 for more details.
(I've changed the path of the error of course)
so.. don't know what to think because i'm new both to cmake and qt..
what can i try?
EDIT:
if I add the ${MODULE_NAME}_RHEADERS and ${MODULE_NAME}_RCS in the add_library command the qrc_colors.cxx is created BUT it is in repository/modules/module1/built and not copied in the application built directory...
There is at least two errors in your code.
1) It is usually not necessary to use ${MODULE_NAME} everywhere like that, just "MODULE_NAME". You can see that the difference is the raw string vs. variable. It is usually recommended to avoid double variable value dereference if possible.
2) More importantly, you seem to be setting ${MODULE_NAME} in more than one executable place, which is "ColorModule" according to the error output. You should have individual executable names for different binaries.
Also, the resource file focus is a bit of red herring in here. There are several other issues with your project.
You can cmake files as CmakeLists.txt instead of CMakeLists.txt which inherently causes issues on case sensitive systes as my Linux box.
You use Findfoo.cmake, and find_package(foo) for that matter, rather than the usual FindFoo.cmake convention alongside find_package(Foo).
Your FindFoo.cmake is quite odd, and you should probably be rewritten.
Most importantly, you should use config files rather than find modules.
Documentation and examples can be found at these places:
http://www.cmake.org/Wiki/CMake/Tutorials#CMake_Packages
https://projects.kde.org/projects/kde/kdeexamples/repository/revisions/master/show/buildsystem
When you would like use a find module, you need to have that at hand already. That will tell you what to look for, where things are, or if they are not anywhere where necessary. It is not something that you should write. You should just reuse existing ones for those projects that are not using cmake, and hence the find modules are added separately.
It is a bit like putting the treasure map just next to the treasure. Do you understand the irony? :) Once you find the map, you would automatically have the treasure as well. i.e. you would not look for it anymore.

Resources