Undefined ref. error crt1.o w/ nvidia nwbie please help

Hello,

I am working my way through an OpenGl programming book doing some simple examples. I just got openGL working with the Nvidia drivers. I just ran into a new error.

/usr/lib/gcc-lib/i586-mandrake-linux-gnu/2.96/…/…/…/crt1.0: in function ‘_start’:
undefined reference to ‘main’
collect2: ld returned 1 exit status

any ideas.

ALSO:
in general, how do you diagnose these types of undefined reference errors?

Thanks a lot,
Sam

Nevermind, envoking the compiler with cc instead of gcc seems to solve the problem. Anyone have a reason why?

sh

The real problem is that you forgot to link in a “main” function, either because you didn’t write one or you forget to include the object that contains “main” in your link.

On mandrake, cc is just a symlink to gcc, so you probably solved your problem by including the right objects the second time around.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.