some LINK problem

I don't understand why I get an error message here. Any help appreciated.I use Horstmann's ccc_win.h header.

1
2
3
4
5
6
7
8
9
10
11

#include "ccc_win.h"
using namespace std;



int ccc_win_main()
{
	Circle c(Point(0,0), 1);
	cwin << c;
}
I don't understand why I get an error message here.

A link error, I presume, going by the title of this thread?

Are you following this example?
https://www.cs.drexel.edu/~mcs171/Sp14/Horstmann/Graphics/NET/index.html

If you have added all the files you were told to, post the link errors you're getting.

Andy

Edit

I would be wary of this tutorial as it says it was written for Visual C++ .NET -- which is (was) aka Visual Studio 2003... Though some of the code looks like it was originally written for Win16, e.g. the code using the PASCAL call convention, _export, etc.

Or are you using a more recent version?

I have gotten the sample to build with Visual Studio 2010 but in addition to the instructions provided I had to:

1. Modify the character set used in the project's Properties

Configuration Properties / General

Character Set = Use Multi-Byte Character Set

(was Use Unicode Character Set)

2. Edit line 31 of ccc_msw.cpp to remove the _export from the ccc_win_proc() function

Before

1
2
3
long FAR PASCAL _export ccc_win_proc(HWND hwnd, UINT message, UINT wParam, LONG lParam)
{
    ...


After

1
2
3
long FAR PASCAL ccc_win_proc(HWND hwnd, UINT message, UINT wParam, LONG lParam)
{
    ...


After these two changes it built and ran OK for me.

Andy
Last edited on
It worked! i was using the other set of files that were from the authors' webpage. Thanks!
Topic archived. No new replies allowed.