www.digitalmars.com Home | Search | C & C++ | D | DMDScript | News Groups | index | prev | next
Archives

D Programming
D
D.gnu
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.DMDScript

c++ - link: no start address if main is in the .lib not the .obj?

↑ ↓ ← "Luna Kid" <lunakid neuropolis.org> writes:
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
↑ ↓ "Luna Kid" <lunakid neuropolis.org> writes:
 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
→ "Nic Tiger" <tiger7 progtech.ru> writes:
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
"Walter" <walter digitalmars.com> writes:
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
↑ ↓ "Luna Kid" <lunakid neuropolis.org> writes:
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
"Walter" <walter digitalmars.com> writes:
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
↑ ↓ → "Luna Kid" <lunakid neuropolis.org> writes:
(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
→ "Wichetael" <wichetael gmx.net> writes:
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