in this Image the IDE gives an error message which points to the code pointed out
this is code from calling the C- libcurl DLL
eventually i will probably find it out how to correctly fix it, but if this is obvious to someone of how this should be changed to a correct form
-
drspro2
- VIP Member
- Posts: 128
- Joined: 28 Apr 2006 12:03
vp9 project migrate to vip10
You do not have the required permissions to view the files attached to this post.
-
Martin Meyer
- VIP Member
- Posts: 365
- Joined: 14 Nov 2002 0:01
Re: vp9 project migrate to vip10
The fix is explained in the Visual Prolog 10 Upgrade Notes:
Binary memory representation
Binaries have changed representation. In the old representation a binary was a pointer to the actual data, and immediately before the data the size of the binary was written. Windows API and other external APIs does not use this representation and as a consequence binaries was often had to be copied from the buffer that cntains it to another "buffer" that can hold the size infront of the data. A binary is now represented as a pointer to a memory cell containing a pointer to a data-buffer and the size. So the size is no longer placed in a specific place relative to the actual data. With the old representation uncheckedConvert of a binary to the pointer domain would result in a pointer to the data. With the new representation this is no longer the case and therefore it has been made illegal to uncheckedConvert from binary to pointer, instead you must use convert which will both in old and new representation give a pointer to the data. Alternatively, you can use the extension predicate binary::data() instead, e.g. Pointer = MyBinary:date().
Binary memory representation
Binaries have changed representation. In the old representation a binary was a pointer to the actual data, and immediately before the data the size of the binary was written. Windows API and other external APIs does not use this representation and as a consequence binaries was often had to be copied from the buffer that cntains it to another "buffer" that can hold the size infront of the data. A binary is now represented as a pointer to a memory cell containing a pointer to a data-buffer and the size. So the size is no longer placed in a specific place relative to the actual data. With the old representation uncheckedConvert of a binary to the pointer domain would result in a pointer to the data. With the new representation this is no longer the case and therefore it has been made illegal to uncheckedConvert from binary to pointer, instead you must use convert which will both in old and new representation give a pointer to the data. Alternatively, you can use the extension predicate binary::data() instead, e.g. Pointer = MyBinary:date().
Regards Martin
-
drspro2
- VIP Member
- Posts: 128
- Joined: 28 Apr 2006 12:03
Re: vp9 project migrate to vip10
thankyou for this information, i might be able to solve the compiler error in this way.
It is already very impressive that VP detects anything that would lead to incorrect results.
This also touches the subject Foreign language code so it might be valuable to other users.
this line :
e.g. Pointer = MyBinary:date().
should be :
Pointer = MyBinary:data(). ? ( not date )
It is already very impressive that VP detects anything that would lead to incorrect results.
This also touches the subject Foreign language code so it might be valuable to other users.
this line :
e.g. Pointer = MyBinary:date().
should be :
Pointer = MyBinary:data(). ? ( not date )
-
drspro2
- VIP Member
- Posts: 128
- Joined: 28 Apr 2006 12:03
Re: vp9 project migrate to vip10
I have 1 directory ( pack ) in my project which is compiling as the last module in the project , but it never ends / succeeds with compiling. i removed all the file5x predicates, removed file5x from the pack file, but it doesnt seem to make a difference.
apparantly it is passed to the compiler because VP says there are no syntax errors no unknown predicates etc in this module. is there a way to know what is going , or to change the debug level of the compiler messages. in the mean time i keep searching, changing the code of that module to see if that helps . maybe i should create an empty project and move this module over there to see if it compiles independantly over there , in the current project it has many dependancies
ok i think i know what to do, best is to create a new project and import modules of the existing project 1 by one
apparantly it is passed to the compiler because VP says there are no syntax errors no unknown predicates etc in this module. is there a way to know what is going , or to change the debug level of the compiler messages. in the mean time i keep searching, changing the code of that module to see if that helps . maybe i should create an empty project and move this module over there to see if it compiles independantly over there , in the current project it has many dependancies
ok i think i know what to do, best is to create a new project and import modules of the existing project 1 by one
-
Martin Meyer
- VIP Member
- Posts: 365
- Joined: 14 Nov 2002 0:01
Re: vp9 project migrate to vip10
Yes, there is.is there a way ... to change the debug level of the compiler messages?
Additional compiler options, such as a lower debug level, can be entered in the project settings, build options tab:
However, I do not believe this is helpful when migrating code to VIP10.
You do not have the required permissions to view the files attached to this post.
Regards Martin
-
Thomas Linder Puls
- VIP Member
- Posts: 1499
- Joined: 28 Feb 2000 0:01
Re: vp9 project migrate to vip10
"/debug:none" means that the final program will not contain debug information. It has nothing to do with what messages the compiler gives.
As I understand it the compilation of a certain module never terminates. That is not something we are used to see and I would be interested in seeing the code. If you will allow us to see your source code then I would be interested. You can zip it and send it to support@visual-prolog.com. If you don't include *.obj and debug files (*.scope and *.deb) the zip will be much smaller.
As I understand it the compilation of a certain module never terminates. That is not something we are used to see and I would be interested in seeing the code. If you will allow us to see your source code then I would be interested. You can zip it and send it to support@visual-prolog.com. If you don't include *.obj and debug files (*.scope and *.deb) the zip will be much smaller.
Regards Thomas Linder Puls
PDC
PDC
-
drspro2
- VIP Member
- Posts: 128
- Joined: 28 Apr 2006 12:03
Re: vp9 project migrate to vip10
after deleting the .obj .deb and .scope the resulting zip is 1.8 MB , and i hope the email will accept the size.
It is a rather big project so it might not be easy to find. On my side i open this project in VIP 10 ( there are still a lot of vip9 codes inside it ) .
There are still modules inside which require to correct errors inside them, and I see those only now because the previous time it didnt show those errors yet.
The never terminating compiler can be seen after you let VIP open the project, then you right-click the module : voe and you let it compile only that module, after that the compiler never terminates
It succeeded in sending the zip file by mail to support@visual-prolog.com, so it has been sent
It is a rather big project so it might not be easy to find. On my side i open this project in VIP 10 ( there are still a lot of vip9 codes inside it ) .
There are still modules inside which require to correct errors inside them, and I see those only now because the previous time it didnt show those errors yet.
The never terminating compiler can be seen after you let VIP open the project, then you right-click the module : voe and you let it compile only that module, after that the compiler never terminates
It succeeded in sending the zip file by mail to support@visual-prolog.com, so it has been sent
-
Thomas Linder Puls
- VIP Member
- Posts: 1499
- Joined: 28 Feb 2000 0:01
Re: vp9 project migrate to vip10
We have received it, and one of my collogues has concluded that the compiler goes into an infinite loop in the type analysis. Which is very surprising, because I have written that piece of code
.
I will now examine the problem, and my guess is that for you the solution will be that I find an update of your code that will avoid the problem. And then we will of course try to solve the real problem in the compiler.
I will now examine the problem, and my guess is that for you the solution will be that I find an update of your code that will avoid the problem. And then we will of course try to solve the real problem in the compiler.
Regards Thomas Linder Puls
PDC
PDC
-
Thomas Linder Puls
- VIP Member
- Posts: 1499
- Joined: 28 Feb 2000 0:01
Re: vp9 project migrate to vip10
Actually, I don't think we are dealing with an infinite loop, only with an extremely long loop. But in any case we have a loop that takes too long to actually wait for.
As a work around you can insert a hasDomain declaration/call stating that Ener must be a real:
Unrelated to your problem: I think you should switch on auto formatting of your source files (Project -> Settings -> Build Options -> Auto-format source files).
As a work around you can insert a hasDomain declaration/call stating that Ener must be a real:
Code: Select all
vo_schema_mk_auto_vraag(IsMult, IsHndm, WelNievra,
Evan, Etot, Evan2, Etot2, Evan3, Etot3, "enerfgie marge",
Ew_vh, Kool_vh, Vet_vh, CoVerhCo,
DagverhCo, Aantal_dagen, Fase_naam, Zk_exc) :-
hasDomain(real, Ener),
voe_vars_vraag(IsMult, IsHndM, WelNievra),Regards Thomas Linder Puls
PDC
PDC
-
drspro2
- VIP Member
- Posts: 128
- Joined: 28 Apr 2006 12:03
Re: vp9 project migrate to vip10
Perfect, thankyou for your Expert insight and investigation effort. Visual Prolog is an absolutely brilliant compiler.
I hope to advance at later stage with this source code.
Currently i am trying to build a webserver with prolog with which one could easily build a Forum or a Webshop with an infinite database. This is a different subject.
I hope to advance at later stage with this source code.
Currently i am trying to build a webserver with prolog with which one could easily build a Forum or a Webshop with an infinite database. This is a different subject.
