[Cmake] CMAKE FAQ add entry

Jan Woetzel jw at mip . informatik . uni-kiel . de
Wed, 16 Jul 2003 14:25:30 +0200


This is a multi-part message in MIME format.
--------------020306020401050708090301
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Andy Cedilnik wrote:

>You can always post it to the list, enter a bug entry...
>
Ok, atached is my tiny contribution to help those familiar with Unix but 
not with MS Windows.

Jan.

-- 

  Dipl.-Ing. Jan Woetzel
--------------------------------------------------
  University of Kiel
  Institute of Computer Science and Applied Mathematics
  Hermann-Rodewald-Str. 3 [room 401]
  24098 Kiel/Germany
--------------------------------------------------
  Phone +49-431-880-1418
  Fax   +49-431-880-4054
  Mob.  +49-179-2937346
--------------------------------------------------
  Url   www.mip.informatik.uni-kiel.de/~jw
  Email jw at mip . informatik . uni-kiel . de


--------------020306020401050708090301
Content-Type: text/plain;
 name="cmake_faq.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="cmake_faq.txt"



Why does FIND_LIBRARY not find .DLL libraries under WIN32?
----------------------------------------------------------

For those who come from a Unix background to MS Windows: 

You never link directly to the .dll, you have to link against the import library .lib for the .dll.

Linking dynamic libraries (.dll under Windows) is quite different from linking shared objects (.so) under Linux.

In Windows, there are two types of library, a static library and an import library (both called .lib). In Windows, building A.dll will also build the import library A.lib (which is *not* the static library. 

Some more details can be found here:
http://cphoenix . best . vwh . net/winvunix . html

=======================================




Under WIN32 I am getting a linker error to _mainCRTStartup.
-----------------------------------------------------------

Your program is not a console application using main but a GUI application using WinMain (/subsystem:windows).

You have to use the WIN32 option with the ADD_EXECUTABLE command.

ADD_EXECUTABLE(exename [WIN32] source1 source2 ... sourceN) 
... The second argument to this command can be WIN32 which indicates that the executable (when compiled on windows) is a windows app (using WinMain) not a console app (using main)....

===========================================================

--------------020306020401050708090301--