FLTK logo

STR #108

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 Home  |  Articles & FAQs  |  Bugs & Features  |  Documentation  |  Download  |  Screenshots  ]
 

Return to Bugs & Features | Roadmap 2.0 | Post Text | Post File | SVN ⇄ GIT ]

STR #108

Application:FLTK Library
Status:4 - Pending
Priority:2 - Low, e.g. a documentation error or undocumented side-effect
Scope:2 - Specific to an operating system
Subsystem:WIN32
Summary:Automatically link correct libraries in Visual C++
Version:2.0-current
Created By:fltk.orib
Assigned To:dejan
Fix Version:2.0-current
Update Notification:

Receive EMails Don't Receive EMails

Trouble Report Files:

Post File ]

No files


Trouble Report Comments:

Post Text ]
Name/Time/Date Text  
 
#1 fltk.orib
14:04 Jul 15, 2003
A very common question that keeps appearing on the list is "why do I get linker errors using VC++", the reason being that winsock libraries and/or common control libraries (for trackmousepopup) aren't linked.

It can be solved by adding
#pragma comment(lib,"wsock32")
#pragma comment(lib,"comctl32")

In which case the VC linker will automatically add the required libraries during linkage.

It would probably be a good idea to only include the pragma if relevant code is used (e.g., under the same #ifdef that makes use of select() or TrackMouse()), and also make it possible to turn off through some definition in config.h, in case it causes trouble for anyone.
 
 
#2 mike
19:05 Jul 28, 2003
This is a common request.  Unfortunately, the pragmas are not portable to different WIN32 compilers, so I don't know if we will incorporate them.

If we do, it won't be until FLTK 2.0, as 1.1.x is in a feature freeze.
 
 
#3 dejan
22:08 Aug 17, 2005
This is actually pretty good idea, and can help beginners when starting with C++ & FLTK & VC++ .  
 
#4 fabien
09:41 Jun 06, 2006
Hi Dejan,
I suggest that you put that in FL_API.h as it concerns linking code generation and furthermore it's included everywhere ...

So we could add just after the ifdef clause of FL_API.h :

#if _MSC_VER >1000
# pragma once
# pragma comment(lib,"wsock32")
# pragma comment(lib,"comctl32")
#endif

This way we are we won't hurt other builds type
 
     

Return to Bugs & Features | Post Text | Post File ]

 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.