Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Error while making .exe
Index -> Programming, C++ -> C++ Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Schaef




PostPosted: Tue Sep 21, 2004 5:36 pm   Post subject: Error while making .exe

I keep getting this error when trying to make my .exe file:

Linking...
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/hi.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

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


This is all i am doing for the coding

code:
#include <iostream>
using namespace std;

int main(void)
{
        cout << "Hi" ;
        return 0;
}


ne ideas on why i am getting this error??
Sponsor
Sponsor
Sponsor
sponsor
bugzpodder




PostPosted: Tue Sep 21, 2004 5:45 pm   Post subject: (No subject)

it seems that you are trying to compile under VC++6... see if this works. just copy the contents, and start a new file (no projects) and paste it into the file. compile (the compiler should ask you for a new project/workspace, etc)
Andy




PostPosted: Tue Sep 21, 2004 7:19 pm   Post subject: (No subject)

well my guess is the same wit bugz's except u are returning a value while ur main function is void... that mite do something... also make sure the last run window is closed before you compile... sometimes it screws it up
wtd




PostPosted: Tue Sep 21, 2004 7:47 pm   Post subject: (No subject)

His main function returns int. The "void" in there indicates that the function takes no arguments.
Andy




PostPosted: Tue Sep 21, 2004 8:17 pm   Post subject: (No subject)

fo shizzle? i thought if u had void inside the arguments, u dont need to return a value... hmm o wells, i usually juss do void func()
wtd




PostPosted: Tue Sep 21, 2004 8:31 pm   Post subject: (No subject)

code:
return_type function_name(argument_type argument_name)


And a "function" which doesn't return anything is a procedure.

If you want to be strict, functions return values, but don't change non-local variables. Procedures don't return a value, but they can change whatever they want. Functions can be called from within procedures, but procedures can't be called from functions.
Display posts from previous:   
   Index -> Programming, C++ -> C++ Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 6 Posts ]
Jump to:   


Style:  
Search: