473,395 Members | 1,652 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

implementing a WinMain function

Hi
I was wondering if someone can help me with this. I am modifying a code that is an interface to a scanner. In the code there is a main function and when I try to debug it , it gives two errors:
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16 and

Debug/scanner_connect.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe

So I guess the first error needs me to implement a WinMain function and I dont know how to do that , I was wondering if I can post my code so that the picture wd be clearer, Iam a new member and I heard there is a restriction on that .. but i don have a prblm wth posting it so I can get some help , Thanks
Apr 3 '07 #1
2 2025
sicarie
4,677 Expert Mod 4TB
Yes, we like to try to keep the amount of code posted to a minimum, so I'm wondering, do you use libcd or wincrt in your project? From the error, I'm guessing you try to access (or something in your program tries to access) one of those libraries, and it's not included in your program. Also, is there a line number to the error?
Apr 3 '07 #2
Banfa
9,065 Expert Mod 8TB
If your code contains a main but you are getting an unresolved external on WinMain then you have told the linker you are linking the wrong type of program. On Windows you have to specify the linker output as either a Windows program or a Console program.

A Windows program has a WinMain and a Console program has a main.

Check your linker switches.
Apr 3 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Martyn Lawson | last post by:
Hi, I am currently working as an Analyst on a .NET Web Project using ASP.NET and C#.NET. I have a couple of, at least what should be, quick questions: 1. My understanding of UML says that...
1
by: Michael Sgier | last post by:
Hi While trying to compile the follwoing example with devC++ I get errors: D:\SDL-1.2.7MingW\lib\libSDLmain.a(SDL_win32_main.o.b)(.text+0x34b) In function `console_main': undefined reference...
2
by: Michael Sgier | last post by:
Hi While trying to compile the follwoing example with devC++ I get errors: D:\SDL-1.2.7MingW\lib\libSDLmain.a(SDL_win32_main.o.b) (.text+0x34b) In function `console_main': undefined...
2
by: B_Love | last post by:
Hey! When trying to compile the code for a ordered vector class I get the following error: undefined reference to `WinMain@16' Anyone have any idea what I might be doing wrong? I've been...
15
by: Bernard | last post by:
Hi All, I am not sure if I should be asking this question on clc or clc++. Let me try on both. I hope that this is not too trivial for the brilliant minds over here. I know that OOP questions...
1
by: Steve Richter | last post by:
I am working from the C++ .net step by step book ... my project compiles and runs as a console application: #include "stdafx.h" #using <mscorlib.dll> #using <System.dll> #using...
9
by: raylopez99 | last post by:
What's the best way of implementing a multi-node tree in C++? What I'm trying to do is traverse a tree of possible chess moves given an intial position (at the root of the tree). Since every...
12
by: eric dexter | last post by:
I want to compare what I get on the command line in winmain with an if statement.. I am getting a beginers error but I don't have an example to use to fix it.. cannot convert from 'const int' to...
10
by: Jrdman | last post by:
i wrote this code : #include<windows.h> int APIENTRY WinMain(HINSTANCE hinstane, HINSTANCE hpinstance, LPSTR lpcmdline, int cmdshow){ while(1) ;
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.