GCC - nastavení linkeru pro includy v includovaném hlavičkovém souboru – C / C++ – Fórum – Programujte.com
 x   TIP: Přetáhni ikonu na hlavní panel pro připnutí webu

GCC - nastavení linkeru pro includy v includovaném hlavičkovém souboru – C / C++ – Fórum – Programujte.comGCC - nastavení linkeru pro includy v includovaném hlavičkovém souboru – C / C++ – Fórum – Programujte.com

 

Toto vlákno bylo označeno za vyřešené.
Matěj Andrle+1
Grafoman
28. 11. 2015   #1
-
0
-

Dobrý den,
peru se s takovouto blbostí:

gcc -o Linux_All_DBG.OBJ/js.o -c -Wall -Wno-format -g -DXP_UNIX -DSVR4 -DSYSV -D_BSD_SOURCE -DPOSIX_SOURCE -DHAVE_LOCALTIME_R -DHAVE_VA_COPY -DVA_COPY=va_copy -DPIC -fPIC  -DDEBUG -DDEBUG_sam -DJS_HAS_FILE_OBJECT -DEDITLINE -ILinux_All_DBG.OBJ -Lnspr js.c


Zde hlavičkový soubor v nspr složce (-Lnspr) bez potíží dotáhne všechny potřebné includy hlavičkových souborů v téže složce. Jenže když přehodím argumenty tak, aby gcc vytvořil z objektového souboru soubor spustitelný:

gcc -o Linux_All_DBG.OBJ/js -Wall -Wno-format -g -DXP_UNIX -DSVR4 -DSYSV -D_BSD_SOURCE -DPOSIX_SOURCE -DHAVE_LOCALTIME_R -DHAVE_VA_COPY -DVA_COPY=va_copy -DPIC -fPIC  -DDEBUG -DDEBUG_sam -DJS_HAS_FILE_OBJECT -DEDITLINE -ILinux_All_DBG.OBJ  Linux_All_DBG.OBJ/js.o Linux_All_DBG.OBJ/libjs.a  -lm  -Lnspr    editline/Linux_All_DBG.OBJ/libedit.a


Najednou už v nspr vidí jen oba includované soubory, ovšem includy v nich již nedotáhne! Tak mi chybí asi 600 referencí, neboť oba zmíněné soubory dotahují dalších 20... Ať vykonám cokoliv, zbytek závislostí se nedotáhne: "undefined reference to blabla" Žádám tedy o radu - o co mu jde?

Nahlásit jako SPAM
IP: 78.136.153.–
Matěj Andrle+1
Grafoman
28. 11. 2015   #2
-
0
-

 Objektový soubor přitom nedělal vůbec potíže.

