| View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||
| ID | Project | Category | View Status | Date Submitted | Last Update | ||||
|---|---|---|---|---|---|---|---|---|---|
| 0000106 | mercury | Bug | public | 2009-09-22 01:07 | 2009-09-22 02:09 | ||||
| Reporter | janicek | ||||||||
| Assigned To | juliensf | ||||||||
| Priority | normal | Severity | major | Reproducibility | always | ||||
| Status | resolved | Resolution | fixed | ||||||
| Product Version | |||||||||
| Target Version | Fixed in Version | ||||||||
| Summary | 0000106: Linking with multiple C++ files yields a "duplicate symbol" error | ||||||||
| Description | Linking a Mercury main module with two (or more) C++ files that utilise some Mercury code through pragma foreign_export fails with the linker reporting the following: ** Error making `mercury_main'. ld: duplicate symbol _MR_trace_tailrec_have_reused_frames in CPlusPlus2.o and CPlusPlus1.o collect2: ld returned 1 exit status (See the attachment for a minimal example.) The platform is Darwin (Mac OS X 10.5.8), using Apple's GCC 4.1.2 which is shipped with Xcode 3.1.2. $ uname -a Darwin dfki-guestpool3.dfki.uni-sb.de 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 16:55:01 PDT 2009; root:xnu-1228.15.4~1/RELEASE_I386 i386 $ g++ --version i686-apple-darwin9-g++-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5566) Copyright (C) 2007 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $ mmc --version Mercury Compiler, version rotd-2008-11-30, configured for i686-apple-darwin9.6.0 Copyright (C) 1993-2008 The University of Melbourne | ||||||||
| Additional Information | Adding the keyword "extern" to variables MR_trace_tailrec_have_reused_frames and MR_trace_tailrec_num_reused_frames in `mercury_trace_base.h' seems to resolve the issue, i.e. the program links and seems to run fine. | ||||||||
| Tags | No tags attached. | ||||||||
| Attached Files |
| ||||||||
Notes |
|
|
janicek (reporter) 2009-09-22 01:09 |
Ah, forgot to mention the grade -- it's hlc.gc. Sorry! |
|
juliensf (administrator) 2009-09-22 01:53 |
The missing externs are a bug - I will fix this shortly. |
|
juliensf (administrator) 2009-09-22 02:09 |
Fix committed - it will take a day or two to make its way into the ROTDS. |
Issue History |
|||
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2009-09-22 01:07 | janicek | New Issue | |
| 2009-09-22 01:07 | janicek | File Added: duplicate-symbol-error.tar.gz | |
| 2009-09-22 01:09 | janicek | Note Added: 0000183 | |
| 2009-09-22 01:53 | juliensf | Note Added: 0000184 | |
| 2009-09-22 01:53 | juliensf | Assigned To | => juliensf |
| 2009-09-22 01:53 | juliensf | Status | new => assigned |
| 2009-09-22 02:09 | juliensf | Note Added: 0000185 | |
| 2009-09-22 02:09 | juliensf | Status | assigned => resolved |
| 2009-09-22 02:09 | juliensf | Resolution | open => fixed |


