From: SourceForge.net <no...@so...> - 2008-04-06 16:31:34
|
Bugs item #1885785, was opened at 2008-02-03 18:21 Message generated for change (Settings changed) made by roms You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=118378&aid=1885785&group_id=18378 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: WelshSage (welshsage) >Assigned to: Romain Liévin (roms) Summary: error making libticalcs 1.1.0 Initial Comment: Mac OS X 10.4.11 /usr/bin/libtool: internal link edit command failed make[2]: *** [libticalcs2.la] Error 1 make[1]: *** [all-recursive] Error 1 make: *** [all] Error 2 ---------------------------------------------------------------------- >Comment By: Romain Liévin (roms) Date: 2008-04-06 18:31 Message: Logged In: YES user_id=136160 Originator: NO I took a look at code: the variables is well defined in nsp_vpkt.c and is declared once in nsp_vpkt.h. The use of the 'extern' keyword is optional. Thus, there is no reason that compiler/linker breaks on this file. Anyways, I merged your fix. Thanks. ---------------------------------------------------------------------- Comment By: rdm0 (rdm0) Date: 2008-04-05 20:54 Message: Logged In: YES user_id=1664697 Originator: NO My suspicion is that some other compilers/linkers are 'more forgiving' when confronted with two variables of identical type, making the assumption that they're really the same variable -- but generating a warning. Apparently, the implementation on the Mac is 'less forgiving', and generates a hard error. Make no mistake, this IS an error. You can define any variable only once. You can declare it in other places and use it, but clearly the storage must be made in only one location. The 'extern' simply turns the one 'definition' to a 'declaration', saying it's referring to the variable defined elsewhere. Most variables in header (.h) files are declared, not defined. It's just an obvious error that warning the user about it and then doing the 'obvious' solution apparently occurs for users of compilers/linkers of other platforms. At least, that's my guess. [I admit I didn't verify if tilp uses this particular libticalcs2-1.1.0 or not. I know tiemu does.] ---------------------------------------------------------------------- Comment By: m1ss1ontomars (m1ss1ontomars) Date: 2008-04-05 19:20 Message: Logged In: YES user_id=1976087 Originator: NO Ahh there we go. I didn't look quite so carefully, but that solves the compiling problem. I don't have an Nspire, so I can't test it. However, this shouldn't be a problem with tilp, as it doesn't depend on libticalcs2...does it? Also, is there a reason why the same code apparently builds successfully on other platforms? ---------------------------------------------------------------------- Comment By: rdm0 (rdm0) Date: 2008-04-05 08:48 Message: Logged In: YES user_id=1664697 Originator: NO If one examines the files in libticalcs2-1.1.0/src, you will find these two lines on lines 68 and 69 of nsp_vpkt.h: uint16_t nsp_src_port; uint16_t nsp_dst_port; You will find these two lines on lines 110 and 111 of nsp_vpkt.c: uint16_t nsp_src_port = 0x8001; uint16_t nsp_dst_port = PORT_ADDR_REQUEST; This is, indeed, a case of multiple definition of the variables, and causes the linker to fail. If you change the lines 68 and 69 in nsp_vpkt.h (.h, not .c !) to: extern uint16_t nsp_src_port; extern uint16_t nsp_dst_port; then libticalcs2-1.1.0 will configure and make without the linker errors. Whoever is in charge of libticalcs2 should correct this file, as multiple people have reported this error with tilp2, tilp, and tiemu. ---------------------------------------------------------------------- Comment By: m1ss1ontomars (m1ss1ontomars) Date: 2008-03-28 18:37 Message: Logged In: YES user_id=1976087 Originator: NO Fails with same error but different message on Mac OS X 10.5.2 with both gcc-4.0.1 and gcc-4.2.1. See Bug 1849837. ld: duplicate symbol _nsp_src_port in .libs/libticalcs2_la-nsp_cmd.o and .libs/libticalcs2_la-calc_nsp.o ---------------------------------------------------------------------- Comment By: rdm0 (rdm0) Date: 2008-03-24 06:09 Message: Logged In: YES user_id=1664697 Originator: NO I've gotten a similar error under Mac OS X 10.3.9. The cause seems to be given earlier in the error messages: ld: multiple definitions of symbol _nsp_dst_port .libs/libticalcs2_la-calc_nsp.o definition of _nsp_dst_port in section (__DATA,__common) .libs/libticalcs2_la-nsp_cmd.o definition of _nsp_dst_port in section (__DATA,__common) ld: multiple definitions of symbol _nsp_src_port .libs/libticalcs2_la-calc_nsp.o definition of _nsp_src_port in section (__DATA,__common) .libs/libticalcs2_la-nsp_cmd.o definition of _nsp_src_port in section (__DATA,__common) .libs/libticalcs2_la-nsp_vpkt.o definition of _nsp_dst_port in section (__DATA,__data) .libs/libticalcs2_la-nsp_vpkt.o definition of _nsp_src_port in section (__DATA,__data) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=118378&aid=1885785&group_id=18378 |