c++ - link: no start address if main is in the .lib not the .obj?
- Luna Kid (7/7) May 12 2003 I can't seem to rebuild some older stuff I developed
I can't seem to rebuild some older stuff I developed with an other compiler (LCC). I get "no start address" from link, but there *is* a _main in the library I try linking my test.obj against. (That test.obj has callback functions only.) Thanks, Sz.
May 12 2003
I get "no start address" from link, but there *is* a _main in the library I try linking my test.obj against. (That test.obj has callback functions only.)Yes, it really seems to be a problem. At least it disappears when I name explicitly (in the link command line) that module of the .lib which contains _main. Is there a better way? (A "secret" link option, perhaps?) Cheers, Sz.
May 12 2003
Add switch to LINK command line /ENTRY:WinMainCRTStartup Or use appropriate func name instead of WinMainCRTStartup (see run-time library sources) You also can declare extern "C" int _acrt_used or similar variable and access it; this will cause appropriate startup code to link in, and then that code will in turn call main() and link in all other modules. Nic Tiger. "Luna Kid" <lunakid neuropolis.org> wrote in message news:b9p8es$2vtu$1 digitaldaemon.com...I get "no start address" from link, but there *is* a _main in the library I try linking my test.obj against. (That test.obj has callback functions only.)Yes, it really seems to be a problem. At least it disappears when I name explicitly (in the link command line) that module of the .lib which contains _main. Is there a better way? (A "secret" link option, perhaps?) Cheers, Sz.
May 12 2003
You need to have a main() to have a start address. See www.digitalmars.com/ctg/actrused.html "Luna Kid" <lunakid neuropolis.org> wrote in message news:b9p8es$2vtu$1 digitaldaemon.com...I get "no start address" from link, but there *is* a _main in the library I try linking my test.obj against. (That test.obj has callback functions only.)Yes, it really seems to be a problem. At least it disappears when I name explicitly (in the link command line) that module of the .lib which contains _main. Is there a better way? (A "secret" link option, perhaps?) Cheers, Sz.
May 12 2003
Thanks Walter, but you seem to have replied to my Subject line, not the message. ;-) (I *do* have main(), it's just in a LIB, not in an .OBJ module. Don't bother, though, I can live with the current workaround.) Cheers, Sz. "Walter" <walter digitalmars.com> wrote in message news:b9q7sh$rmd$2 digitaldaemon.com...You need to have a main() to have a start address. See www.digitalmars.com/ctg/actrused.html "Luna Kid" <lunakid neuropolis.org> wrote in message news:b9p8es$2vtu$1 digitaldaemon.com...I get "no start address" from link, but there *is* a _main in the library I try linking my test.obj against.
May 13 2003
I read your message, I guess I didn't understand the problem, then. "Luna Kid" <lunakid neuropolis.org> wrote in message news:b9q9es$t9b$1 digitaldaemon.com...Thanks Walter, but you seem to have replied to my Subject line, not the message. ;-) (I *do* have main(), it's just in a LIB, not in an .OBJ module. Don't bother, though, I can live with the current workaround.) Cheers, Sz. "Walter" <walter digitalmars.com> wrote in message news:b9q7sh$rmd$2 digitaldaemon.com...You need to have a main() to have a start address. See www.digitalmars.com/ctg/actrused.html "Luna Kid" <lunakid neuropolis.org> wrote in message news:b9p8es$2vtu$1 digitaldaemon.com...I get "no start address" from link, but there *is* a _main in the library I try linking my test.obj against.
May 13 2003
(OK, sorry, I guess I was not that funny with that comment then... ;) ) "Walter" <walter digitalmars.com> wrote in message news:b9qd8p$10ke$4 digitaldaemon.com...I read your message, I guess I didn't understand the problem, then. "Luna Kid" <lunakid neuropolis.org> wrote in message news:b9q9es$t9b$1 digitaldaemon.com...Thanks Walter, but you seem to have replied to my Subject line, not the message. ;-) (I *do* have main(), it's just in a LIB, not in an .OBJ module. Don't bother, though, I can live with the current workaround.) Cheers, Sz. "Walter" <walter digitalmars.com> wrote in message news:b9q7sh$rmd$2 digitaldaemon.com...You need to have a main() to have a start address. See www.digitalmars.com/ctg/actrused.html "Luna Kid" <lunakid neuropolis.org> wrote in message news:b9p8es$2vtu$1 digitaldaemon.com...I get "no start address" from link, but there *is* a _main in the library I try linking my test.obj against.
May 13 2003
I experienced the same problems with linking the SDL library from www.libsdl.org which also provides the entry point within a library file. Thankfully I could get to work by either linking the extracted object file or providing the entry point by the /ENTRY switch, but it would be much cleaner if the linker would also look for the entry point in library files and not just object files. Regards, Remko van der Vossen "Luna Kid" <lunakid neuropolis.org> wrote in message news:b9q9es$t9b$1 digitaldaemon.com...Thanks Walter, but you seem to have replied to my Subject line, not the message. ;-) (I *do* have main(), it's just in a LIB, not in an .OBJ module. Don't bother, though, I can live with the current workaround.) Cheers, Sz. "Walter" <walter digitalmars.com> wrote in message news:b9q7sh$rmd$2 digitaldaemon.com...You need to have a main() to have a start address. See www.digitalmars.com/ctg/actrused.html "Luna Kid" <lunakid neuropolis.org> wrote in message news:b9p8es$2vtu$1 digitaldaemon.com...I get "no start address" from link, but there *is* a _main in the library I try linking my test.obj against.
Jun 07 2003