0

I have edited out a lot of my original situation to try keep things simple; it can be seen in the revisions.

Basically I have been following a tutorial in which a game engine is being created.

Most of the code has been separated into its own CodeLite project and successfully compiled into a static library (libbengine.a using mingw32 via TDM-GCC-32).

(For the record, the code compiled fine before separation)

Back in the main game code (main.cpp, etc) the compiler knows the relevant include and lib directories and compilation can at least locate the necessary headers and lib.

However, I get this error: undefined reference to '__glewCreateProgram'

Any ideas as to what is getting lost in translation (so-to-speak)?

I have been reading around all over the place; researching compilation, static libraries, ar.exe, but am having no luck (I am still looking).

If you want any more pertinent information, I will happily provide it; for now I shan't clog up the post any further.

Cheers


To give a basic idea of the error in CodeLite:

codelite layout with error

Main project linker settings:

main project linker settings

bengine project linker settings (compiled as static lib.a):

engine project linker settings

berilac
  • 48
  • 1
  • 7

1 Answers1

0

It seems the problem was solely with linking order. As can be seen in the second image in my question (Main linker setting) - "Bengine" should have been at the top of the list, not the bottom.

This may be mingw32 specific; I am not sure.

Well, after all those hours, I feel somewhat foolish... At least I have learned some things along the way.

berilac
  • 48
  • 1
  • 7