Linux_All_DBG.OBJ/libjs.a(jsfile.o): In function `js_BufferedRead':
/home/sam/Downloads/js/src/jsfile.c:801: undefined reference to `PR_Read'
Linux_All_DBG.OBJ/libjs.a(jsfile.o): In function `js_FileSeek':
/home/sam/Downloads/js/src/jsfile.c:902: undefined reference to `PR_Seek'
/home/sam/Downloads/js/src/jsfile.c:938: undefined reference to `PR_Seek'
Linux_All_DBG.OBJ/libjs.a(jsfile.o): In function `js_FileWrite':
/home/sam/Downloads/js/src/jsfile.c:970: undefined reference to `PR_Write'
/home/sam/Downloads/js/src/jsfile.c:994: undefined reference to `PR_Write'
/home/sam/Downloads/js/src/jsfile.c:1007: undefined reference to `PR_Write'
Linux_All_DBG.OBJ/libjs.a(jsfile.o): In function `js_exists':
/home/sam/Downloads/js/src/jsfile.c:1036: undefined reference to `PR_Access'
Linux_All_DBG.OBJ/libjs.a(jsfile.o): In function `js_canRead':
/home/sam/Downloads/js/src/jsfile.c:1045: undefined reference to `PR_Access'
Linux_All_DBG.OBJ/libjs.a(jsfile.o): In function `js_canWrite':
/home/sam/Downloads/js/src/jsfile.c:1062: undefined reference to `PR_Access'
Linux_All_DBG.OBJ/libjs.a(jsfile.o): In function `js_isFile':
/home/sam/Downloads/js/src/jsfile.c:1081: undefined reference to `PR_GetOpenFileInfo'
/home/sam/Downloads/js/src/jsfile.c:1082: undefined reference to `PR_GetFileInfo'
Linux_All_DBG.OBJ/libjs.a(jsfile.o): In function `js_isDirectory':
/home/sam/Downloads/js/src/jsfile.c:1106: undefined reference to `PR_GetOpenFileInfo'
/home/sam/Downloads/js/src/jsfile.c:1107: undefined reference to `PR_GetFileInfo'
Linux_All_DBG.OBJ/libjs.a(jsfile.o): In function `js_size':
/home/sam/Downloads/js/src/jsfile.c:1128: undefined reference to `PR_GetOpenFileInfo'
/home/sam/Downloads/js/src/jsfile.c:1129: undefined reference to `PR_GetFileInfo'
Linux_All_DBG.OBJ/libjs.a(jsfile.o): In function `file_open':
/home/sam/Downloads/js/src/jsfile.c:1359: undefined reference to `PR_Open'
Linux_All_DBG.OBJ/libjs.a(jsfile.o): In function `file_close':
/home/sam/Downloads/js/src/jsfile.c:1404: undefined reference to `PR_Close'
Linux_All_DBG.OBJ/libjs.a(jsfile.o): In function `file_remove':
/home/sam/Downloads/js/src/jsfile.c:1438: undefined reference to `PR_RmDir'
/home/sam/Downloads/js/src/jsfile.c:1438: undefined reference to `PR_Delete'
Linux_All_DBG.OBJ/libjs.a(jsfile.o): In function `file_copyTo':
/home/sam/Downloads/js/src/jsfile.c:1485: undefined reference to `PR_Open'
/home/sam/Downloads/js/src/jsfile.c:1499: undefined reference to `PR_Read'
/home/sam/Downloads/js/src/jsfile.c:1509: undefined reference to `PR_Write'
/home/sam/Downloads/js/src/jsfile.c:1525: undefined reference to `PR_Close'
/home/sam/Downloads/js/src/jsfile.c:1535: undefined reference to `PR_Close'
/home/sam/Downloads/js/src/jsfile.c:1540: undefined reference to `PR_Close'
Linux_All_DBG.OBJ/libjs.a(jsfile.o): In function `file_renameTo':
/home/sam/Downloads/js/src/jsfile.c:1561: undefined reference to `PR_Rename'
Linux_All_DBG.OBJ/libjs.a(jsfile.o): In function `file_flush':
/home/sam/Downloads/js/src/jsfile.c:1586: undefined reference to `PR_Sync'
Linux_All_DBG.OBJ/libjs.a(jsfile.o): In function `file_list':
/home/sam/Downloads/js/src/jsfile.c:1925: undefined reference to `PR_OpenDir'
/home/sam/Downloads/js/src/jsfile.c:1936: undefined reference to `PR_ReadDir'
/home/sam/Downloads/js/src/jsfile.c:1977: undefined reference to `PR_CloseDir'
Linux_All_DBG.OBJ/libjs.a(jsfile.o): In function `file_mkdir':
/home/sam/Downloads/js/src/jsfile.c:2015: undefined reference to `PR_MkDir'
Linux_All_DBG.OBJ/libjs.a(jsfile.o): In function `file_getProperty':
/home/sam/Downloads/js/src/jsfile.c:2431: undefined reference to `PR_GetOpenFileInfo'
/home/sam/Downloads/js/src/jsfile.c:2432: undefined reference to `PR_GetFileInfo'
/home/sam/Downloads/js/src/jsfile.c:2438: undefined reference to `PR_LocalTimeParameters'
/home/sam/Downloads/js/src/jsfile.c:2438: undefined reference to `PR_ExplodeTime'
/home/sam/Downloads/js/src/jsfile.c:2450: undefined reference to `PR_GetOpenFileInfo'
/home/sam/Downloads/js/src/jsfile.c:2451: undefined reference to `PR_GetFileInfo'
/home/sam/Downloads/js/src/jsfile.c:2457: undefined reference to `PR_LocalTimeParameters'
/home/sam/Downloads/js/src/jsfile.c:2457: undefined reference to `PR_ExplodeTime'
/home/sam/Downloads/js/src/jsfile.c:2478: undefined reference to `PR_OpenDir'
/home/sam/Downloads/js/src/jsfile.c:2484: undefined reference to `PR_ReadDir'
/home/sam/Downloads/js/src/jsfile.c:2488: undefined reference to `PR_CloseDir'
/home/sam/Downloads/js/src/jsfile.c:2519: undefined reference to `PR_Seek'
/home/sam/Downloads/js/src/jsfile.c:2549: undefined reference to `PR_OpenDir'
/home/sam/Downloads/js/src/jsfile.c:2560: undefined reference to `PR_CloseDir'
/home/sam/Downloads/js/src/jsfile.c:2556: undefined reference to `PR_ReadDir'
/home/sam/Downloads/js/src/jsfile.c:2565: undefined reference to `PR_CloseDir'
Linux_All_DBG.OBJ/libjs.a(jsfile.o): In function `file_setProperty':
/home/sam/Downloads/js/src/jsfile.c:2608: undefined reference to `PR_Seek'
collect2: error: ld returned 1 exit status
Nahlásit jako SPAM
IP: 78.136.153.–
Matěj Andrle+1
Grafoman
28. 11. 2015   #3
-
0
-

Tak tedy vcelku neomluvitelná chybička - chybějící linky přímo na knihovny...

Nahlásit jako SPAM
IP: 78.136.173.–
Zjistit počet nových příspěvků

Přidej příspěvek

Toto téma je starší jak čtvrt roku – přidej svůj příspěvek jen tehdy, máš-li k tématu opravdu co říct!

Ano, opravdu chci reagovat → zobrazí formulář pro přidání příspěvku

×Vložení zdrojáku

×Vložení obrázku

Vložit URL obrázku Vybrat obrázek na disku
Vlož URL adresu obrázku:
Klikni a vyber obrázek z počítače:

×Vložení videa

Aktuálně jsou podporována videa ze serverů YouTube, Vimeo a Dailymotion.
×
 
Podporujeme Gravatara.
Zadej URL adresu Avatara (40 x 40 px) nebo emailovou adresu pro použití Gravatara.
Email nikam neukládáme, po získání Gravatara je zahozen.
-
Pravidla pro psaní příspěvků, používej diakritiku. ENTER pro nový odstavec, SHIFT + ENTER pro nový řádek.
Sledovat nové příspěvky (pouze pro přihlášené)
Sleduj vlákno a v případě přidání nového příspěvku o tom budeš vědět mezi prvními.
Reaguješ na příspěvek:

Uživatelé prohlížející si toto vlákno

Uživatelé on-line: 0 registrovaných, 12 hostů

Moderátoři diskuze

 

Hostujeme u Českého hostingu       ISSN 1801-1586       ⇡ Nahoru Webtea.cz logo © 20032024 Programujte.com
Zasadilo a pěstuje Webtea.cz, šéfredaktor Lukáš Churý