18 July 2017, 18:43 | #1 |
Registered User
Join Date: May 2017
Location: Belgium
Age: 50
Posts: 334
|
[SOLVED] Vbcc on Win: Flag <-o> needs string
I'm getting this error when compiling a testing exe in c. Here's what it says:
Code:
vbcc -I "E:\\Amiga\\Dev\\NDK_3.9\\Include\\include_h" basicWin.c -o basicWin.exe error 3: Flag <-o> needs string aborting... Last edited by guy lateur; 19 July 2017 at 17:56. Reason: Mark as solved and off topic |
18 July 2017, 18:55 | #2 |
Registered User
Join Date: May 2017
Location: Belgium
Age: 50
Posts: 334
|
Also, if I add -v to turn on verbose mode, it says 'Unknown Flag <-v>'.
|
19 July 2017, 07:25 | #3 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
Use the front-end (vc) instead of calling the compiler directly, and don't put spaces between -I and its argument. Also, if you're still using the VBCC Windows installer then NDK 3.9 is already installed and configured, there's no need to manually point to it.
|
19 July 2017, 12:32 | #4 | |
Registered User
Join Date: May 2017
Location: Belgium
Age: 50
Posts: 334
|
Quote:
I'm only getting 'Reference to undefined symbol' errors now.. I thought vbcc had an 'automatic opening of libraries used' option, but I can't seem to find it. Or do I have to open and close the libs myself? Below is an example (slightly modified) I got from here: http://www.pjhutchison.org/tutorial/windows.html So how do I compile/link this? Code:
#include <proto/intuition.h> #include <proto/gadtools.h> /* Gadtools is needed for GetIMsg and ReplyIMsg */ #include <proto/exec.h> /* Exec is needed for Wait function */ #include <exec/exec.h> /* Exec is needed for Wait function */ #include <proto/dos.h> #include <intuition/intuition.h> struct DosLibrary *DOSBase; struct ExecLibrary *ExecBase; // struct IntuitionLibrary *IntuitionBase; int main() { struct Window *myWindow; int closewin = FALSE; /* Flag used to end program */ struct IntuiMessage *msg; /* Structure to store Intuition message data */ ULONG msgClass; /* Class value */ myWindow = OpenWindowTags(NULL, WA_Left, 20, WA_Top, 20, WA_Width, 200, WA_Height, 150, WA_IDCMP, IDCMP_CLOSEWINDOW, WA_Flags, WFLG_SIZEGADGET | WFLG_DRAGBAR | WFLG_DEPTHGADGET | WFLG_CLOSEGADGET | WFLG_ACTIVATE, WA_Title, "My Window", WA_PubScreenName, "Workbench", TAG_DONE); while (closewin == FALSE) /* Run program until window is closed */ { Wait(1L << myWindow->UserPort->mp_SigBit); /* Wait for an event! */ msg = GT_GetIMsg(myWindow->UserPort); /* Get message data */ msgClass = msg->Class; /* What has been clicked? */ GT_ReplyIMsg(msg); /* Close message */ if (msgClass == IDCMP_CLOSEWINDOW) /* Check here if Close Window selected */ { CloseWindow(myWindow); /* Close window */ closewin = TRUE; } } return(0); } |
|
19 July 2017, 13:22 | #5 |
Registered User
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 719
|
If I comment out the declaration of the library-bases it compiles cleanly with
vc +aos68k -o foo foo.c -lamiga -lauto |
19 July 2017, 13:51 | #6 | |
Registered User
Join Date: May 2017
Location: Belgium
Age: 50
Posts: 334
|
Quote:
So I suppose the linking with auto.lib is what makes it open the necessary libraries for us. Hmm, I wonder how that works.. |
|
19 July 2017, 14:14 | #7 |
Registered User
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 719
|
|
19 July 2017, 14:20 | #8 | |
Registered User
Join Date: May 2017
Location: Belgium
Age: 50
Posts: 334
|
Quote:
|
|
19 July 2017, 14:56 | #9 |
Registered User
Join Date: May 2017
Location: Belgium
Age: 50
Posts: 334
|
Are all these libraries (even intuition and gadtools) located in ROM? Because I don't have any of them as a .library file in my LIBS: folder, and yet the example runs perfectly fine. I have 3.X ROMs.
|
19 July 2017, 15:25 | #10 |
Registered User
Join Date: May 2017
Location: Belgium
Age: 50
Posts: 334
|
Well, they're documented in the libraries section of the ROM kernel reference manual, so I guess they're in ROM..
http://amigadev.elowar.com/read/ADCD.../node0002.html |
19 July 2017, 17:20 | #11 | ||||
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,500
|
Quote:
Quote:
Quote:
Quote:
|
||||
19 July 2017, 17:51 | #12 | |
Registered User
Join Date: May 2017
Location: Belgium
Age: 50
Posts: 334
|
Quote:
Anyway, thanks for the info, phx! You know it almost feels like cheating, having you around here.. |
|
19 July 2017, 19:30 | #13 | ||
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,500
|
Quote:
Code:
#include <stddef.h> #include <stdlib.h> #include <stdio.h> struct __exitfuncs *__firstexit; extern int main(int, char **); extern void __exit(); /* from startup-code */ /* from linker */ extern void (*__CTOR_LIST__[])(void),(*__DTOR_LIST__[])(void); /* Specified in c99. */ void _Exit(int returncode) { void (**dtors)(void); int i; if (dtors = __DTOR_LIST__) { for (i=1; *dtors[i]; i++); while (--i) (*dtors[i])(); /* call destructors */ } __exit(returncode); } void exit(int returncode) { static int in_exit = 0; if (!in_exit) { struct __exitfuncs *p=__firstexit; /* run atexit-functions */ in_exit = 1; while(p) { p->func(); p=p->next; } _Exit(returncode); } } /* This function has to be called by the startup-code. The startup-code typically has to: - setup hardware, stack etc. (if needed) - initialize variables (if needed) - parse command line (if needed) - call __main */ void __main(int argc,char **argv) { void (**ctors)(void) = __CTOR_LIST__; if (ctors++) { while (*ctors) (*ctors++)(); /* call constructors */ } exit(main(argc,argv)); } Quote:
Code:
#include <exec/libraries.h> #include <proto/exec.h> #include <stdlib.h> struct Library *AslBase = NULL; extern unsigned long _AslBaseVer; void _INIT_5_AslBase() { if (!(AslBase = OpenLibrary("asl.library",_AslBaseVer))) exit(20); } void _EXIT_5_AslBase() { if (AslBase) CloseLibrary(AslBase); } _AslBaseVer is in an extra object, so you have the possibility to overwrite the default version. |
||
19 July 2017, 20:04 | #14 | ||
Registered User
Join Date: May 2017
Location: Belgium
Age: 50
Posts: 334
|
Quote:
Quote:
|
||
19 July 2017, 20:26 | #15 | |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,500
|
Quote:
For a single library you can easily modify this file. I am auto-generating all those sources for auto.lib from the FD-files (looking for ##base), of course. |
|
19 July 2017, 20:31 | #16 |
Registered User
Join Date: May 2017
Location: Belgium
Age: 50
Posts: 334
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Plotter / Dot Flag | pmc | Coders. Tutorials | 45 | 19 January 2011 19:02 |
Flag by Gremlin | BippyM | project.aGTW | 43 | 22 December 2010 22:24 |
Floppy verify flag of AmigaOS | Leandro Jardim | support.Apps | 0 | 15 May 2010 19:40 |
Bitmap Flag = 0x00000001? | andreas | support.Other | 2 | 14 October 2009 22:29 |
save flag | Marcuz | HOL suggestions and feedback | 1 | 08 September 2006 01:18 |
|
|