I have successfully run the "Step by Step Coos2dxSimpleGame Series" (http://www.cocos2d-x.org/projects/cocos2d-x/wiki/Tutorials) in windows using visual c++. Now I want to port this project to an android device, Hence I copied the classes namely HelloWorld,AppDelegate and GameOverScene and their header files to Classes folder and the resources to /Resources folder. Then I have modified the android.mk file to include a new class called GameOverScene.cpp which is not present before .
Then I run ./build_native.sh . The error message is here (http://www.cocos2d-x.org/attachments/1152/native_error.PNG) .
Is the process I am following correct?
In HelloWorldScene.h, change:
HelloWorld::~HelloWorld();
HelloWorld::HelloWorld();
to:
~HelloWorld();
HelloWorld();`
You must not add the class name in your declarations in header files (but you have to do it in your cpp file).
One thing that I can suggest You is to follow step by step this tutorial
http://magicscrollsofcode.blogspot.com/2011/09/quick-and-dirty-guide-to-getting.html
and also don't forget about this:
http://www.cocos2d-x.org/boards/6/topics/8572?r=8577#message-8577 afterwards
these two things helped me a lot one time :)
Related
I am trying my best to include FreeRTOS into a new Project on VS Code for Mac.
I have created a directory for my project, added a main.cpp, configure the default build task for C/C++ clang. I have also created the c_cpp_properties.json.
My project consists of three folders; 'src' containing my main.cpp, and 'FreeRTOS' containing all of the source files for FreeRTOS (include & portable folders), and 'Demo' containing a demo app built for the CORTEX_ATSAM3X_Atmel_Studio board (that comes with the FreeRTOS download).
In my main.cpp file, I have an empty main function, that I can build successfully. The minute I try to add #include <FreeRTOS.h> to main.cpp, I am given the error FreeRTOS.h file not found.
What is interesting, is the first time I try to build, it recognises FreeRTOS.h, and the error I see is that it cannot find a file included in the FreeRTOS.h. To remedy this, I add the specific subdirectory to c_cpp_properties. I rebuild and then it shows me another file it cannot locate. So I work again manually amending another subdirectory. After 5 or 6 times, suddenly it fails to find FreeRTOS.h. When I delete all of the includePath entries except "${workspaceFolder}/**" I cannot get back to my starting point.
I have spent the last two days stuck on this, reading forums, starting my process again and I still cannot see where I am going wrong.
Probably I run into the same issue.
The problem was FreeRTOSConfig.h contains this definition
#define CMSIS_device_header "stm32h7xx.h"
which is next used in freertos_os2.h header (only):
#include CMSIS_device_header
and that is where build gets confused. It is not the perfect solution but removing the CMSIS_device_header variable and specifying stm32h7xx.h header directly in freertos_os2.h file solved my problem.
I'm working with a C++ Unreal Engine project and made my own custom module called MyActor, Unreal Engine automatically created the .cpp and .h files for me. That much appears to be working.
So now I want to include classes or methods from the AppleARKit plugin then override and call them from my custom MyActor module.
First I tried using #include AppleARKitLiveLinkSourceFactory.h because it has theIARKitBlendShapePublisher::PublishBlendshapes method which I want to modify and use.
It didn't work at first with this error: E1696 Cannot open source file AppleARKitLiveLinkSourceFactory.h but I found out I could include them in Visual Studio using the "Include Directories" under Properties like this:
The AppleARKitLiveLinkSourceFactory.h lives in the Public folder but I included the Private folder as well, I don't know if I need to do that. This appeared to work at first but then I got the same error as before for every dependency inside the AppleARKitLiveLinkSourceFactory.h file.
Do I have to include the individual directories for every dependency down the entire chain? Is there an easier way?
When I ran into the issue of including files from a plugin, in my case LidarPointCloud, the following steps worked for me:
1) In my <project-name>.Build.cs file, I added the module name I wished to use (LidarPointCloudRuntime) to the public dependency list
PublicDependencyModuleNames.AddRange(new string[] { "LidarPointCloudRuntime", "Core", "CoreUObject", "Engine", "InputCore" });
I determined the module name by opening the .uplugin file in the plugin's folder, and looked at the Modules section. If multiple module names are listed, you should pick the one that contains the source for the classes you care about.
2) I then rebuilt the project, closed my editor, then right clicked my <project-name>.uproject file and regenerated project files.
After that, I was able to access the .h files in my code.
-Update-
It seems that AppleARKitFaceSupport has dependencies on other plugins that may need to be included. For example, ARSystems.h lives in AugmentedReality. When I add that to PublicDependencyModuleNames and perform the same steps, it can find ARSystem.h.
VS2017, SDK/WDK, C++ project
we have a c++ solution (driver) that is shared across developers via Team Foundation Services - visualstudio.com (now called azure devops?).
When I perform a get latest source code, and want to rebuild the solution I get two MSB3030 errors:
"Could not copy the file "C:\path of my colleague his file" because it was not found."
I found it strange that I saw on one of the two errors a path of my colleague his pc. He works on C:\ I'm working on E:\
Unloading the project, I saw he path being set here:
<ItemGroup>
<FilesToPackage Include="C:\path of my colleague\foo.xml" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<PackageRelativeDirectory>
</PackageRelativeDirectory>
</FilesToPackage>
We cannot get this solution to build because of the MSB3030. First we have to clean the specific projects individually, rebuild it, then build another project etc.. a few steps to perform manually in the correct order , trial and error, drinking coffee, throwing bananas to the pc and praying that a monkey outputs the code correctly.
Has anyone seen somehting similar regarding MSB3030 errors?
On my pc I see the path of my colleague, but he doesn't see my path (strange!).
C:\Program Files (x86)\Windows
Kits\10\build\WindowsDriver.common.targets(1699,5): error MSB3030:
Could not copy the file 'C:...' because it was not found.
I've set the Any CPU to x64 because it doesn't make any sense for c++.
C++ Windows Driver MSB3030 could not copy the file '' because it was not found
The reason for this issue is that the path of the ItemGroup is an absolute path in the project file:
<ItemGroup>
<FilesToPackage Include="C:\path of my colleague\foo.xml" ...>
...
</FilesToPackage>
</ItemGroup>
Regardless of whether your colleague has added this file to source control, when you pull the code from the TFS server to your local and put the code in a different local folder, the absolute path will bring you a lot of trouble, you need to manually check the code on the TFS server for this file and you need to modify the absolute path of this file in your project. But this problem will reappear after your colleague updates after you submit your code. Because an absolute path cannot be assigned to two different paths C:\ and E:\.
To resolve this issue, you need to change the absolute path to a relative path in the source code. Generally, we prefer to add this file to the Solution/Project folder, then use the MSBuild Macros $(SolutionDir)/$(ProjectDir) to specify it.
Check Common macros for build commands and properties for some more details.
Hope this helps.
Hey I know people have started forums already concerning this problem.
I'm trying to create a SFML project template in VS2015 Express (I've also tried it in VS2017). I've followed many guides and answers to this problem on here, MSDN forums and others.
No matter what I try, the project template cannot open up my source and header files from the original project I created the template from. "Document cannot be opened: It has renamed, deleted or moved."
I'm working with/on:
Win10 PC; 64-bit
VS Express 2015 for Windows Desktop; v. 14.0.25431.01 Update 3
VS 2017; v. 15.3.5 (rather use VSE 2015 though)
What I've tried:
- Opening the MyTemplate.vstemplate file in texteditor, adding true in TemplateData;
adding: filename.cpp or
filename.h, replacing the filename with the .cpp and .h filenames in the TemplateContent section
unchecked Automatically import template when exporting template
unzipping, adding source files, rezipping and placing zip file in Templates\Project Templates zipped and unzipped
adding new mentioned zip file above (with source files inc.) into My Exported Templates folder
haven't deleted Properties folder in MyTemplate.vstemplate bc I couldn't find a file there?
I've been at my desk for around 3 hours and have hit my first roadblock, I don't know what to do. Please assist, guys.
EDIT: Found the problem; although the original .cpp and .h files aren't being added into the exported template.
When I create a new project using my custom template, the source files (from the original project used to create the template) are not automatically added into the new project's files. So I have to manually copy the files from my original project to the new project's folder.
Any way to have the original source files added into the new project's files so I don't have to this manually every time?
I know this is pretty old but I'm going through the same thing and it was driving me crazy. So I figured out how to edit the project template to make it work.
I used Winrar, but I'm sure there's a bit simpler approach but here it goes:
I went to C:\Users\MyName\Documents\Visual Studio 2015\Templates\ProjectTemplates
and opened my SFML template with winrar. I then copied all of my .h and .cpp files from the original project into the template. I did this with another instance of winrar by dragging and dropping the files.
Then, I edited the MyTemplate.vstemplate file. I added a new "ProjectItem"Line by copying and pasting one of the ones already there. For example:
<ProjectItem ReplaceParameters="false" TargetFileName="ReadMe.txt">ReadMe.txt</ProjectItem>
This was an original line and I copied it and edited it to match one of the files I added. For example, I changed ReadMe.txt to SFML.cpp in a new line.
I did this for all of the new files, saved it and then it worked!
Let it be noted that I did not extract the template .zip at any point.
I've got a problem with compiling my basic code with MOOS-ivp.
I made main.cpp, simpleApp.cpp and simpleApp.h from documentation, where should I put it to build it with moos? In docs there is note about launching MOOSDB and uMS - ok, but there is not any option to find path to my .cpp file. Is there any default path? Maybe should I compile it firstly with gcc?
I'll assume you know some basic information about MOOS or are taking the MIT 2.680 course and know some of the terminology talked about in the introduction lab.
The recommended way to build external MOOS is to have moos-ivp and moos-ivp-extend in a directory next to each other. You should run GenMOOSApp_AppCasting in the moos-ivp-extend/src directory and add your new project to the CMakeLists.txt file in the same directory. Then, use the included ./build.sh script to build your executables, and add the directory it makes to your $PATH.
Finally, you should be able to run your mission with your new MOOS app.