unresolved external symbol problem

Started by
31 comments, last by _WeirdCat_ 9 years, 10 months ago

Linking with the gnu linker ld has some issues about the order the libraries are on the command line. MS linker do a recursive linking, means go along the named libraries as often as there are unresolved symbols.

ld does not.

If you habe -lgl -lglew then glew may add symbols that need imported from gl but because gl has already been used you get an unresolved external message.

To come around this behaviour of ld surround the list of libraries with --start-group --end-group parameter. Then ld goes along the libraries between these tags as long as needed to resolve all externals, stopping if no more symbols can be resolved.

If you call the gcc or g++ compiler driver to do the linking newer versions of gcc/g++, dont know the version number yet, accept -Wl,--start-group -Wl,--end-group to build library groups.

Advertisement

That suggests linking works fine now and you are just stuck with runtime errors. Have you verified that glewInit is called at the correct time and succeeds? Have you verified that the functionality you want to use is actually provided by your driver?

I tried glewInit And it worked Thank you! . Thank you all.

glewinit initializes all extensions defined in glew.h

Posted 03 June 2014 - 08:22 PM

WiredCat, on 03 Jun 2014 - 6:37 PM, said:

in header add:
PFNGLMULTIDRAWELEMENTSPROC glMultiDrawElements; //name it whatever you want

and in cpp file: you need to initalize it

Its more than 10000 Lines where should i add it?

you should add it after creating opengl context, (usually in glinit function)

This topic is closed to new replies.

Advertisement