Results 1 to 8 of 8

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

  1. #1

    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
    Lincoln, Lincolnshire, United Kingdom
    ./load_elf(void *elfstart, struct __argv *argv) {
    should that ./ be there?

  3. #3
    Don't think so. I definitely thought it was wrong, but there also more errors.
    I am also known as Jwop.

  4. #4
    I'll fix that.
    I am also known as Jwop.

  5. #5
    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
    On your harddrive (file name: Bliepo.crazy)
    Might be just me, but shouldn't this:
    ./load_elf(void *elfstart, struct __argv *argv) {
    u32 i;
    elfheader *elffile;
    be this:
    ./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
    @Bliepo Thank you, it solved that error.
    I am also known as Jwop.

  8. #8
    Oh wait, it didn't.
    I am also known as Jwop.


Posting Permissions

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