Server Help

Trash Talk - Linking errors

Quan Chi2 - Sat Nov 12, 2005 7:19 pm
Post subject: Linking errors
What am I doing wrong? Excuse me if my C++ is bad. Im just trying to test WritePrivateProfileString.


Code: Show/Hide

#include <iostream>
#include "windows.h"

using namespace std;
//#pragma warning (disable : 4430)

int Fertigo()

WritePrivateProfileString("Stuff","1","You better wash the duck!","stuff.ini");
      {
         cout << "Stuff has been successfully written as a list.";
      }
      return 0;
}

void Menue()
{
   cout << "\nThis is a test program ued to write a list of stuff to do.\n";
   cout << "1 You better wash the duck!";
}

int read()
{
   int WriteIt;

   Menue();

   cout << "Choose your pick you punk! "; cin >> WriteIt;
   
   switch( WriteIt )
   {
   case 1 : Fertigo();
   }
   return 0;
}



I keep getting this:
Quote:

--------------------Configuration: Test - Win32 Debug--------------------
Compiling...
Test.cpp
Linking...
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/Test.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

Test.exe - 2 error(s), 0 warning(s)


Heh, I just copied most of the code from another program Im doing..
Donkano - Sat Nov 12, 2005 7:37 pm
Post subject:
You have no function labelled, "main".
Ex.
int main()
void main()
(Deactived B l a h e r) - Sat Nov 12, 2005 7:39 pm
Post subject:
Wow Quan is finally programming. I'de give you whats wrong but I have rpoblems understanding the stupid compilers debug output. Maybe if you use GNU it might be able to understand better on it telling you which line or where exactly the problem is but this sounds like a problem in the compile it's self or maybe in your "int Main" or void. It's kind of said you had to copy that easy of a program from another program.

P.s For some reason My msg is like right of Quan's post I think there is somthing wrong with this lay-out.
Mr Ekted - Sat Nov 12, 2005 7:50 pm
Post subject:
Once you get it working, don't forget...

If you do not prefix your INI file names with ".\\", then Windows will look for it or create it in the Windows folder.
Donkano - Sat Nov 12, 2005 7:54 pm
Post subject:
Mr Ekted wrote:
Once you get it working, don't forget...

If you do not prefix your INI file names with ".\\", then Windows will look for it or create it in the Windows folder.


Ya, that is the shitty thing with windows cause their directory browsing through programming is the pits. Yay for Linux!
(Deactived B l a h e r) - Sat Nov 12, 2005 7:58 pm
Post subject:
Donkano wrote:
[..]



Ya, that is the shitty thing with windows cause their directory browsing through programming is the pits. Yay for Linux!


Awww! The great conserversity over Programing and Windows directory. I spent a whole chapter in my Dummys book about reading about the poblems it can cause along with the /'s factors.
Quan Chi2 - Sat Nov 12, 2005 8:04 pm
Post subject:
lol blah-er, you mean its kind of sad that I have to copy and paste? lol Its not sad when its my own code from my own program.. or is it? tongue.gif I just wanted to do it quickly so I could get to what my main goal is to accomplish.
(Deactived B l a h e r) - Sat Nov 12, 2005 8:07 pm
Post subject:
Quan Chi2 wrote:
lol blah-er, you mean its kind of sad that I have to copy and paste? lol Its not sad when its my own code from my own program.. or is it? tongue.gif I just wanted to do it quickly so I could get to what my main goal is to accomplish.

Lol I thought you ment you took it from sombody eles program and put it in your own if you wanted a template like that.
Solo Ace - Sat Nov 12, 2005 8:58 pm
Post subject:
Donkano, even in Linux some actions default to a directory if nothing else was explicitly provided.
Please, don't "yay" Linux without knowing what you're talking about.
Spending 5 minutes in a Linux environment doesn't make you a guru or anything. icon_confused.gif
(Deactived B l a h e r) - Sat Nov 12, 2005 9:11 pm
Post subject:
Solo Ace wrote:
Donkano, even in Linux some actions default to a directory if nothing else was explicitly provided.
Please, don't "yay" Linux without knowing what you're talking about.
Spending 5 minutes in a Linux environment doesn't make you a guru or anything. icon_confused.gif

What are you talking about Unix, and Linux are OSs for gods. Every body has the right to priase them. And if your about to say I have no experience in them think again. I've worked with a Unix shell (Free BDS) multipual of times for a thing called IRC and EggDrop. I also used to have Linux as a OS but I needed more home type OS with a little better GUI then Unix.
Quan Chi2 - Sat Nov 12, 2005 9:14 pm
Post subject:
lol, but, can we kinda stay on topic icon_wink.gif

I just need to know what I did wrong in the code lol i'll look it up some more
(Deactived B l a h e r) - Sat Nov 12, 2005 9:20 pm
Post subject:
Quan Chi2 wrote:
lol, but, can we kinda stay on topic icon_wink.gif

I just need to know what I did wrong in the code lol i'll look it up some more
There is somthing wrong with you int main or void as sugested on the first two replies. I'de tell you what exactly you need to put but I'm sketchy with my "main".
Quan Chi2 - Sat Nov 12, 2005 10:03 pm
Post subject:
Problem solved. icon_smile.gif

I didn't make a main function.

Code: Show/Hide

#include <iostream>
#include "windows.h"

