www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - Application fails to reach main

reply Ant <Ant_member pathlink.com> writes:
seems this happend in two separate apps/environments/people.

only on windows, dmd 0.102

the application fails to reach the main function
or any of the static constructors.

there is no small example yet.
this post is just trying to get the attention of other
pleople with the same problem.

my application compiles and runs fine on linux.
there considerable changes from linux to windows
but not on the code directly envolved after 
commenting out large sections of it.

see thread:
digitalmars.D/11562

Ant
Oct 08 2004
parent reply "Walter" <newshound digitalmars.com> writes:
"Ant" <Ant_member pathlink.com> wrote in message
news:ck679j$1j96$1 digitaldaemon.com...
 the application fails to reach the main function
 or any of the static constructors.

Perhaps try instrumenting the dmain2.d file in phobos\internal.
Oct 08 2004
next sibling parent Ant <duitoolkit yahoo.ca> writes:
On Fri, 08 Oct 2004 16:02:24 -0700, Walter wrote:

 "Ant" <Ant_member pathlink.com> wrote in message
 news:ck679j$1j96$1 digitaldaemon.com...
 the application fails to reach the main function
 or any of the static constructors.

Perhaps try instrumenting the dmain2.d file in phobos\internal.

thanks, I'll try it. Ant
Oct 07 2004
prev sibling parent reply Ant <duitoolkit yahoo.ca> writes:
On Fri, 08 Oct 2004 16:02:24 -0700, Walter wrote:

 "Ant" <Ant_member pathlink.com> wrote in message
 news:ck679j$1j96$1 digitaldaemon.com...
 the application fails to reach the main function
 or any of the static constructors.

Perhaps try instrumenting the dmain2.d file in phobos\internal.

yeah, I put one printf before each statement on dmain2. they all show on stdout when compiling phobos through the win32.mak, some before the "success!" some after. they all show when I run a helloworld program, UNLESS I link to my lib, even if the lib if not used at all. in that case nothing is printed out, no messages of errors. any body out there is compiling programs with libs beside phobos? we know that the other example also fails (apollo from Carlos). so seems there is some problem with linking to libs(?) what other tests can I do? Ant
Oct 11 2004
next sibling parent Ant <duitoolkit yahoo.ca> writes:
On Mon, 11 Oct 2004 18:25:32 -0400, Ant wrote:

 On Fri, 08 Oct 2004 16:02:24 -0700, Walter wrote:
 
 "Ant" <Ant_member pathlink.com> wrote in message
 news:ck679j$1j96$1 digitaldaemon.com...
 the application fails to reach the main function
 or any of the static constructors.

Perhaps try instrumenting the dmain2.d file in phobos\internal.

yeah, I put one printf before each statement on dmain2. they all show on stdout when compiling phobos through the win32.mak, some before the "success!" some after. they all show when I run a helloworld program, UNLESS I link to my lib, even if the lib if not used at all. in that case nothing is printed out, no messages of errors. any body out there is compiling programs with libs beside phobos? we know that the other example also fails (apollo from Carlos). so seems there is some problem with linking to libs(?) what other tests can I do?

I would try it with dmd 0.101 if I can get it. Of course this might be some problem with my code but I should get some error message. Ant
Oct 11 2004
prev sibling next sibling parent reply Derek Parnell <derek psych.ward> writes:
On Mon, 11 Oct 2004 18:25:32 -0400, Ant wrote:


[snip]
 
 any body out there is compiling programs with libs beside phobos?

Yes, I'm doing that and not having any problems. Win XP system. Libraries that I've created from compiling D source code and using the "dm\bin\lib -c" command. -- Derek Melbourne, Australia 12/10/2004 9:29:07 AM
Oct 11 2004
parent Ant <duitoolkit yahoo.ca> writes:
On Tue, 12 Oct 2004 09:31:13 +1000, Derek Parnell wrote:

 On Mon, 11 Oct 2004 18:25:32 -0400, Ant wrote:
 
 
 [snip]
  
 any body out there is compiling programs with libs beside phobos?

Yes, I'm doing that and not having any problems. Win XP system. Libraries that I've created from compiling D source code and using the "dm\bin\lib -c" command.

Well, it doesn't work for me. once again DUI and leds for windows are waiting for the next dmd version. Ant
Oct 11 2004
prev sibling parent reply "Ben Hinkle" <bhinkle mathworks.com> writes:
"Ant" <duitoolkit yahoo.ca> wrote in message
news:pan.2004.10.11.22.25.32.19933 yahoo.ca...
 On Fri, 08 Oct 2004 16:02:24 -0700, Walter wrote:

 "Ant" <Ant_member pathlink.com> wrote in message
 news:ck679j$1j96$1 digitaldaemon.com...
 the application fails to reach the main function
 or any of the static constructors.

Perhaps try instrumenting the dmain2.d file in phobos\internal.

yeah, I put one printf before each statement on dmain2. they all show on stdout when compiling phobos through the win32.mak, some before the "success!" some after. they all show when I run a helloworld program, UNLESS I link to my lib, even if the lib if not used at all. in that case nothing is printed out, no messages of errors. any body out there is compiling programs with libs beside phobos? we know that the other example also fails (apollo from Carlos). so seems there is some problem with linking to libs(?) what other tests can I do? Ant

