-
Source code
ok so i got this source code and i need to compile it, but it wont let me compile it because its giving me some errors and i dont know how to fix them im using dev-C++ complier if someones willing to help maybe look at the code and see if theirs errors"?
-
Sure. Post the code here, and if possible, the errors you're getting.
-
Yeah, we'll need those errors.
-
ok well the code is to long so its not letting me type it all in, any other way?
-
Split it into two posts or upload it to [url]www.divshare.com[/url].
-
[url]http://www.divshare.com/download/50****-*e2[/url]
-
And what errors are you getting? I'm in Linux right now, so can't compile it myself.
EDIT: Didn't see the text below the code. I'll read it now.
It doesn't look like the whole error messages are in the file. They seem to cut off.
Also, did you link libraries like ws2_*2 (I think) into the program? That's usually the cause with things like this.
-
[QUOTE=mike*5*;**868]And what errors are you getting? I'm in Linux right now, so can't compile it myself.
EDIT: Didn't see the text below the code. I'll read it now.
It doesn't look like the whole error messages are in the file. They seem to cut off.
Also, did you link libraries like ws2_*2 (I think) into the program? That's usually the cause with things like this.[/QUOTE]
well no and yes, i tried linking ws2 into the library but i dont think i did it in the right spot, btw did you try compiling it/? if so did it give you a error? maybe ill try something will edit soon
Edit: yah linking the ws2*2 didnt help, and my pc crashing didnt help the progress either i was downloading linux xp and my pc crashed anyone know how i can recover the file? it was done but ii didnt open it,
-
[QUOTE=mlg solidsnake;**870]well no and yes, i tried linking ws2 into the library but i dont think i did it in the right spot, btw did you try compiling it/?[/QUOTE]
I'm in Ubuntu (Linux) right now, so can't compile it as that code is for Windows.
-
Ahh, alright.. ill just get another code, or just write my own in vb..
-
I think I see what the problem is.
The highlited error is given because the function get_keys() is a type void function. Functions with type void do not return an assignable value.
In other words, you cannot assign the result of a type void function to an int, char, bool, or any other type of variable. For example:
[CODE]
//psuedocode, may not be correct syntax, but a general idea
int blah(x)
{
X*2
}
[/CODE]
The function blah() will take user input and do something. You can then assign this to something. So if the user entered 6, he would get the number *2 and be able to assign *2 to another variable.
Void functions are usually just for repetitive tasks, such as re*****ing the screen every minute, and other such tasks.
-
That's true Moonbat, but the function returns an integer (int). The void is in between the ( and ) to indicate that it takes no parameters. Without the full errors, there's not really much I can say, apart from I don't think you've linked in all the necessary libraries for Windows, or perhaps you are trying to compile this code as a C++ project in Dev-Cpp when in fact it is C code. I thought they were interchangeable, but it's something to try.
-
A function that takes no parameters (a void function) cannot return an assignable value. So therefore, even if the overall function does return an int, you can't assign it to any other variable.
-
[QUOTE=Moonbat;**888]A function that takes no parameters (a void function) cannot return an assignable value. So therefore, even if the overall function does return an int, you can't assign it to any other variable.[/QUOTE]
Though I haven't done any C++ programming in a while, I know that functions that take no parameters can return values if they're not preceded by void. Functions' return values are dictated by the type stated before them,
[CODE]
int SomeFunction()
{
/* Do something */
return *;
}
int aaa = 0;
aaa = SomeFunction();[/CODE]
In this case, SomeFunction returns an integer. It has no parameters.
A function declared to return void, however, can't return anything -- it has no return statement:
[CODE]void SomeFunction()
{
/* Do something */
}
SomeFunction();[/CODE]
[QUOTE]A function that takes no parameters (a void function) cannot return an assignable value. [/QUOTE]
A void function in my definition is a function declared as type void (void SomeFunction()). One that doesn't take any parameters is just a function without parameters.
-
Ah, okay, I was getting a little confused.
The get_keys() function in the keylogger code was written int get_keys(void). I got a little confused.