extern "C" {
#include "_Headers_here_"
}
Printable View
extern "C" {
#include "_Headers_here_"
}
That wasnt the problem , i did that in the headers , no i was forgotten to set up some macro's that i always use , nvm:p
Oh god.
Whenever I compile anything, it will come up with the error:
main.cpp: UNDEFINED REFRENCE OF [variable_name] AT C:/[Location_name].
I searced it, and at the location it spits at me, it shows no reference, and there is no refrence, anyone know what the problem is? (Let me guess...I coded the program wrong?)
EDIT: I tried to compile a hello world, just to make sure, and it gave me the same error...
Post the code.
Oh, alow! :ROFL:
Will passing variables as arguments instead of direct arguements add overhead time just like functions do when called? [Donot say -- it's a tenth-tenth of a sec or something a& it doesn't matter] --- IT does for me, that time is so valuable for me...
My assumption is, it doesn't make a difference because even the direct argument as well as a variable reside in some memory location --- which the function has to fetch... Am I right?
------
I am so concerned becz the variable changes every once per function call, in that function a lot of sub functions use this variable....
Zitat:
Zitat von yaustar
Like I said, I used a hello world for a test.Code:
#include <pspkernel.h>
#include <pspdebug.h>
PSP_MODULE_INFO("Test Hello World:, 0, 1, 1);
#define printf pspDebugScreenPrintf
/* I don't want to post callbacks here, takes to much space up, but they ARE in my code */
int main() {
SetupCallbacks();
pspDebugScreenInit();
printf("Test Hello World.");
sceKernelSleepThread();
return 0;
}
It gives me the error of the refrence of SetupCallbacks();
Show ALL the code ¬¬Zitat:
Zitat von MrChaos
-= Double Post =-
Depends on a large number of factors.Zitat:
Zitat von Mr305
Are you passing by pointer?
Are you passing by reference?
Are you passing by value?
What type are the objects being passed?
What do you mean by direct argurements?
Do you have the code in question to post up?
Zitat:
Zitat von yaustar
makefileCode:
#include <pspkernel.h>
#include <pspdebug.h>
PSP_MODULE_INFO("Test Hello World", 0, 1, 1);
#define printf pspDebugScreenPrintf
/* Exit callback */
int exit_callback(int arg1, int arg2, void *common) {
sceKernelExitGame();
return 0;
}
/* Callback thread */
int CallbackThread(SceSize args, void *argp) {
int cbid;
cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
sceKernelRegisterExitCallback(cbid);
sceKernelSleepThreadCB();
return 0;
}
/* Sets up the callback thread and returns its thread id */
int SetupCallbacks(void) {
int thid = 0;
thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, 0, 0);
if(thid >= 0) {
sceKernelStartThread(thid, 0, 0);
}
return thid;
}
int main() {
SetupCallbacks();
pspDebugScreenInit();
printf("Test Hello World.");
sceKernelSleepThread();
return 0;
}
Code:
TARGET = hello
OBJS = main.cpp
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Hello World Test
PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
1.) PSP_MODULE_INFO("Test Hello World:, 0, 1, 1);Zitat:
Zitat von MrChaos
See the error?
2.) It gives me the error of the refrence of SetupCallbacks();
Undefined reference to the function SetupCallbacks.
It will give you that error if you remove the callbacks from the program, and try to call a nonexistent function. Just remove SetupCallbacks(); or put the callbacks in.
yaustar, I tried again, and heres the errors:
/cygdrive/c/DOCU~1/Owner/LOCALS~1/Temp/cc2wayHC.o:(.eh_frame+0x1 1): undefined reference to '__gxx_personality_v0'
Moca: Yeah, I saw that, and fixed it.
Moca: I removed the callbacks and SetupCallbacks();...no help.
Zitat:
Zitat von MrChaos
Should be:Code:OBJS = main.cpp
Code:OBJS = main.o
Zitat:
Zitat von yaustar
Lol! I feel stupid. Thanks.
One time I had to change it to main.cpp, now I gotta change it back to main.o..hehe.
Thanks again.
I'm having trouble installing libtools under Cygwin. It seems like one file cannot be compiled. Here are the last messages before the activity stopped.
Code:Making all in .
make[1]: Entering directory `/home/JustChris/libtool'
CONFIG_FILES=libtoolize CONFIG_HEADERS= /bin/sh ./config.status
config.status: creating libtoolize
config.status: executing depfiles commands
chmod +x libtoolize
make[1]: Leaving directory `/home/JustChris/libtool'
Making all in libltdl
make[1]: Entering directory `/home/JustChris/libtool/libltdl'
make all-am
make[2]: Entering directory `/home/JustChris/libtool/libltdl'
/bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.
-g -O2 -c -o ltdl.lo ltdl.c
mkdir .libs
gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -c ltdl.c -DPIC -o .libs/ltdl.o
ltdl.c: In function `find_handle_callback':
ltdl.c:2787: error: `R_OK' undeclared (first use in this function)
ltdl.c:2787: error: (Each undeclared identifier is reported only once
ltdl.c:2787: error: for each function it appears in.)
make[2]: *** [ltdl.lo] Error 1
make[2]: Leaving directory `/home/JustChris/libtool/libltdl'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/JustChris/libtool/libltdl'
make: *** [all-recursive] Error 1
mayby you need another lib for that
hey guys, im plannin to reformat my laptop but my cygwin is on the C drive.. so im burnin my whole cygwin folder into a dvd... will it work? im on a low dsl connection and itll be a pain if i reinstall cygwin again :(
nope, not working :( what will i do to make my cygwin on dvd work? please help ...
just back it up on dvd and recopy it after formatting
-= Double Post =-
I know this fucnton will be slow , how can i speed it up?(make it faster)Code:string fileList[222];
void getFileList(const char *path)
{
SceUID bufferFile;
char nextPath[256];
int z = 0;
bufferFile = sceIoDopen(path);
if(bufferFile > 0)
{
SceIoDirent dir;
memset(&dir, 0, sizeof(SceIoDirent));
while(sceIoDread(bufferFile, &dir) > 0)
{
strcat(fileList[z].c_str() , path);
z++;
if(z > 222 ) break;
}
sceIoDclose(bufferFile);
}
}
hallo - Does the term 'registry' mean anything to you? You can burn your whole cygwin folder to a dvd (even though itll fit on a CD-R at ~500 mb) but after you recopy it back, youll need to make some registry additions. To do this, you could go into your registry and find the Cygnus registry folders and copy them to that DVD as well. Then once you've reformatted, enter the Cygnus registry folders back into the registry where they were before you formatted.
no never heared about it
System registry is one of the basic fundamentals of a Windows system... -_-Zitat:
Zitat von hallo007
Zitat:
Zitat von SG57
easier way:
1. copy cygwin to the formatted harddrive.
2. download and install cygwin again to restore the registry keys.
3. DONT install the toolchain. That has already been done with the copy.
Installing cygwin shouldnt even take that long. maybe 1 hour. Unless you dont want to wait that long, then good luck with another method.
I'm looking for a tutorial on installing the Compiler and everything on Linux... I don't want to screw up GCC and everything because I'm using Gentoo... (In which everything is built and doesn't use packages)
Thanks,
IchigoKurosaki
Nobis Development Group
Has anyone figured out my Libtools installation problem? Hallo007 said it could be a missing lib but I don't know which one it could be.
I'm installing a new version of Libtools because I wanted to setup FreeType2. When I run the first shell script for that, the "libtoolize" command is not found. But now I'm also having problems installing Libtools too! (the message text is in my previous post)
http://www.psp-programming.com/code/...chain_on_linuxZitat:
Zitat von IchigoKurosaki
Thanks ^^Zitat:
Zitat von hallo007
the psp doenst see a different between image.png and IMAGE.PNG does it?
well the psp does see differents bitween IMAGE and image :S realy stupid
windows doenst, are u sure?
I wouldn't think so.Zitat:
Zitat von hallo007
I'm pretty sure the PSP is Case Sensitive... Much like a UNIX/Linux Operating System...
thnx
No it doesn't.Zitat:
Zitat von Kwastie
No, the PSP is not case sensitive when dealing with folders and files.Zitat:
Zitat von IchigoKurosaki
I'm planning on learning c. Can someone pm a good link on where to start? I downloaded Dev-C++. It all looks a little much for me. I would just like a simple tutorial that takes me slowly. BTW, I know a little LUA.
[LINK]
Read that. ^^
Thank you:)
My aswell not post again,
Thanks to the poster below me too.
If you're looking for some very basic tutorials, there are several here:
http://www.cprogramming.com/tutorial.html#ctutorial
They aren't exactly comprehensive, but they will at least introduce you to the concepts. If you only know a little Lua, that probably just means you've learned some syntax, which won't help you much. You'll need a book to get more depth, and if you have the means a hard copy would be preferable to an online copy, just to save your eyes and your Alt and Tab keys. If you'd rather not spend any money, there are plenty of ebooks floating around that you'll find with a minimal amount of Googling.
Or to make it simple on you, check out this post on Evilmana.com:
http://forums.evilmana.com/index.php?topic=98.0
why cant i include this in two sources
i get multiple defenition error:sCode:#ifndef _VARIABELS_H_
#define _VARIABELS_H_
#include <string>
string fileList[222];
#endif
Check your other files' headers.
++ B.
You have an error in that code to start off with:Zitat:
Zitat von hallo007
Code:#ifndef _VARIABELS_H_
#define _VARIABELS_H_
#include <string>
std::string fileList[222];
#endif
nono , i used using namespace std; at the beginning of the source;-)
there arent any other errors;)
If you are dealing with shared global variables (ick), this is how you should do it:
variabels.h
Code:#ifndef _VARIABELS_H_
#define _VARIABELS_H_
#include <string>
extern std::string fileList[222];
#endif
variabels.cpp
We need to source to other files if you are still getting redefinition errors.Code:#include <string>
std::string fileList[222];