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

230 Views Asked by At

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

2

There are 2 best solutions below

1
On

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
}
0
On

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.