Jump to content

Compile Errors


ROBBIEPam
 Share

Recommended Posts

Have a look at this: http://trac.wildfire...ildInstructions

I wrote it recently. Hopefully should work for others.

it all worked up to the last command :(

cd /path/to/source (in my case it's cd downloads/sources)

cd binaries/system./pyrogenesis

when I run this it says:

Last login: Thu Mar 10 21:34:50 on ttys000Robbies-MacBook:~ robertsawyer$ cd Downloads/sources/0ad-r08832-alphaRobbies-MacBook:0ad-r08832-alpha robertsawyer$ cd binaries/systemRobbies-MacBook:system robertsawyer$ ./pyrogenesis-bash: ./pyrogenesis: No such file or directoryRobbies-MacBook:system robertsawyer$

Sorry I'm no better at this, I want to learn programing but havnt had a chance so I'm trying hard to learn stuff on my own but it's kinda hard when I have no training at all......

Link to comment
Share on other sites

A successful build in release mode creates the pyrogenesis executable in binaries/system.

If you built in debug mode, it's called something like pyrogenesis_dbg.

If there were errors during building (make), there won't be an executable there (only the prebuilt *.exe ones for windows).

In this case you'll have to fix the build-errors first.

Link to comment
Share on other sites

these are the build errors i get

make[1]: `../../../binaries/system/libgui.a' is up to date.

==== Building lowlevel ====

amd64_asm.asm

nasm: fatal: unrecognised output format `macho64' - use -hf for a list

type `nasm -h' for help

make[1]: *** [obj/lowlevel_Release/amd64_asm.o] Error 1

make: *** [lowlevel] Error 2

Robbies-MacBook:gcc robertsawyer$

i think im close but vie tried dif stuff and get the same msg every time. ???

Link to comment
Share on other sites

msr.cpp

cc1plus: error: obj/lowlevel_Release/precompiled.h: No such file or directory

cc1plus: error: one or more PCH files were found, but they were invalid

cc1plus: error: use -Winvalid-pch for more information

make[1]: *** [obj/lowlevel_Release/msr.o] Error 1

make: *** [lowlevel] Error 2

Robbies-MacBook:gcc robertsawyer$

???????????

Link to comment
Share on other sites

  • 2 weeks later...

GRRRRRRR!!! it all works but nothing loads. the pyrogenesis window opens but nothing happens :(

Last login: Sun Mar 27 08:08:52 on console

Robbies-MacBook:~ robertsawyer$ cd downloads/sources/0ad-r08832-alpha/binaries/system

Robbies-MacBook:system robertsawyer$ ./pyrogenesis

TIMER| InitVfs: 94.554 ms

TIMER| InitScripting: 297.598 ms

TIMER| CONFIG_Init: 18.034 ms

ERROR: CVFSFile: file hwdetect/hwdetect.js couldn't be opened (vfs_load: -110100)

ERROR: Failed to load hardware detection script

TIMER| write_sys_info: 80.652 ms

ERROR: Failed to find file: "shaders/model_light.xml"

ogl_shader.cpp(346): Function call failed: return value was -100013 (File/memory data is corrupted)

Function call failed: return value was -100013 (File/memory data is corrupted)

Location: ogl_shader.cpp:346 (Ogl_Program_reload)

Call stack:

(error while dumping stack: Feature currently not implemented)

errno = 0 (?)

OS error = ?

that's what i get in the terminal window…….

Link to comment
Share on other sites

Uhoh, there were major changes to the path handling code recently to improve support for various Linux filesystem encodings. That may well have broken OS X.

Can you please add a line debug_printf(L"lookup: %ls\n", pathname.string().c_str()); to the

beginning of vfs_Lookup() at vfs_lookup.cpp:73, and replace "else return ERR::VFS_DIR_NOT_FOUND;"

with

else
{
debug_printf(L"not found: %ls\n", subdirectoryName.string().c_str());
return ERR::VFS_DIR_NOT_FOUND;
}

and let us know the output (should also be displayed on the terminal)?

Link to comment
Share on other sites

Sorry about the delay, things are hoppin'.

Please use [ php ] tags for source code and refrain from posting so many identical gdb warnings ("no debug information available") - that really floods this thread.

I see two problems with the code as posted: the debug_printf format string contains %1s (the digit one) instead of %ls (the letter L), and:

if(pfile) // preserve a guarantee that if pfile then we either return an error or set *pfile
debug_printf(L"not found: %1s\n", subdirectoryName.string().c_str());
return ERR::VFS_DIR_NOT_FOUND;

needs to be changed to:

if(pfile) // preserve a guarantee that if pfile then we either return an error or set *pfile
{
debug_printf(L"not found: %1s\n", subdirectoryName.string().c_str());
return ERR::VFS_DIR_NOT_FOUND;
}

After recompiling, please post any lines from the terminal output containing those "lookup:" or "not found:" strings we just added.

Link to comment
Share on other sites

In file included from ../../../source/lib/file/vfs/vfs_lookup.cpp:37:

../../../source/lib/timer.h: In member function ‘void TimerUnit::AddDifferenceAtomic(TimerUnit, TimerUnit)’:

../../../source/lib/timer.h:178: warning: dereferencing type-punned pointer will break strict-aliasing rules

../../../source/lib/file/vfs/vfs_lookup.cpp: In function ‘LibError vfs_Lookup(const VfsPath&, VfsDirectory*, VfsDirectory*&, VfsFile**, size_t)’:

../../../source/lib/file/vfs/vfs_lookup.cpp:91: error: ‘subdirectoryName’ was not declared in this scope

make[1]: *** [obj/lowlevel_Release/vfs_lookup.o] Error 1

make: *** [lowlevel] Error 2

I think I still need to modify the file vfs_lookup.cpp

Link to comment
Share on other sites

Thanks for editing the post :)

../../../source/lib/timer.h: In member function ‘void TimerUnit::AddDifferenceAtomic(TimerUnit, TimerUnit)’:

../../../source/lib/timer.h:178: warning: dereferencing type-punned pointer will break strict-aliasing rules

These are generally bad news, so I've fixed it here.

As to the compile error: I just noticed that you added the "not found" debug_printf to the wrong spot.

We want to add it before the "return ERR::VFS_DIR_NOT_FOUND; // NOWARN" that is in the else branch of the if-statement that does "subdirectory = directory->AddSubdirectory(subdirectoryName);"

That would be line 111 in the original SVN version.

Link to comment
Share on other sites

ok, these are the compile errors that I get now:

In file included from ../../../source/lib/file/vfs/vfs_lookup.cpp:37:

../../../source/lib/timer.h: In member function 'void TimerUnit::AddDifferenceAtomic(TimerUnit, TimerUnit)':

../../../source/lib/timer.h:178: warning: dereferencing type-punned pointer will break strict-aliasing rules

../../../source/lib/file/vfs/vfs_lookup.cpp: In function 'LibError vfs_Lookup(const VfsPath&, VfsDirectory*, VfsDirectory*&, VfsFile**, size_t)':

../../../source/lib/file/vfs/vfs_lookup.cpp:112: error: 'const struct std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >' has no member named 'string'

make[1]: *** [obj/lowlevel_Release/vfs_lookup.o] Error 1

make: *** [lowlevel] Error 2

vfs_lookup.cpp now looks like this: (haven't figured out how you get it to form the nice compact box so I just took out a bunch of whitespace :\ )

if(pathname.empty()) // (prevent iterator error in loop end condition)

{

if(pfile) // preserve a guarantee that if pfile then we either return an error or set *pfile

{

return ERR::VFS_DIR_NOT_FOUND;

}

else

return INFO::OK;

}

// for each directory component:

VfsPath::iterator it; // (used outside of loop to get filename)

for(it = pathname.begin(); it != --pathname.end(); ++it)

{

const std::wstring& subdirectoryName = *it;

VfsDirectory* subdirectory = directory->GetSubdirectory(subdirectoryName);

if(!subdirectory)

{

if(addMissingDirectories)

subdirectory = directory->AddSubdirectory(subdirectoryName);

else

{

debug_printf(L"not found: %ls\n", subdirectoryName.string().c_str());

return ERR::VFS_DIR_NOT_FOUND; // NOWARN

}

}

Edited by ROBBIEPam
Link to comment
Share on other sites

(haven't figured out how you get it to form the nice compact box :\ )

Use [ php ] insert_code_here [ /php ] tags (without the whitespace after [ and before ]).

You really need to update the code from SVN - both timer and vfs_lookup have changed. In particular, subdirectoryName used to be a string but is now a VfsPath, which fixes your compile error.

Link to comment
Share on other sites

ok, I deleted everything, and redownloaded from svn. modified vfs_lookup.cpp, compiled it and it works fine. I haven't actualy played the game yet because I haven't had time but it comes up and close fine. I do have a number of terminal errors, the most common which shows up probably several hundred times is

"glwprintf failed (buffer size exceeded?) - return value -1, errno 92"

I also get a lot of lookup: errors like this one

"lookup: gui/common/setup.xml"

they are all dif and unless you want me to Im not going to post them all because there are a lot. Some are .xml and some are .xmb

thanx for all your help, and i hope that in some way I helped you. maybe once I learn more about programming I can help. :)

Edited by ROBBIEPam
Link to comment
Share on other sites

OK, thanks. The "lookup: " information is helpful - it tells us the VFS path is valid. That particular file should exist - assuming you've recently done a successful SVN update on the entire repository, including binaries/.

Now the question is: why are those files not being found?

In the absence of a debugger, we can continue with printfs ;)

Please replace both instances of

if(!skipPopulate)
RETURN_ERR(vfs_Populate(subdirectory));

with

	if(!skipPopulate)
{
PRealDirectory rd;
rd = directory->AssociatedDirectory();
debug_printf(L"populating %ls\n", rd? rd->Path().string().c_str() : L"(0)");
RETURN_ERR(vfs_Populate(directory));
rd = directory->AssociatedDirectory();
debug_printf(L"populated %ls\n", rd? rd->Path().string().c_str() : L"(0)");
}

(in the second spot, you'll need to rename instances of "directory" to "subdirectory")

Do these newly output paths exist on your machine?

Link to comment
Share on other sites

like I said, I deleted everything and ran this script svn co http://svn.wildfireg...ublic/ps/trunk/ 0adcd 0ad/build/workspaces./update-workspaces.shcd gcc make CONFIG=Release -j3

in terminal at about 7:30 yesterday so I should be up to date with the svn.

I modified th lookup.cpp file to look like this

(1st instance)


if(!skipPopulate)
{
PRealDirectory rd;
rd = directory->AssociatedDirectory();
debug_printf(L"populating %ls\n", rd? rd->Path().string().c_str() : L"(0)");
RETURN_ERR(vfs_Populate(directory));
rd = directory->AssociatedDirectory();
debug_printf(L"populated %ls\n", rd? rd->Path().string().c_str() : L"(0)");
}

(2nd instance)


if(!skipPopulate)[/size][/font] {

PRealDirectory rd;

rd = subdirectory->AssociatedDirectory();

debug_printf(L"populating %ls\n", rd? rd->Path().string().c_str() : L"(0)");

RETURN_ERR(vfs_Populate(directory));

rd = directory->AssociatedDirectory();

debug_printf(L"populated %ls\n", rd? rd->Path().string().c_str() : L"(0)");

}




directory = subdirectory;

the only terminal output that seems relevant in my opinion is:

ERROR: CVFSFile: file shaders/program.rng couldn't be opened (vfs_load: -110101)

ERROR: Failed to read grammar shaders/program.rng

I got hardware detection script errors to but I don't think they are what you need. I got a bunch of errors, all along the same lines as the one I posted. It looks for something in shaders/ and cant find it. All the other files loaded fine but none of the shaders loaded. It only comes up with a blank window now as well...

Edited by ROBBIEPam
Link to comment
Share on other sites

I should be up to date with the svn.

OK, but one additional source of errors is if the SVN checkout failed and didn't get everything.

It's better to just update SVN normally unless the working copy is totally corrupted.

(2nd instance)

Both the vfs_Populate and AssociatedDirectory calls there should reference subdirectory, not directory.

All the other files loaded fine but none of the shaders loaded.

Really?! The shaders are loaded in the same fashion as the hardware detection script -

a path relative to the VFS root that contains exactly one directory. Can you verify binaries/mods/public/shaders/program.rng exists? There should be 27 regular files there plus the hidden .svn folder.

What are these hardware detection script errors you're seeing - hopefully not

"Failed to load hardware detection script"?

Link to comment
Share on other sites

ERROR: CVFSFile: file hwdetect/hwdetect.js couldn't be opened (vfs_load: -110101)

ERROR: Failed to load hardware detection script

TIMER| RunHardwareDetection: 231 us

TIMER| write_sys_info: 132.534 ms

lookup: shaders/program.rng

populating /Users/robertsawyer/Downloads/0ad/binaries/data/mods/public/

populated /Users/robertsawyer/Downloads/0ad/binaries/data/mods/public/

populating /Users/robertsawyer/Downloads/0ad/binaries/data/mods/public/shaders/

populated /Users/robertsawyer/Downloads/0ad/binaries/data/mods/public/

ERROR: CVFSFile: file shaders/program.rng couldn't be opened (vfs_load: -110101)

ERROR: Failed to read grammar shaders/program.rng

I'm updating svn and ima see if that helps

Edited by ROBBIEPam
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...