Welcome! Log In Create A New Profile

Advanced

Compiling problem - exsiting source.

Posted by corl45 
Compiling problem - exsiting source.
April 22, 2010 02:39AM
Alright, being a pascal and BASIC programmer I decided to learn a bit of C++, as what I do know is becoming obsolete. One of the funnest ways I like to learn to write applications, is taking an existing source and tweeking it to my liking, thus gaining knowledge and work my way to write my own. That being said, I found the game "Achtung Wii Kurve" very fun and decided to tweek it a little bit, change a few lines of code, maybe a few variables. So I downloaded the source, and immediately compiled it to check it it would work. Surprisingly enough, it did not (while others have, namely the examples inside of devkit). It gave me this error:

> "make" 
main.cpp
In file included from c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:12:
c:/devkitpro/examples/achtung_wii_kurve/source/oggplayer.h:31:33: error: tremor/ivorbiscodec.h: No such file or directory
c:/devkitpro/examples/achtung_wii_kurve/source/oggplayer.h:32:32: error: tremor/ivorbisfile.h: No such file or directory
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:14:18: warning: mxml.h: No such file or directory
In file included from c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:6:
c:/devkitpro/examples/achtung_wii_kurve/source/GRRLIB/GRRLIB/GRRLIB.h:99: error: variable or field 'GRRLIB_NPlot' declared void
c:/devkitpro/examples/achtung_wii_kurve/source/GRRLIB/GRRLIB/GRRLIB.h:99: error: 'Vector' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/GRRLIB/GRRLIB/GRRLIB.h:99: error: expected primary-expression before 'color'
c:/devkitpro/examples/achtung_wii_kurve/source/GRRLIB/GRRLIB/GRRLIB.h:99: error: expected primary-expression before 'long'
c:/devkitpro/examples/achtung_wii_kurve/source/GRRLIB/GRRLIB/GRRLIB.h:105: error: variable or field 'GRRLIB_NGone' declared void
c:/devkitpro/examples/achtung_wii_kurve/source/GRRLIB/GRRLIB/GRRLIB.h:105: error: 'Vector' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/GRRLIB/GRRLIB/GRRLIB.h:105: error: expected primary-expression before 'color'
c:/devkitpro/examples/achtung_wii_kurve/source/GRRLIB/GRRLIB/GRRLIB.h:105: error: expected primary-expression before 'long'
c:/devkitpro/examples/achtung_wii_kurve/source/GRRLIB/GRRLIB/GRRLIB.h:106: error: variable or field 'GRRLIB_NGoneFilled' declared void
c:/devkitpro/examples/achtung_wii_kurve/source/GRRLIB/GRRLIB/GRRLIB.h:106: error: 'Vector' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/GRRLIB/GRRLIB/GRRLIB.h:106: error: expected primary-expression before 'color'
c:/devkitpro/examples/achtung_wii_kurve/source/GRRLIB/GRRLIB/GRRLIB.h:106: error: expected primary-expression before 'long'
In file included from c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:6:
c:/devkitpro/examples/achtung_wii_kurve/source/GRRLIB/GRRLIB/GRRLIB.h:122: error: variable or field 'GRRLIB_DrawImgQuad' declared void
c:/devkitpro/examples/achtung_wii_kurve/source/GRRLIB/GRRLIB/GRRLIB.h:122: error: 'Vector' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/GRRLIB/GRRLIB/GRRLIB.h:122: error: expected primary-expression before 'struct'
c:/devkitpro/examples/achtung_wii_kurve/source/GRRLIB/GRRLIB/GRRLIB.h:122: error: expected primary-expression before 'color'
c:/devkitpro/examples/achtung_wii_kurve/source/GRRLIB/GRRLIB/GRRLIB.h:124: error: variable or field 'GRRLIB_DrawTileQuad' declared void
c:/devkitpro/examples/achtung_wii_kurve/source/GRRLIB/GRRLIB/GRRLIB.h:124: error: 'Vector' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/GRRLIB/GRRLIB/GRRLIB.h:124: error: expected primary-expression before 'struct'
c:/devkitpro/examples/achtung_wii_kurve/source/GRRLIB/GRRLIB/GRRLIB.h:124: error: expected primary-expression before 'color'
c:/devkitpro/examples/achtung_wii_kurve/source/GRRLIB/GRRLIB/GRRLIB.h:124: error: expected primary-expression before 'int'
c:/devkitpro/examples/achtung_wii_kurve/source/GRRLIB/GRRLIB/GRRLIB.h:152: error: variable or field 'GRRLIB_GXEngine' declared void
c:/devkitpro/examples/achtung_wii_kurve/source/GRRLIB/GRRLIB/GRRLIB.h:152: error: 'Vector' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/GRRLIB/GRRLIB/GRRLIB.h:152: error: expected primary-expression before 'color'
c:/devkitpro/examples/achtung_wii_kurve/source/GRRLIB/GRRLIB/GRRLIB.h:152: error: expected primary-expression before 'long'
c:/devkitpro/examples/achtung_wii_kurve/source/GRRLIB/GRRLIB/GRRLIB.h:152: error: expected primary-expression before 'fmt'
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp: In function 'void loadPreferences()':
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:268: error: 'mxml_node_t' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:268: error: 'tree' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:269: error: 'data' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:282: error: 'MXML_NO_CALLBACK' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:282: error: 'mxmlLoadFile' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:285: error: 'MXML_DESCEND' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:285: error: 'mxmlFindElement' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:287: error: 'mxmlElementGetAttr' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:290: error: 'mxmlElementGetAttr' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:293: error: 'mxmlElementGetAttr' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:296: error: 'mxmlElementGetAttr' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:299: error: 'mxmlElementGetAttr' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:302: error: 'mxmlElementGetAttr' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:305: error: 'mxmlElementGetAttr' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:308: error: 'mxmlElementGetAttr' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:311: error: 'mxmlElementGetAttr' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:314: error: 'mxmlElementGetAttr' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:318: error: 'mxmlDelete' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp: In function 'void savePreferences()':
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:330: error: 'mxml_node_t' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:330: error: 'xml' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:331: error: 'data' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:332: error: 'mxmlNewXML' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:334: error: 'mxmlNewElement' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:338: error: 'mxmlElementSetAttr' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:374: error: 'MXML_NO_CALLBACK' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:374: error: 'mxmlSaveFile' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:376: error: 'mxmlDelete' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp: In function 'int main(int, char**)':
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:488: error: 'mem_open' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:2228: warning: suggest parentheses around '&&' within '||'
make[1]: *** [main.o] Error 1
"make": *** [build] Error 2

