View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0011011CMakeCMakepublic2010-07-19 18:022013-01-09 10:57
Reporterth3flyboy 
Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionunable to reproduce 
PlatformOSOS Version
Product VersionCMake-2-8 
Target VersionFixed in Version 
Summary0011011: CMake appears to have issues attempting to link to libraries that have a period in the file name
DescriptionCmake appears to be having issues in linking to libraries with a period in the file name (such as the library SigC-2.0 for SigC++). This blocks linking to libraries and prevents compiling.
Additional InformationThis only appears to happen when trying to link using a find library method for use with libraries when using a findX.cmake file to find them. Linking by using TARGET_LINK_LIBRARIES works fine if you link it to the actual library file name suchas library-version.minor.lib, and not a alias assigned by the Findx.cmake file such as for instance ${genericlibrary_library} or using the UtilityMacros to use LINK_WITH_VARIABLES(ComplingLibname
                    genericlibrary_library)
TagsNo tags attached.
Attached Fileszip file icon sigc.zip [^] (115,498 bytes) 2010-07-20 19:52

 Relationships

  Notes
(0021430)
Brad King (manager)
2010-07-20 10:00

Please attach a minimum test project to reproduce this.
(0021434)
th3flyboy (reporter)
2010-07-20 19:52

Uploaded a example test. Compile using VS2008.
(0021435)
Brad King (manager)
2010-07-21 08:45

After modifying the C++ code in the example with the patch below, the helloworld executable links correctly for me. What error do you see?

diff --git a/test/helloworld/Main.cpp b/test/helloworld/Main.cpp
index bf09f58..60b53a2 100755
--- a/test/helloworld/Main.cpp
+++ b/test/helloworld/Main.cpp
@@ -9,9 +9,9 @@ using namespace std;
 class helloworldtest
 {
 public:
- helloworldtest();
+ helloworldtest() {}
 
- void run();
+ void run() {}
 
        sigc::signal<void> signal_detected;
 };
(0021442)
th3flyboy (reporter)
2010-07-21 13:43

D'oh! Well that was smart for the example... I'll have to test that, but the problem we've been having in the project I'm working with is whenever we link to SigC++ we have linker errors coming from namespace std. I'll have to test this, but I think I am an idiot at this point.
(0021878)
th3flyboy (reporter)
2010-08-21 20:46

I realized something involving this bug. I guess the code I submitted as an example is borked, however here's where it gets interesting. When compiling the project I'm working with using Visual Studio with solutions generated by CMake, this is an anomaly. When you link the .lib file directly by filename in the cmakelists.txt it compiles fine, however when you link to it using the findcmake file provided in that zip, it acts up and can't link to sigc/libstd. When I submitted that example, I basically adapted the tutorial code from the sigc site as a very basic example. I would think that the basic hello world tutorial from there would work. Now, when linking using VC9 and Windows 7, with the cmake file provided, it tosses errors at me as specified above. However, something makes me doubt it's the code in the project due to that it works just fine when you directly link to the .lib in the cmakelists.txt instead of a variable as demonstrated in the example above.

Sorry it took so long to get back to this, life has been chaotic lately.
(0021891)
Brad King (manager)
2010-08-23 08:39

Just before the call to target_link_libraries, print out the value of the variable:

message(WARNING "genericlibrary_library=[${genericlibrary_library}]"

Obviously please substitute the variable name actually referenced in the link call. What does it print? When the build fails to link, what is the actual error message?
(0032051)
Robert Maynard (manager)
2013-01-09 10:57

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2010-07-19 18:02 th3flyboy New Issue
2010-07-20 09:24 Bill Hoffman Status new => assigned
2010-07-20 09:24 Bill Hoffman Assigned To => Brad King
2010-07-20 10:00 Brad King Note Added: 0021430
2010-07-20 19:52 th3flyboy File Added: sigc.zip
2010-07-20 19:52 th3flyboy Note Added: 0021434
2010-07-21 08:45 Brad King Note Added: 0021435
2010-07-21 13:43 th3flyboy Note Added: 0021442
2010-08-21 20:46 th3flyboy Note Added: 0021878
2010-08-23 08:39 Brad King Note Added: 0021891
2012-08-13 10:42 Brad King Assigned To Brad King =>
2012-08-13 10:42 Brad King Status assigned => resolved
2012-08-13 10:42 Brad King Resolution open => unable to reproduce
2013-01-09 10:57 Robert Maynard Note Added: 0032051
2013-01-09 10:57 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team