How to resolve Unable to find file.cpp in path(s) in Marmalade? - marmalade

I'm just trying to begin develop a game in Marmalade (6.3). But when I have made my new sources (.cpp, and .h) and added them to the mkb, and then trying to run my program, then I got an error which says that Unable to find file.cpp in path(s). It's for all of my files except the files (game.h, game.cpp, main.cpp) which were made by Marmalade when I have chosen the new 2D game project. Should I add my .cpp and .h files to anywhere else?
Thanks

It is difficult to give a categorical answer without more info. However my guess is that you've copied and pasted from an example and not understood about the syntax of the files section. Basically:
files
{
(foo)
humbug.cpp
)
The "(foo)" might look very innocent, but it actually says that humbug.cpp is actually in directory foo - relative to the mkb file. It is common practice to actually use "(source)" and put all the source files in a directory of that name - making the source layout a bit neater.
Naturally if you have (source) and don't put the files actually in directory source, they won't be found. My guess is that is what you are seeing.

Just to clarify previous answer, The format of files directive is like this -
files
{
(<Path relative to MKB>,<Alternate Path>)
["Name of the parent Group in VS/XCode project","Name of the subparent group"]
fileName.cpp
fileName.h
}
for example I have two files SoundManager.h and SoundManager.cpp in System folder of Source, while MainMenu.h and MainMenu.cpp in Source/UI. Now the files directive would be -
files
{
(Source/System)
["Source","System"] #This part is not required, it's just to arrange your files in IDE project
SoundManager.h
SoundManager.cpp
(Source/UI)
("Source","UI")
MainMenu.h
ManinMenu.cpp
}

Related

Relative Paths in VS Code

I work with a multi-root workspace in VS Code. Here's my folder structure:
project-one
-node_modules
-public
--css
---styles.css
--img
---global
-----logo.svg
--js
---main.js
--index.html
project-two
project-three
When I reference files in my index.html file, VS Code always wants me to write it like this (in index.html):
src="img/global/logo.svg"
That doesn't really make sense to me. Logically, I would write the relative path to the logo with a leading / before img as the img folder is at the same level as index.html. However, that doesn't work.
Can anybody explain me why? And will the path declarations work correctly like this when I upload these files to the server (the content of the public folder will then be at the root)?
Thanks.

Exclude specific directories from being parsed by intellisense

I am using php-intellisense extension for my Visual Studio Code.
How do I exclude other folders from being parsed by this extension? As of now it only excludes node_modules and vendor folder.
The extension does not seem to have any specific setting so, unless I'm missing something, the only way to accomplish that is the files.exclude directive. It should definitively work with all languages because it basically makes the file or directory totally disappear from the program.
Beware though of the consequences: you won't even see the folder in the file explorer, nor will it show in searches.
There is an opened issue on the author's github. I've just added a comment to explain how to workaround it.
Please have a look to my comment: https://github.com/felixfbecker/php-language-server/issues/159#issuecomment-514581602
In brief, you can change the way the workspace files are scanned in this file :
C:\Users\USER\ .vscode\extensions\felixfbecker.php-intellisense-xxxx\vendor\felixfbecker\language-server\src\ Indexer.php
public function index(): Promise
{
return coroutine(function () {
// Old code using the rootPath
//$pattern = Path::makeAbsolute('**/*.php', $this->rootPath);
// My new pattern
$pattern = Path::makeAbsolute('**/*.php', 'C:/Users/[USER]/Projects/sources/app/code');
$uris = yield $this->filesFinder->find($pattern);
// ...
});
}
Restart VS Code after saving the changes and it will only index the needed path.

Swift 3 - Bundle.main.path with same file name in different directories

Long story short, I have two settings files that must have the same name. They're currently in separate folders, something like:
Resources/brand/dev/settings.file
Resources/brand/prod/settings.file
However I can't seem to get Swift to grab the file out, it always comes up as nil
var file = Bundle.main.path(forResource:"settings", ofType:"file", inDirectory:"Resources/brand/dev")
If I remove one of the files, and the inDirectory parameter everything works fine.
File target membership, project build phases all look OK.
Am I missing something here?
Setting files must be added to XCode with the option 'Create folder references'

How to exclude a directory in Stream mapping in p4v

