Re: Create a console app under EmbeddedVC4, and debug it



And where did you get that entry point name? You can't just make up random
names and expect them to work. mainACRTStartup is what you want for a
non-unicode, _main startup.

Paul T.

"Jin Li" <jin@xxxxxxxxxxxxxxxxxxx> wrote in message
news:%23lTHc4P$FHA.3136@xxxxxxxxxxxxxxxxxxxxxxx
> Unfortunately, it's still not working...
>
> I changed the project settings -> link -> project options to:
>
> --------------------------------------------------------------------------------
> /entry:"mainCRTStartup" /subsystem:console
> --------------------------------------------------------------------------------
>
> Then compile it, got a link error:
>
> --------------------------------------------------------------------------------
> linking...
> LINK : error LNK2001: unresolved external symbol _mainCRTStartup
> emulatorDbg/hello.exe : fatal error LNK1120: 1 unresolved externals
> Error executing link.exe.
> hello.exe - 2 error(s), 0 warning(s)
> --------------------------------------------------------------------------------
>
> The link option of project settings is:
>
> --------------------------------------------------------------------------------
> commctrl.lib coredll.lib $(CEx86Corelibc)
> --------------------------------------------------------------------------------
>
> I compared the settings of this project with that of the console project
> under PB, which runs OK, I couldn't see any difference. Could any one
> share some thoughts if possible?
>
> Regards
>
>
> "Paul G. Tobey [eMVP]" <ptobey no spam AT no instrument no spam DOT com>
> wrote in message news:%23QgyruE$FHA.216@xxxxxxxxxxxxxxxxxxxxxxx
>> Well, you're heading in the right direction, but that's the wrong value.
>> DllMainCRTStartup is, as the name implies, for DLLs. Your program is not
>> a DLL. Check the help. I think there's documentation of the right entry
>> point name for having main().
>>
>> Paul T.
>>
>> "Jin Li" <jin@xxxxxxxxxxxxxxxxxxx> wrote in message
>> news:%23EKCXiE$FHA.272@xxxxxxxxxxxxxxxxxxxxxxx
>>> Thank you very much for both replies, and it really helped! I exported
>>> and then installed the SDK which has a console and now I can connect to
>>> it from Embedded VC4.
>>>
>>> I understand that WinMain is a console application, however, I really
>>> want to create a "main(int argc, char* argv[])" style console
>>> application, since we have some existing code that we want to compile
>>> it. So I replaced the WinMain with main, and under
>>> project->settings->link->project options, changed
>>> /entry:"WinMainCRTStartup" to /entry:"_DllMainCRTStartup", it compiles
>>> OK, but when run it, the printf inside main doesn't excute. I wonder if
>>> the settings I changed are correct, or there are some other things I
>>> should change...
>>>
>>> Regards
>>>
>>> "Bruce Eitman (eMVP)" <beitman.nospam@xxxxxxxxxxxxxxxxxxxxxx> wrote in
>>> message news:e4ypPvD$FHA.264@xxxxxxxxxxxxxxxxxxxxxxx
>>>> Wouldn't compile, or wouldn't link? I suspect that it failed to link,
>>>> and that is because in your project settings it is set to use something
>>>> other than main. Change it, or your code so they match.
>>>>
>>>> --
>>>> Bruce Eitman (eMVP)
>>>> Senior Engineer
>>>> beitman AT applieddata DOT net
>>>>
>>>> Applied Data Systems
>>>> www.applieddata.net
>>>> An ISO 9001:2000 Registered Company
>>>> Microsoft WEP Gold-level Member
>>>>
>>>> "Jin Li" <jin@xxxxxxxxxxxxxxxxxxx> wrote in message
>>>> news:%23J5u4hC$FHA.3564@xxxxxxxxxxxxxxxxxxxxxxx
>>>>> Hi,
>>>>>
>>>>> I wonder if someone could tell me how to create a console application
>>>>> under Embedded VC4, and how to debug and test it by connecting to a
>>>>> platform that has a console.
>>>>>
>>>>> Here are some details of what I did:
>>>>>
>>>>> 1. Under Embedded VC4, File-> New->Project, try to create a "Console
>>>>> application", but there is no such a choice, only "WCE application",
>>>>> which uses WinMain. If I use an empty "WCE project", and added a
>>>>> simple main(..) function, it doesn't compile.
>>>>>
>>>>> Meanwhile, I created a platform "OS1" under PB using the template
>>>>> "Internet Appliance", which has a console. Then when adding a project
>>>>> under PB, there is the choice of "console application". I wonder what
>>>>> is the difference of developing applications under VC4 and PB? If VC4
>>>>> has more support(my impression, but not sure), is there a way that I
>>>>> could export the "OS1" image to VC4, so maybe after that I could
>>>>> create a console app under VC4?
>>>>>
>>>>> 2. In WinMain of the VC4 project, I tried to put a printf("hello"),
>>>>> and run it, but it starts the STANDARDSDK Emulator, which has no
>>>>> console in it. I tried to connect to the "OS1" platform by doing the
>>>>> following: start "OS1" from PB and let it running, add a device of
>>>>> "OS1" using "configure platform manager", but when I go to "Set Active
>>>>> Platform", I could only see "STANDARDSDK Emulator", not my "OS1".
>>>>>
>>>>> Another way I tried is under "OS1" console, I "shared" the directory
>>>>> of VC4 project, then I could run the exe using cmd under OS1, but the
>>>>> problem is I could not debug it.
>>>>>
>>>>> I think I'm missing something here... I would really appreciate it if
>>>>> someone could share their thoughts on any of the points.
>>>>>
>>>>> Regards
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>


.



Relevant Pages

  • Re: error LNK2001: unresolved external symbol _WinMain@16
    ... not have the project defined as a as a Console application...whew... ... "Larry Brasfield" wrote: ... > fix your project settings, ... > application, you either forgot to define WinMain(), ...
    (microsoft.public.dotnet.languages.vc)
  • Re: Defrag Probs and Lag Time
    ... etc. to set the IE settings correctly? ... Clicking on the entry for your hard drive should display the ... enter chkdsk C: ... look for an Information type entry ...
    (microsoft.public.windowsxp.perform_maintain)
  • Re: SP2 and Active-X - Security Bar ignores settings
    ... Remember that day you found out about mmc, gpedit and all the fancy ways to ... you try and try to change settings from any other account, tweak, uninstall / ... and then saved in the "Console Root". ... uninstalling SP2 again? ...
    (microsoft.public.windowsxp.perform_maintain)
  • Re: SP2 and Active-X - Security Bar ignores settings
    ... Remember that day you found out about mmc, gpedit and all the fancy ways to ... you try and try to change settings from any other account, tweak, uninstall / ... and then saved in the "Console Root". ... Click Administrative Tools, ...
    (microsoft.public.windowsxp.perform_maintain)
  • Re: ActiveSync 4.2 not working on WM5.0 device over USB Serial Function driver
    ... I have made sure that all the settings are done as per the requirement. ... USB Mass Storage functionality is working on WM.But for the same USB ... driver the serial function class is now working for ActiveSync. ... Entry for USBFN Serial Client ...
    (microsoft.public.pocketpc)