> Process Exit Code: 2
> Time Taken: 00:03

Being new to C++ I don't know what all of the errors, mean, but I can make out a few. Also, I didn't go over any guide to "setup" devkit, I downloaded it from a website, and installed it. It had the devkitPPC folder and everything, plus wii examples, if that helps at all. Any help would be greatly appreciated.

Thanks - Corl45.
Re: Compiling problem - exsiting source.
April 22, 2010 03:16AM
you need the portlibs in your devkit folder it looks like. mxml it looks like.

also, the errors about "Vector...blablabla" are due to a change in libogc. this was written to work with older versions of libogc. as a workaround, you can add "#define Vector guVector". guVector is used in newer libogc.

those should clear up everything except the tremor/vorbis errors at the top. you may clear those up with a portlib, but im not sure.
Re: Compiling problem - exsiting source.
April 22, 2010 07:44AM
After adding "#define Vector guVector" these errors persist. And I cannot seem to find mxml wii anywhere. It's not in the homebrew development tools. Forgive me if I'm looking in the wrong spot: [wiibrew.org]

> "make" 
main.cpp
In file included from c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:12:
c:/devkitpro/examples/achtung_wii_kurve/source/oggplayer.h:31:33: error: tremor/ivorbiscodec.h: No such file or directory
c:/devkitpro/examples/achtung_wii_kurve/source/oggplayer.h:32:32: error: tremor/ivorbisfile.h: No such file or directory
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:14:18: warning: mxml.h: No such file or directory
In file included from c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:6:
c:/devkitpro/examples/achtung_wii_kurve/source/GRRLIB/GRRLIB/GRRLIB.h:99: error: variable or field 'GRRLIB_NPlot' declared void
c:/devkitpro/examples/achtung_wii_kurve/source/GRRLIB/GRRLIB/GRRLIB.h:99: error: 'Vector' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/GRRLIB/GRRLIB/GRRLIB.h:99: error: expected primary-expression before 'color'
c:/devkitpro/examples/achtung_wii_kurve/source/GRRLIB/GRRLIB/GRRLIB.h:99: error: expected primary-expression before 'long'
c:/devkitpro/examples/achtung_wii_kurve/source/GRRLIB/GRRLIB/GRRLIB.h:105: error: variable or field 'GRRLIB_NGone' declared void
c:/devkitpro/examples/achtung_wii_kurve/source/GRRLIB/GRRLIB/GRRLIB.h:105: error: 'Vector' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/GRRLIB/GRRLIB/GRRLIB.h:105: error: expected primary-expression before 'color'
c:/devkitpro/examples/achtung_wii_kurve/source/GRRLIB/GRRLIB/GRRLIB.h:105: error: expected primary-expression before 'long'
c:/devkitpro/examples/achtung_wii_kurve/source/GRRLIB/GRRLIB/GRRLIB.h:106: error: variable or field 'GRRLIB_NGoneFilled' declared void
c:/devkitpro/examples/achtung_wii_kurve/source/GRRLIB/GRRLIB/GRRLIB.h:106: error: 'Vector' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/GRRLIB/GRRLIB/GRRLIB.h:106: error: expected primary-expression before 'color'
c:/devkitpro/examples/achtung_wii_kurve/source/GRRLIB/GRRLIB/GRRLIB.h:106: error: expected primary-expression before 'long'
In file included from c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:6:
c:/devkitpro/examples/achtung_wii_kurve/source/GRRLIB/GRRLIB/GRRLIB.h:122: error: variable or field 'GRRLIB_DrawImgQuad' declared void
c:/devkitpro/examples/achtung_wii_kurve/source/GRRLIB/GRRLIB/GRRLIB.h:122: error: 'Vector' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/GRRLIB/GRRLIB/GRRLIB.h:122: error: expected primary-expression before 'struct'
c:/devkitpro/examples/achtung_wii_kurve/source/GRRLIB/GRRLIB/GRRLIB.h:122: error: expected primary-expression before 'color'
c:/devkitpro/examples/achtung_wii_kurve/source/GRRLIB/GRRLIB/GRRLIB.h:124: error: variable or field 'GRRLIB_DrawTileQuad' declared void
c:/devkitpro/examples/achtung_wii_kurve/source/GRRLIB/GRRLIB/GRRLIB.h:124: error: 'Vector' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/GRRLIB/GRRLIB/GRRLIB.h:124: error: expected primary-expression before 'struct'
c:/devkitpro/examples/achtung_wii_kurve/source/GRRLIB/GRRLIB/GRRLIB.h:124: error: expected primary-expression before 'color'
c:/devkitpro/examples/achtung_wii_kurve/source/GRRLIB/GRRLIB/GRRLIB.h:124: error: expected primary-expression before 'int'
c:/devkitpro/examples/achtung_wii_kurve/source/GRRLIB/GRRLIB/GRRLIB.h:152: error: variable or field 'GRRLIB_GXEngine' declared void
c:/devkitpro/examples/achtung_wii_kurve/source/GRRLIB/GRRLIB/GRRLIB.h:152: error: 'Vector' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/GRRLIB/GRRLIB/GRRLIB.h:152: error: expected primary-expression before 'color'
c:/devkitpro/examples/achtung_wii_kurve/source/GRRLIB/GRRLIB/GRRLIB.h:152: error: expected primary-expression before 'long'
c:/devkitpro/examples/achtung_wii_kurve/source/GRRLIB/GRRLIB/GRRLIB.h:152: error: expected primary-expression before 'fmt'
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp: In function 'void loadPreferences()':
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:270: error: 'mxml_node_t' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:270: error: 'tree' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:271: error: 'data' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:284: error: 'MXML_NO_CALLBACK' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:284: error: 'mxmlLoadFile' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:287: error: 'MXML_DESCEND' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:287: error: 'mxmlFindElement' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:289: error: 'mxmlElementGetAttr' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:292: error: 'mxmlElementGetAttr' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:295: error: 'mxmlElementGetAttr' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:298: error: 'mxmlElementGetAttr' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:301: error: 'mxmlElementGetAttr' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:304: error: 'mxmlElementGetAttr' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:307: error: 'mxmlElementGetAttr' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:310: error: 'mxmlElementGetAttr' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:313: error: 'mxmlElementGetAttr' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:316: error: 'mxmlElementGetAttr' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:320: error: 'mxmlDelete' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp: In function 'void savePreferences()':
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:332: error: 'mxml_node_t' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:332: error: 'xml' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:333: error: 'data' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:334: error: 'mxmlNewXML' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:336: error: 'mxmlNewElement' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:340: error: 'mxmlElementSetAttr' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:376: error: 'MXML_NO_CALLBACK' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:376: error: 'mxmlSaveFile' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:378: error: 'mxmlDelete' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp: In function 'int main(int, char**)':
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:490: error: 'mem_open' was not declared in this scope
c:/devkitpro/examples/achtung_wii_kurve/source/main.cpp:2230: warning: suggest parentheses around '&&' within '||'
make[1]: *** [main.o] Error 1
"make": *** [build] Error 2

