wtf???

Started by
25 comments, last by StoNeD_TrOLL 22 years, 3 months ago
Im using CodeWarrior Learning Edditon.My project has two files that have no flaws(made sure).When i got to run my project i get a link error about something wrong with main in both files.Whats wrong here?
Advertisement
please list the exact error message, and you''ll probably get a more appropriate response.

To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.
To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.
did u check to make suere that u have the proper header fies included? u sould also make suer u have the proper .lib files included

,Matt

-= kill one, your a murderer, kill thousands your a conquerer =-
-= kill one you're a murderer, kill thousands you're a conquerer =-
#include <iostream> is a header file right?
and i dont know what .lib files are.
here are the errors:
Link Error : multiply-defined ''main'' (descriptor)
Defined in bkla.cpp
Defined in HelloWorld.cp

Link Error : multiply-defined ''main'' (code)
Defined in bkla.cpp
Defined in HelloWorld.cp

Have you got more than one WinMain or main() function? If so, that''s your problem right there.
Opps.That was me.
quote:Original post by Anonymous Poster
Have you got more than one WinMain or main() function? If so, that''s your problem right there.

wait,i only need one main out of my two files?
Only one main, always remember that.

By the way, anything that is a .h is a header file. Header files basically are used to include the .lib in your program, but you have to add the .lib to your project. If your not using an API like Windows or DX/OpenGL, you don't have to worry about .libs yet.

You only need one main in your whole project, because you are including the other files which are connected to the file that has main in it.
------------------------------
Simple DirectMedia Layer:

Main Site - (www.libsdl.org)
Cone3D Tutorials- (cone3D.gamedev.net)
GameDev.net's Tutorials - (Here)

OpenGL:

Main Site - (www.opengl.org)
NeHe Tutorials - (nehe.gamedev.net)
Online Books - (Red Book) (Blue Book)


Edited by - Drizzt DoUrden on January 12, 2002 12:39:20 PM
------------------------------Put THAT in your smoke and pipe it
quote:Original post by Drizzt DoUrden
Only one main, always remember that.
------------------------------------------------------
I know one main per a file, but do you mean one main out of all my files in my project??

definitely one "main" per project. the linker looks for a function named "main" and sets the program to start here. thus if there were two "main"''s then it wouldn''t know which one to choose.

To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.
To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.

This topic is closed to new replies.

Advertisement