Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » [win32] undefinded referenced to gdi-functions?
[win32] undefinded referenced to gdi-functions? [message #126861] Thu, 11 November 2004 18:51 Go to next message
Eclipse UserFriend
Originally posted by: th.barth.mail.isis.de

Hi,
I used Eclipse/CDT and cygwin to compile my first win32-application.
The makefile is managed by eclipse automatically. When invoking a
gdi-function like CreatePen, the compiler can't find its reference.
Someone told me to link the gdi32 library, but the compiler couldn't
find the file althougth this file does exist.

/usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/../../../../i686-pc-cy gwin/bin/ld

: cannot find -lC:\WINDOWS\system32\gdi32.dll


Is this the correct library? Or do I have to install the win32 sdk first?

Thanks in advance,

Thomas B.
Re: [win32] undefinded referenced to gdi-functions? [message #126885 is a reply to message #126861] Fri, 12 November 2004 05:23 Go to previous messageGo to next message
Eclipse UserFriend
You must link with /MinGW/lib/libgd32.a

you have two choises
1 ) use -lgd232
2 ) use as an object /MinGW/lib/libgd32.a

CC Vural

Thomas Barth wrote:

> Hi,
> I used Eclipse/CDT and cygwin to compile my first win32-application.
> The makefile is managed by eclipse automatically. When invoking a
> gdi-function like CreatePen, the compiler can't find its reference.
> Someone told me to link the gdi32 library, but the compiler couldn't
> find the file althougth this file does exist.

> /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/../../../../i686-pc-cy gwin/bin/ld

> : cannot find -lC:WINDOWSsystem32gdi32.dll


> Is this the correct library? Or do I have to install the win32 sdk first?

> Thanks in advance,

> Thomas B.
Re: [win32] undefinded referenced to gdi-functions? [message #126937 is a reply to message #126861] Fri, 12 November 2004 08:32 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: alper.atici.name

On Fri, 12 Nov 2004 00:51:18 +0100, "Thomas Barth"
<th.barth@mail.isis.de> wrote:
>
>Is this the correct library? Or do I have to install the win32 sdk first?
>

Win32 sdk won't help because you need Cygwin-compatible import
libraries. For this, you have to install w32api package of Cygwin.
After that, just specify -mwindows option during linking and
Cygwin gcc will automatically link your executable with gdi32 (and
also with comdlg32).


Alper
Re: [win32] undefinded referenced to gdi-functions? [message #127050 is a reply to message #126885] Fri, 12 November 2004 15:49 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: th.barth.mail.isis.de

> You must link with /MinGW/lib/libgd32.a
>
> you have two choises
> 1 ) use -lgd232
> 2 ) use as an object /MinGW/lib/libgd32.a
>

I decided to set the option to -lgdi32. Everything works fine now, just
a few problems with the code examples from my books, that are written
with Borlands IDE or MSVC++. Obviously they have their own C++-
standard, developed for slutty coders :-)
For example a code example from C. Petzold:

struct {
int iIndex ;
TCHAR * szLabel ;
TCHAR * szDesc ;
} devcaps [] = {
HORZSIZE, TEXT ("HORZSIZE"), TEXT ("Width in millimeters:"),
VERTSIZE, TEXT ("VERTSIZE"), TEXT ("Height in millimeters:")
}

The compiler declares that braces are missing.

Thomas B.
Re: [win32] undefinded referenced to gdi-functions? [message #127062 is a reply to message #126937] Fri, 12 November 2004 15:55 Go to previous message
Eclipse UserFriend
Originally posted by: th.barth.mail.isis.de

> Win32 sdk won't help because you need Cygwin-compatible import
> libraries. For this, you have to install w32api package of Cygwin.
> After that, just specify -mwindows option during linking and
> Cygwin gcc will automatically link your executable with gdi32 (and
> also with comdlg32).
>

Great, I am glad that I do not have to change the ide for windows programming.


Thomas B.
Previous Topic:Run As->C Local Application - "Launch failed no binaries"
Next Topic:How to open source file in editor programatically
Goto Forum:
  


Current Time: Sat May 10 19:07:32 EDT 2025

Powered by FUDForum. Page generated in 0.03276 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top