are you sure it is running the right main? Is there a WinMain or something? It seems odd that just linking will prevent startup from getting to dmain2.
Oct 12 2004
next sibling parent Ant <Ant_member pathlink.com> writes:
In article <ckgs9c$s4t$1 digitaldaemon.com>, Ben Hinkle says...
"Ant" <duitoolkit yahoo.ca> wrote in message
news:pan.2004.10.11.22.25.32.19933 yahoo.ca...
 On Fri, 08 Oct 2004 16:02:24 -0700, Walter wrote:

 "Ant" <Ant_member pathlink.com> wrote in message
 news:ck679j$1j96$1 digitaldaemon.com...
 the application fails to reach the main function
 or any of the static constructors.

Perhaps try instrumenting the dmain2.d file in phobos\internal.

yeah, I put one printf before each statement on dmain2. they all show on stdout when compiling phobos through the win32.mak, some before the "success!" some after. they all show when I run a helloworld program, UNLESS I link to my lib, even if the lib if not used at all. in that case nothing is printed out, no messages of errors. any body out there is compiling programs with libs beside phobos? we know that the other example also fails (apollo from Carlos). so seems there is some problem with linking to libs(?) what other tests can I do? Ant

are you sure it is running the right main? Is there a WinMain or something? It seems odd that just linking will prevent startup from getting to dmain2.

I'm afraid I'm not sure... But, why would it change the main when I link to my lib? How can I be sure? Ant
Oct 12 2004
prev sibling parent reply Ant <Ant_member pathlink.com> writes:
In article <ckgs9c$s4t$1 digitaldaemon.com>, Ben Hinkle says...
"Ant" <duitoolkit yahoo.ca> wrote in message
news:pan.2004.10.11.22.25.32.19933 yahoo.ca...
 On Fri, 08 Oct 2004 16:02:24 -0700, Walter wrote:

 "Ant" <Ant_member pathlink.com> wrote in message
 news:ck679j$1j96$1 digitaldaemon.com...
 the application fails to reach the main function
 or any of the static constructors.

Perhaps try instrumenting the dmain2.d file in phobos\internal.

yeah, I put one printf before each statement on dmain2. they all show on stdout when compiling phobos through the win32.mak, some before the "success!" some after. they all show when I run a helloworld program, UNLESS I link to my lib, even if the lib if not used at all. in that case nothing is printed out, no messages of errors. any body out there is compiling programs with libs beside phobos? we know that the other example also fails (apollo from Carlos). so seems there is some problem with linking to libs(?) what other tests can I do? Ant

are you sure it is running the right main? Is there a WinMain or something? It seems odd that just linking will prevent startup from getting to dmain2.

You think I might have a main on my lib and don't know about it? what happens if a have a global "int main(int argc, char** argv)"? I'll look to it tonight. Ant
Oct 12 2004
parent reply Ben Hinkle <bhinkle4 juno.com> writes:
 
 You think I might have a main on my lib and don't know about it?
 what happens if a have a global "int main(int argc, char** argv)"?
 I'll look to it tonight.

It should fail to link if you have multiple symbols called "main", I think. The "main" we write in D code is mangled to the symbol name "_Dmain" (see src/dmd/mangle.c). The one in dmain2.d is extern (C) so it is left untouched. My guess is there is a WinMain in your lib and that Windows is running that instead of the console "main". -Ben
Oct 12 2004
next sibling parent Ant <Ant_member pathlink.com> writes:
In article <ckh13e$11cp$1 digitaldaemon.com>, Ben Hinkle says...
 
 You think I might have a main on my lib and don't know about it?
 what happens if a have a global "int main(int argc, char** argv)"?
 I'll look to it tonight.

It should fail to link if you have multiple symbols called "main", I think. The "main" we write in D code is mangled to the symbol name "_Dmain" (see src/dmd/mangle.c). The one in dmain2.d is extern (C) so it is left untouched. My guess is there is a WinMain in your lib and that Windows is running that instead of the console "main". -Ben

I'll look at it. but... shouldn't phobos control WinMain as it does for main? Ant
Oct 12 2004
prev sibling parent Ant <Ant_member pathlink.com> writes:
In article <ckh13e$11cp$1 digitaldaemon.com>, Ben Hinkle says...
 
 You think I might have a main on my lib and don't know about it?
 what happens if a have a global "int main(int argc, char** argv)"?
 I'll look to it tonight.

It should fail to link if you have multiple symbols called "main", I think. The "main" we write in D code is mangled to the symbol name "_Dmain" (see src/dmd/mangle.c). The one in dmain2.d is extern (C) so it is left untouched. My guess is there is a WinMain in your lib and that Windows is running that instead of the console "main".

Ok, I almost found it: it's a comflict betweem phobos stdio and mine stdio. On the linux version I can use my stdio on windows i cannot. I could figure why. I'll use phobos' for now. on the process I found a few missing private on the import on phobos Ant
Oct 12 2004