> Process Exit Code: 2
> Time Taken: 00:04


The line of code I added is in main.cpp near the top under the #include's and looks like this:
#define Vector guVector
Re: Compiling problem - exsiting source.
April 22, 2010 07:51AM
the grrlib files wont see the #define where you put it. how about you put it in the grrlib file itself?
portlibs are here [sourceforge.net]
Re: Compiling problem - exsiting source.
April 22, 2010 11:32AM
I have also encountered problems with compiling with the tremor/vorbis things. (I'm the author of Achtung Wii Kurve.) I suspect they're in some conflict with the newer versions of libogc, but I'm really not sure about that. (Please, enlighten me about this if you can. I've not been able to compile it since I updated libogc to r19 I think.) However, regarding the vector errors, I have a working source of Achtung Wii Kurve set up to work with newest GRRLIB which fixes those errors. You could PM me you e-mail and I'll send it to you.

In any case, I plan to rewrite the sound code of it to work with .mp3 files instead of .ogg and since there seems to be a demand for it I'll try to do this tonight if I just can find enough time to do it and doesn't run into unexpected problems.

Also, if I like your tweaks, I'd love to put them in the official version, if you don't mind :)
Re: Compiling problem - exsiting source.
April 23, 2010 12:55AM
Done!

I updated to newest GRRLIB and rewrote the sound part to handle .mp3 instead of .ogg.

For those interested, I think changing -ltremor to -lvorbisidec fixes the errors, but it isn't needed now as the sound code is rewritten. (I was told so after I had rewritten it, so I haven't checked.)

I also released this change as Achtung Wii Kurve v. 1.3, so you can just download it from the wiki.
Re: Compiling problem - exsiting source.
April 23, 2010 07:53AM
Alright, I think I'm going to try the new source to see if It get's any less errors. I'll post back when I test it.
Sorry, only registered users may post in this forum.

Click here to login