I'm using the visual client for perforce and I want to exclude a directory from the workspace. Before streams, I would just navigate to my workspace, find the folder in the tree, and exclude it (and I've found this solution in a number of other related questions I've found). However, now that I am using a stream, it won't let me do this, i have to edit the stream mapping apparently.
So I tried to add this line to the remapped box when editing the stream:
-//NumberPlus/current/Library/... //nplus-mainline/current/Library/
However I just get an error:
Error in stream specification.
Error detected at line 24
Null directory (//) not allowed in '-//NumberPlus/current/Library/...'.
EDIT: I'm in Windows 8.1, for clarification.
If the folder you want to exclude is specific to your machine, setting P4IGNORE locally is the easiest way to exclude it from being added to the depot.
http://www.perforce.com/blog/120214/new-20121-p4ignore
You'd set P4IGNORE to some name like "p4ignore.txt", create a file with that name, and add "Libraries" to it -- subsequent "p4 add" commands will skip over paths found in the P4IGNORE file, so those files will never get added to the depot.
If this is something that's going to be common to all workspaces of this stream (e.g. it's a build artifact that everyone is going to generate and nobody is supposed to check in), what you want to do is add an "exclude" to the stream's Paths (this will exclude it from both branch views and client views generated by that stream). E.g.:
Paths:
share ...
exclude Libraries/...
The "exclude Libraries/..." is basically the same thing as the exclusion line you would add to the client view, except you specify it as a relative path, you don't need to specify both sides of the mapping, and the "-" is implied by the "exclude" type. The "remap" type is if you want to keep those files but in a different depot location, which doesn't sound applicable here.
More information on defining stream views:
http://www.perforce.com/perforce/doc.current/manuals/p4v/streams_views.html
You can't just edit the mappings for your client workspace if it is switched to a particular stream. The whole point of streams is that your workspace mapping is directly generated from the stream definition. So that's a feature.
It's not totally clear whether
you don't want the directory in the stream at all, or
it's valid to have the directory in the stream, but you don't want to sync it to your workstation, or
you want the directory sync'd to your workstation, but you want the directory to have different contents (say, from some other stream which has a different version of the library.
However, for all of these situations, I suspect the best path forward is to define a new child stream of your current stream.
You will want to define the path mappings using the "share", "exclude", "isolate", and "import" mapping types.
For example, if you just didn't want the Library/... directory at all, you'd "exclude" it from your parent.
Then that stream simply won't have that directory, and it (of course) won't be on your workstation when you sync to the stream, either.
If you wanted to have a different copy of the code in the Library/... directory, so that it became a point of intentional divergence from the parent, you'd "isolate" it from your parent to submit your own custom version, or "import" it from another stream to use that stream's Library/... directory instead.
In either case, the directory would be part of the stream, and would be sync'd to your workstation, but the contents of that directory would differ from the contents that are used in the parent stream (the exact way in which they'd differ is under your control, as you define the stream accordingly).
Documentation and some examples are here: http://www.perforce.com/perforce/doc.current/manuals/p4v/streams_views.html
and here:
http://www.perforce.com/sites/default/files/pdf/Streams-ebook.pdf
I believe I have solved this. To be clear, I wanted the folder to be completely ignored by version control. I'm using p4connect with Unity and it keeps wanting to include unnecessary stuff in my depot.
All I had to do was add this line to my parent stream in the Paths box:
exclude current/Library/...

Getting IntelliJ 12 to put GWT output in the right location

For reasons that I have to ask you to accept as a given, I need to have my GWT application be built such that all the output is available at "/Foo/bar/1.0", rather than the normal "/".
Specifically, I need the result of compiling my GWT app inside of IntelliJ to look like this:
~/.IntelliJIdea12/system/gwt/Project.534b2263/Test.ef6cd448/run/www/
- Foo
- bar
- 1.0
- Testing.html
- Testing.css
- (other files in here too, like favicon.ico, etc...)
- WEB-INF
- (contents left out here)
- testing
- testing.devmode.js
- testing.nocache.js
The best I can seem to do is to get the Testing.html, Testing.css, etc... in the right place. I get this by setting the "Output Relative Path" for my GWT module to "/Foo/bar/1.0/" and the "Path Relative to DeploymentRoot" for my Web Resource Directory to the same "/Foo/bar/1.0/".
However, the "testing" directory, containing the testing.devmode.js and testing.nocache.js seem to wind up in the ~/.IntelliJIdea12/system/gwt/Project/534b2263/Test.ef6cd448/run/www/testing directory.
Obviously, this means that when the Testing.html tries to include the testing/testing.nocache.js it cannot be found, and my GWT app doesn't work.
Hopefully I'm just missing something easy, but I've been digging around for hours...
For those who may be interested, I've created a sample project to illustrate the problem and posted it, along with this same basic question, at the IntelliJ Forums: http://devnet.jetbrains.com/thread/442050.
(Copied from IntelliJ forums)
If you need to put GWT compiler output somewhere you need to create an artifact (File | Project Structure | Artifacts) and add 'GWT Compiler Output'
element to it. Also you can put 'Web facet resources' element to the same artifact. If you need to place the GWT output into a subfolder under the
artifact output root use 'New Folder' action in the 'Output layout' tree in the artifact editor.
Just for future reference and easy of finding this answer, the final result (see http://devnet.jetbrains.com/thread/442050) it is not possible to control the location of the output of the GWT compiler.
Practically what this means (for my project anyways) is that I have to do a runtime check: GWT.isProdMode() and then load resources from different locations.