Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

_printf error with visual c 1.52

Posted on 1998-05-31
4
Medium Priority
?
487 Views
Last Modified: 2013-12-03
What causes this link problem ( _printf ) with Visual C 1.52 in this windows project & how can it be solved ?

#include <stdio.h>
#include <windows.h>

void main()
{
  printf("This is just a test");
}

Linking...

TRY.OBJ(c:\project\vc-c1_de.kit\vcc\vcc\try.c) : error L2029: '_printf' : unresolved external

 LINK returned error code 2.
4.EXE - 1 error(s), 0 warning(s)

0
Comment
Question by:sector
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 11

Expert Comment

by:alexo
ID: 1405500
printf() needs a console to print to and Win16 does not support consoles.  Compile your project as QiuckWin (or something similar).
0
 

Author Comment

by:sector
ID: 1405501
i can't compile my program as a quickWindow application
because it is a CGI .

what other alternatives do i have ???
0
 
LVL 11

Accepted Solution

by:
alexo earned 40 total points
ID: 1405502
OK, first thing first: Native Win16 applications cannot use printf() for lack of a console.

Options:

1. Compile as a QuickWin application.  It "maps" the stdio to a window that simulates a console.  I have no idea why a CGI cannot be a QuickWin application, but then, I have no idea how a CGI is different from a "normal" application.

2. Compile it as a DOS application.  Obviously all functionality provided by Windows will be unavailable.  A DOS program can run under windows without a problem.

3. Move to Windows95/98/NT and compile the program as a console application.

4. Create a window and a DC in your application and use TextOut() APIs for output.

5. Create an edit box in your application and use EM_SETSEL and EM_REPLACESEL messages to display output.

To summarize:  Either compile for a platform that supports a console (QuickWin, Win32 or DOS) or manage the output yourself using Win16 APIs or controls.

0
 
LVL 11

Expert Comment

by:alexo
ID: 1405503
And the autograder hits again!
0

Featured Post

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

zlib is a free compression library (a DLL) on which the popular gzip utility is built.  In this article, we'll see how to use the zlib functions to compress and decompress data in memory; that is, without needing to use a temporary file.  We'll be c…
With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question