Results 1 to 8 of 8

Thread: error: expected identifier or '(' before '.' token

  1. #1
    New Member 540_Slider's Avatar
    Join Date
    May 2010
    Posts
    13
    Thanks
    0
    Thanked 2 Times in 2 Posts

    error: expected identifier or '(' before '.' token

    I've searched around on the internet and I can't seem to have found the solution.
    I also haven't done much coding at all, as you can probably see.
    The error is on the 21st line:

    #include <malloc.h>
    #include <ogc/machine/processor.h>
    #include <dirent.h>
    #include <string.h>

    #include "elfloader.h"

    typedef struct _elfheader {
    u32 text_pos[7];
    u32 data_pos[11];
    u32 text_start[7];
    u32 data_start[11];
    u32 text_size[7];
    u32 data_size[11];
    u32 bss_start;
    u32 bss_size;
    u32 entry_point;
    } elfheader;


    ./load_elf(void *elfstart, struct __argv *argv) {
    u32 i;
    elfheader *elffile;


    if (elfstart) {
    elffile = (elfheader *) elfstart;
    for (i = 0; i < 7; i++) {
    if ((!elffile->text_size[i]) || (elffile->text_start[i] < 0x100)) continue;
    ICInvalidateRange ((void *) elffile->text_start[i],elffile->text_size[i]);
    memmove ((void *) elffile->text_start[i],elfstart+elffile->text_pos[i],elffile->text_size[i]);
    }


    for (i = 0; i < 11; i++) {
    if ((!elffile->data_size[i]) || (elffile->data_start[i] < 0x100)) continue;
    memmove ((void *) elffile->data_start[i],elfstart+elffile->data_pos[i],elffile->data_size[i]);
    DCFlushRangeNoSync ((void *) elffile->data_start[i],elffile->data_size[i]);
    }


    memset ((void *) elffile->bss_start, 0, elffile->bss_size);
    DCFlushRange((void *) elffile->bss_start, elffile->bss_size);


    if (argv && argv->argvMagic == ARGV_MAGIC) {
    void *new_argv = (void *)(elffile->entry_point + 8);
    memmove(new_argv, argv, sizeof(*argv));
    DCFlushRange(new_argv, sizeof(*argv));
    }


    return elffile->entry_point;
    }
    return 0;
    }
    Hope someone can help.
    I am also known as Jwop.

  2. #2
    Senior Member
    Retired Staff
    davepm's Avatar
    Join Date
    Aug 2009
    Location
    Lincoln, Lincolnshire, United Kingdom
    Posts
    4,561
    Thanks
    124
    Thanked 2,059 Times in 831 Posts
    Blog Entries
    1
    ./load_elf(void *elfstart, struct __argv *argv) {
    should that ./ be there?

  3. #3
    New Member 540_Slider's Avatar
    Join Date
    May 2010
    Posts
    13
    Thanks
    0
    Thanked 2 Times in 2 Posts
    Don't think so. I definitely thought it was wrong, but there also more errors.
    I am also known as Jwop.

  4. #4
    New Member 540_Slider's Avatar
    Join Date
    May 2010
    Posts
    13
    Thanks
    0
    Thanked 2 Times in 2 Posts
    I'll fix that.
    I am also known as Jwop.

  5. #5
    New Member 540_Slider's Avatar
    Join Date
    May 2010
    Posts
    13
    Thanks
    0
    Thanked 2 Times in 2 Posts
    It's fixed. This is what it looks now:
    int load_elf (void *elfstart, struct __argv *argv) {
    Now I have a new problem: there are multiple definitions of load_elf in the line above. If you can see the problem, then you're welcome to make a suggestion.
    I am also known as Jwop.

  6. #6
    WiiHacks Staff
    Only Site Donators Can PM Staff

    Junior Moderator
    Bliepo's Avatar
    Join Date
    Nov 2009
    Location
    On your harddrive (file name: Bliepo.crazy)
    Posts
    1,581
    Thanks
    241
    Thanked 391 Times in 312 Posts
    Blog Entries
    4
    Might be just me, but shouldn't this:
    Code:
    ./load_elf(void *elfstart, struct __argv *argv) {
    u32 i;
    elfheader *elffile;
    be this:
    Code:
    ./load_elf(void *elfstart, struct __argv *argv) {
    u32 i;
    elfheader *elffile;
    }
    Awesome sig picture does not work
    Brick Prevention- Things you should never do | Ignoring advice and bricking | Be a jedi, donate
    Guide: Softmod ANY wii | How to post a system check | Loading and Playing Wii Backup Games from USB HDD (softmod only)
    System Menu X (IOS150, E) | HBC 1.08 (IOS58) | bootmii/boot2v4 | priiloader 0.7 | cIOSX rev21d2x_v6 (main base IOS 57) | cIOS 223 (IOS 37 + 38 merged) | USB Loader GX 2.2

  7. #7
    New Member 540_Slider's Avatar
    Join Date
    May 2010
    Posts
    13
    Thanks
    0
    Thanked 2 Times in 2 Posts
    @Bliepo Thank you, it solved that error.
    I am also known as Jwop.

  8. #8
    New Member 540_Slider's Avatar
    Join Date
    May 2010
    Posts
    13
    Thanks
    0
    Thanked 2 Times in 2 Posts
    Oh wait, it didn't.
    I am also known as Jwop.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •