May 02, 2024, 06:17:51 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


FATAL ERROR !!!

Started by paja, June 20, 2010, 02:12:46 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

paja

Hi,

Does anybody know what happened with EBasic compiler ? When I try to compile any program I get always error "Duplicate ID - 0x0000000" in many lines.

sapero

Paja, read this if you have installed third-party, not official command-packs -> http://www.ionicwind.com/forums/index.php/topic,4126.0.html
Do not install incc files to /bin directory. Rename extension to .inc, copy the file to /include or to the directory where is your current .eba file, and $include it if you need it. This is the preferred, safe and universal way.

LarryMc

Quote from: sapero on June 20, 2010, 03:35:34 PM
Do not install incc files to /bin directory. Rename extension to .inc, copy the file to /include or to the directory where is your current .eba file, and $include it if you need it. This is the preferred, safe and universal way.

If that is true then how do you get the IDE to recognize additional help files.

My Button Designer, Chart Designer, IW Snipet manager, LList class,CXmlLM class, and the Visual Designer all have .incc files inorder to have their help files appear in the IDE help menu.

Also, the Network Client/Server library and Emergence BASIC Serial Commands library have incc files that not only contain help file info but the $USE commands and the new $commands that each new function has.

I think what you really mean is that it is dangerous to put declarations in an .incc file unless you really know what you are doing.

Paja
I think your problem is this.
You have been installing the updates for my Visual Designer. The Designer had a VDEB.incc file for the help file and also some constants(a carryover from Paul's designer).
With the name change from VDEB to VDIWB there is now a VDIWB.incc which has the duplicate definitions of the style constants.

I'm thinking you installed the VDIWB version without uninstalling the VDEB version.

I tested this theory by having two copies of the client/server library incc file (with different names) and tried to compile a program that I know works.  It failed with some errors that made absolutely no sense.

So, uninstall any copy of VDEB and check the EBDev\bin directory to make sure the VDEB.incc file is gone and see if that makes your problem go away. 

My next release will have the constants moved out of the incc and put in my inc file like it should have been in the first place since they are only constants.  Then my incc file will only contain the help file info and won't be able to cause that sort of problem.
It's one of the pieces of code I used as Paul had written it when I started on my version of the designer.

Let us know if that makes your problem go away.

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

LarryMc

RitchieF

This may have been what was causing your problem on May 31st
http://www.ionicwind.com/forums/index.php/topic,4126.msg32306.html#msg32306

because I posted the name change version around May 23rd.

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

LarryMc

Did a little more thinking about the constant declarations in my incc file.

For the time being they will have to remain there.  All the constants (70+) are style flags and notification msgs that should have been in ebstd.incc but weren't.

They are needed so the auto code creation works.

What needs to be done is when IWBasic 2.0 is released these definitions should be added to iwbstd.incc at which time I will remove them from my VDIWB.incc.

So the solution right now is to make sure you have uninstalled VDEB.

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

sapero

June 21, 2010, 01:50:21 AM #5 Last Edit: June 21, 2010, 07:06:20 AM by sapero
Larry, you can always protect the content of incc files with $ifndef, and I think all incc files should have it, so when a user will compile a downloaded project, he will see "missing command pak ..." instead "undefined variable", or a ton of errors.

IMO the command-pak writer shoul create a "how to program" section in the help file, which should include instructions how to detect if an command pak is installed, and how to show an error if it is missing.
$main
$ifndef COMMANDPAK_GENERALNAME
  $ifdef __IWVER__ ' IWBasic v2 or newer
     $error "cannot compile because ... is not installed"
  $else
     _asm %error "cannot compile because ... is not installed"
     _endasm
  $endif
$else
  ' your program goes here
$endif


Anyway, Duplicate ID error will be shown only if the values are different.

RitchieF

LarryMc,

you are right. To be honest I first installed the newer version of your designer, then read in your post 'unistall the previous version'.

Coz I didn't I ran into those problems.

Anyway everything runs perfect now again ;D

Richard

LarryMc

Quote from: sapero on June 21, 2010, 01:50:21 AM
Larry, you can always protect the content of incc files with $ifndef, and I think all incc files should have it, so when a user will compile a downloaded project, he will see "missing command pak ..." instead "undefined variable", or a ton of errors.

IMO the command-pak writer shoul create a "how to program" section in the help file, which should include instructions how to detect if an command pak is installed, and how to show an error if it is missing.
$main
$ifndef COMMANDPAK_GENERALNAME
   $ifdef __IWVER__ ' IWBasic v2 or newer
      $error "cannot compile because ... is not installed"
   $else
      _asm %warning "cannot compile because ... is not installed"
      _endasm
   $endif
$else
   ' your program goes here
$endif


Anyway, Duplicate ID error will be shown only if the values are different.
That's excellent information Sapero (as always).

I had never dreamed of using the $ifndef directive in a case like that.
But this was the first time I had added any declarations in an incc file; I usually use it just to add help files.

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

LarryMc

Sapero
I ran your test for missing pak.

Got this:
QuoteCompiling...
pak_test.eba
C:\_EBDev\projects\pak_test.a:14: error: unknown preprocessor directive `%warning'
C:\_EBDev\projects\pak_test.a:14: error: label or instruction expected at start of line
Error(s) in assembling "C:\_EBDev\projects\pak_test.a"
and this is what the .a file looked like:
segment .text use32 align=16
extern _ibstrcpy
extern _ibstrlen
extern _ibstrcat
extern _ib_finish
extern _i64mul
extern _i64div
extern _ui64div
extern _i64rem
extern _ui64rem
extern _sys_double
global _ib_main
_ib_main:
%warning "cannot compile because ... is not installed"
jmp _ib_finish
segment .data use32 align=4
segment .bss use32 align=4

What did I miss?

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

sapero

I'm sorry, %warning was added in later nasm builds. Use %error instead.

%error bla bla   ; gives a warning and continues assembling
%error "bla bla" ; terminates assembling

LarryMc

Thanks, that made it print the desired error message.

Am I correct in assuming that in the incc file I'll have to have a
$ifndef MYCOMMANDPAK
  $define MYCOMMANDPAK
$endif


I ask because none of the standard incc files or Paul's addon incc files have any $define and/or $ifndef statements.

I just need to know how to set it up properly.

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

sapero

June 21, 2010, 08:11:30 AM #11 Last Edit: June 21, 2010, 08:13:07 AM by sapero
Here's a basic template:' put help file informations here, including the version

$ifdef MYCOMMANDPAK
' another instance of this pak was already incc'luded (old/new/renamed file, etc)
' Show an error or warning, the user should know what is going on
$else
' this is the first instance
$define MYCOMMANDPAK

' put your defines here
$endif

LarryMc

Works great Sapero!

thanks

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library