English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. C/C++

 
 
Thread Tools
Old 22 December 2015, 18:02   #1
tygre
Returning fan!
 
tygre's Avatar
 
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 1,434
Hooooo Linking errors with vbcc when not using C99

Hi all!

While I was playing with my XAD client, I stumbled on this linking error that I cannot explain: when compiling/linking with C99 option, my code compiles and links fine, but without this option, I receive linking errors... Could someone please explain me what I am missing?

Here is the log with the C99 option:

Quote:
vbcc:bin/vc -cpp-comments -c99 -DFORTIFY -Idevkits:sdk/classic/MUI/Developer/C/Include/
-Idevkits:sdk/classic/MiamiSDK/netinclude/ -IWorkspace:AmiModRadio/ -IDevKits:sdk/classic/xad/Include/C/
-Ldevkits:sdk/classic/MiamiSDK/netlib/ -lamiga -lmiami -c -o o/vbcc-classic/xad.o xad.c
vbcc:bin/vc -cpp-comments -c99 -DFORTIFY -Idevkits:sdk/classic/MUI/Developer/C/Include/
-Idevkits:sdk/classic/MiamiSDK/netinclude/ -IWorkspace:AmiModRadio/ -IDevKits:sdk/classic/xad/Include/C/
-Ldevkits:sdk/classic/MiamiSDK/netlib/ -lamiga -lmiami -o bin/vbcc-classic/AmiModRadio o/vbcc-classic/main.o
o/vbcc-classic/blacklists.o o/vbcc-classic/controlscli.o o/vbcc-classic/controlscommon.o o/vbcc-classic/controlsmui.o
o/vbcc-classic/ftp.o o/vbcc-classic/kvs.o o/vbcc-classic/log.o o/vbcc-classic/mui.o o/vbcc-classic/players.o
o/vbcc-classic/prefs.o o/vbcc-classic/sources.o o/vbcc-classic/utils.o o/vbcc-classic/version.o o/vbcc-classic/xad.o
o/vbcc-classic/fortify.o
Done.
Here is the log without the C99 option:

Quote:
vbcc:bin/vc -cpp-comments -DFORTIFY -Idevkits:sdk/classic/MUI/Developer/C/Include/
-Idevkits:sdk/classic/MiamiSDK/netinclude/ -IWorkspace:AmiModRadio/ -IDevKits:sdk/classic/xad/Include/C/
-Ldevkits:sdk/classic/MiamiSDK/netlib/ -lamiga -lmiami -c -o o/vbcc-classic/xad.o xad.c
vbcc:bin/vc -cpp-comments -DFORTIFY -Idevkits:sdk/classic/MUI/Developer/C/Include/
-Idevkits:sdk/classic/MiamiSDK/netinclude/ -IWorkspace:AmiModRadio/ -IDevKits:sdk/classic/xad/Include/C/
-Ldevkits:sdk/classic/MiamiSDK/netlib/ -lamiga -lmiami -o bin/vbcc-classic/AmiModRadio o/vbcc-classic/main.o
o/vbcc-classic/blacklists.o o/vbcc-classic/controlscli.o o/vbcc-classic/controlscommon.o o/vbcc-classic/controlsmui.o
o/vbcc-classic/ftp.o o/vbcc-classic/kvs.o o/vbcc-classic/log.o o/vbcc-classic/mui.o o/vbcc-classic/players.o
o/vbcc-classic/prefs.o o/vbcc-classic/sources.o o/vbcc-classic/utils.o o/vbcc-classic/version.o o/vbcc-classic/xad.o
o/vbcc-classic/fortify.o
xad.o: In "l13":
Error 21: xad.o (CODE+0xca): Reference to undefined symbol _xadGetInfo.
xad.o: In "l22":
Error 21: xad.o (CODE+0x17e): Reference to undefined symbol _xadFileUnArc.
vlink failed returncode 20
vlink -bamigahunk -x -Bstatic -Cvbcc -nostdlib -Lvlibos3: vlibos3:startup.o -FT:t_19_0
-Ldevkits:sdk/classic/MiamiSDK/netlib/ -lamiga -lmiami -s -Rshort -lvc -o bin/vbcc-classic/AmiModRadio failed
make: *** [bin/vbcc-classic/AmiModRadio] Error 20
Done.
The only differences are the presence (or not) of the C99 parameter and, of course , the linking errors...

Thanks in advance to enlighten me and... merry X-mas
tygre is offline  
Old 22 December 2015, 23:17   #2
matthey
Banned
 
Join Date: Jan 2010
Location: Kansas
Posts: 1,284
@tygre
What do the source lines (and any function declaration lines) look like that give the errors? Vbcc is very strict about ANSI mode (default) so any new C commands will generate an error. GCC by default uses a hybrid GCCism C mode with some new commands. GCC requires a command line switch to turn on strict ANSI or c99 compliance but many programmers are used to the friendly GCCism C mode. The best option I know of for vbcc to be less strict is to use the -c99 switch as you have learned .
matthey is offline  
Old 22 December 2015, 23:38   #3
alkis
Registered User
 
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 719
I am not familiar with vbcc but....can you make vc verbose and show the exact vlink call that succeeds (in the first snippet)?

We have the failed call in the second snippet, if we could compare it with the first succesful one...it would be a start.
alkis is offline  
Old 22 December 2015, 23:54   #4
matthey
Banned
 
Join Date: Jan 2010
Location: Kansas
Posts: 1,284
Quote:
Originally Posted by alkis View Post
I am not familiar with vbcc but....can you make vc verbose and show the exact vlink call that succeeds (in the first snippet)?

We have the failed call in the second snippet, if we could compare it with the first successful one...it would be a start.
Try -v for verbose mode or -vv for very verbose mode of vc. The documentation for vc is in the vbcc manual.

http://server.owl.de/~frank/vbcc/docs/vbcc.pdf
matthey is offline  
Old 23 December 2015, 00:44   #5
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
The headers require C99 for some of the functions due to variadic arguments. You can supply a tag list instead and use the alternative xadGetInfoA, xadFileUnArcA etc.
Leffmann is offline  
Old 25 December 2015, 21:01   #6
tygre
Returning fan!
 
tygre's Avatar
 
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 1,434
Hi all!

Leffmann, thank you so much, you were spot on! I replaced the original calls with the "A" version and sets of tag items and everything compiles, links, and runs flawlessly

Thanks and merry X-mas!
tygre is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Linking problem arti Coders. C/C++ 2 23 January 2015 19:03
vbcc C99 math for the 68k FPU matthey Coders. C/C++ 0 12 August 2014 18:53
VBCC assembler linking syntax? NovaCoder Coders. General 2 20 May 2011 03:04

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 08:51.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.21252 seconds with 13 queries