using namespace std;
//#pragma warning (disable : 4430)

int main()
{
      WritePrivateProfileString("Stuff","1","You better wash the duck!",".\\stuff.ini");
      {
         cout << "Stuff has been successfully written as a list.";
      }
      system("PAUSE");
}

void Menue()
{
   cout << "\nThis is a test program ued to write a list of stuff to do.\n";
   cout << "1 You better wash the duck!";
}

int read()
{
   int WriteIt;

   Menue();

   cout << "Choose your pick you punk! "; cin >> WriteIt;
   
   switch( WriteIt )
   {
   case 1 : main();
   }
   return 0;
}


Heh, lesson learned. I didn't know main was so important lol.

http://support.microsoft.com/?scid=kb;en-us;291952&spid=3042&sid=220

That explained it. tongue.gif
Muskrat - Sat Nov 12, 2005 11:52 pm
Post subject:
blah-er wrote:
a thing called IRC and EggDrop.
I think Solo is going to have a field day with this.
Mr Ekted - Sun Nov 13, 2005 12:01 am
Post subject:
Quan Chi2 wrote:
Problem solved. icon_smile.gif


Well, not quite. Now you have a main, but your Menue() and read() functions don't ever do anything (in case you expected them to).
Quan Chi2 - Sun Nov 13, 2005 7:48 am
Post subject:
Yea, I notcide that, thing is it writes.. so Im happy. I mixed everything up tongue.gif
(Deactived B l a h e r) - Sun Nov 13, 2005 8:11 am
Post subject:
Muskrat wrote:
[..]

I think Solo is going to have a field day with this.

He'll have to learn Pearl if he's to understand Eggdrop. http://eggheads.org/ should be of help and there's alittle explination on what IRC is and *BDS (Maybe he'll get confused that there is a SunOS lol). You can learn what IRC is at http://chatspike.net/index.php?z=5 and how it works is you'll have to do a google search on this one because I don't have any good sites on it besides talking to the friend (also the owner of chatspike). Have a nice field day icon_smile.gif Solo!
Quan Chi2 - Sun Nov 13, 2005 8:15 am
Post subject:
Heh, I didn't have to copy/paste the entire code anyway.. I didn't look at it properly doing things in a rush lol tongue.gif

All I needed was this.

Code: Show/Hide

#include <iostream>
#include "windows.h"

using namespace std;

int main()
{
      WritePrivateProfileString("Stuff","1","You better wash the duck!",".\\stuff.ini");
      WritePrivateProfileString("Stuff","2","Food!",".\\stuff.ini");
      WritePrivateProfileString("Stuff","3","MMMMM Good!",".\\stuff.ini");
      WritePrivateProfileString("Stuff","4","Stupid head!",".\\stuff.ini");
      {
         cout << "Stuff has been successfully written as a list.\n";
      }
      return 10;
}


heh heh.. tongue.gif
Solo Ace - Sun Nov 13, 2005 8:40 am
Post subject:
I used IRC before you were born, blah-er, silly troll.

I'd actually prefer Python since it's the language I'm currently using, but thanks, I know some PERL already.

If you're promoting Linux, then do it in the right way, don't start giving out wrong ideas about the differences between Windows and Linux when they're not true.
He's the same guy who tried to tell us Linux runs on UNIX.
When promoting something make sure you're promoting it the right way.

Oh and blah-er, it's called "BSD", get it right.
(Deactived B l a h e r) - Sun Nov 13, 2005 9:02 am
Post subject:
Solo Ace wrote:
I used IRC before you were born, blah-er, silly troll.

I'd actually prefer Python since it's the language I'm currently using, but thanks, I know some PERL already.

If you're promoting Linux, then do it in the right way, don't start giving out wrong ideas about the differences between Windows and Linux when they're not true.
He's the same guy who tried to tell us Linux runs on UNIX.
When promoting something make sure you're promoting it the right way.

Oh and blah-er, it's called "BSD", get it right.

Wow you were 3 or 2 when you started IRC. Thank you for reading my post for once this time. Ok I agree with you on the promoting Linux. Thank you for correcting me Look down below at my Sig tongue.gif. BTW You missed me spelling Perl wrong as Pearl. Now to decide to ignore you from now on your keeping the chance to feed off of you every time you step into my comments and trying to make me seem foolish?
Solo Ace - Sun Nov 13, 2005 9:20 am
Post subject:
I do read your posts, you just have a problem saying what you mean in a proper way.

I have signatures turned off.
I have you on ignore since 2 weeks or so, but I decided to make you look more stupid than you already did by yourself, and obviously I did a good job.
newb - Sun Nov 13, 2005 9:22 am
Post subject:
You are foolish.
(Deactived B l a h e r) - Sun Nov 13, 2005 9:23 am
Post subject:
Ya I'm deciding Ignored read my post http://forums.minegoboom.com/viewtopic.php?p=52338#52338
newb - Sun Nov 13, 2005 9:40 am
Post subject:
Yeah, read it again.
Quan Chi2 - Sun Nov 13, 2005 10:34 am
Post subject:
This topic should be locked.
Purge - Sun Nov 13, 2005 12:20 pm
Post subject:
It's trash talk. Keep talking shit.
Anonymous - Wed Nov 16, 2005 5:41 am
Post subject:
K.

"Hi I'm blah-er and I love *nix because I've logged into a chrooted jail shell once"
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group