View Issue Details [ Jump to Notes ] | [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
0015549 | CMake | CMake | public | 2015-04-30 08:01 | 2016-06-10 14:31 | ||||
Reporter | Micha Renner | ||||||||
Assigned To | Kitware Robot | ||||||||
Priority | normal | Severity | minor | Reproducibility | always | ||||
Status | closed | Resolution | moved | ||||||
Platform | Windows | OS | OS Version | ||||||
Product Version | CMake 3.2.1 | ||||||||
Target Version | Fixed in Version | ||||||||
Summary | 0015549: GenerateExportHeader: The extern keyword and data symbols | ||||||||
Description | It seems that the "extern" keyword is much more important than previously thought, at least for the MSVC in connection with static libraries. The example in the appendix demonstrates this. | ||||||||
Steps To Reproduce | - build this project - run the program => wrong output - open the tlib_export.h file in the CMAKE_BINARY_DIR: - change: #ifdef TLIB_STATIC_DEFINE # define TLIB_EXPORT to #ifdef TLIB_STATIC_DEFINE # define TLIB_EXPORT extern - build the project again - run the program => correct results. | ||||||||
Additional Information | May be one can change the GENERATE_EXPORT_HEADER macro to add the extern keyword automaticlly . (example is taken from the ffi library) | ||||||||
Tags | No tags attached. | ||||||||
Attached Files | example.zip [^] (7,701 bytes) 2015-04-30 08:01 | ||||||||
Relationships | |
Relationships |
Notes | |
(0038655) Brad King (manager) 2015-04-30 09:52 |
For reference, an explicit 'extern' linkage specifier is needed when declaring global variables. For functions it does not matter because the compiler knows it is a declaration rather than a definition when no function body is present. |
(0042770) Kitware Robot (administrator) 2016-06-10 14:29 |
Resolving issue as `moved`. This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page. |
Notes |
Issue History | |||
Date Modified | Username | Field | Change |
2015-04-30 08:01 | Micha Renner | New Issue | |
2015-04-30 08:01 | Micha Renner | File Added: example.zip | |
2015-04-30 09:50 | Brad King | Summary | The extern keyword => GenerateExportHeader: The extern keyword and data symbols |
2015-04-30 09:52 | Brad King | Note Added: 0038655 | |
2016-06-10 14:29 | Kitware Robot | Note Added: 0042770 | |
2016-06-10 14:29 | Kitware Robot | Status | new => resolved |
2016-06-10 14:29 | Kitware Robot | Resolution | open => moved |
2016-06-10 14:29 | Kitware Robot | Assigned To | => Kitware Robot |
2016-06-10 14:31 | Kitware Robot | Status | resolved => closed |
Issue History |
Copyright © 2000 - 2018 MantisBT Team |