[an error occurred while processing this directive] Node:djgpp_first_ctor, Next:, Previous:Still unresolved, Up:Compiling

8.12 Unresolved djgpp_first_ctor

Q: I do everything like your praised FAQ says, but the linker complains about unresolved symbols with strange names like djgpp_first_ctor, djgpp_last_dtor, etc. I looked in every library with nm, and I cannot find these creatures. Where in the world are they??

A: These symbols are defined by the djgpp.djl linker script that should be in your lib/ subdirectory. When you call gcc to link a program, it invokes ld.exe with the option -T djgpp.djl. If you invoke ld directly (this is generally not recommended), be sure to include that switch. If you did invoke it through gcc, maybe your linker is set up incorrectly. Add -v to the GCC switches and check that the command line that GCC gives to LD includes that switch, that your lib/ subdirectory includes that script file, and that the script file is intact and includes the definition of the above symbols.

Another reason might be that you have edited your DJGPP.ENV file in a way that prevents the linker from finding its djgpp.djl script.

Mixing an old v1.x installation with a v2.x one can also cause such problems. Be sure to delete the entire v1.x tree, or rename it, before installing the v2.x distribution.

[an error occurred while processing this directive]