[fpc-pascal] Strange compile error
Hi, I have a simple application that uses glut and opencv. However as soon as I add the opencv wrapper unit to the uses clause I get: video.pp(10,1) Fatal: Syntax error, "UNIT" expected but "PROGRAM" found The compiler does not recognize the main unit anymore. I have searched the opencv.pas file but I could not find anything strange there. Has anyone got an idea of what might be happening? TIA, Darius ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Strange compile error
On 17.05.2012 10:11, dhkblas...@zeelandnet.nl wrote: Hi, I have a simple application that uses glut and opencv. However as soon as I add the opencv wrapper unit to the uses clause I get: video.pp(10,1) Fatal: Syntax error, "UNIT" expected but "PROGRAM" found The compiler does not recognize the main unit anymore. I have searched the opencv.pas file but I could not find anything strange there. Has anyone got an idea of what might be happening? It would help if you'd show us how your main program file looks like. Regards, Sven ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Strange compile error
On Thu, May 17, 2012 10:11, dhkblas...@zeelandnet.nl wrote: Hi, > I have a simple application that uses glut and opencv. > However as soon as I add the opencv wrapper unit to the uses clause I > get: > > video.pp(10,1) Fatal: Syntax error, "UNIT" expected but "PROGRAM" > found > > The compiler does not recognize the main unit anymore. I have > searched the opencv.pas file but I could not find anything strange > there. Has anyone got an idea of what might be happening? I'd assume a different video.pp file is found instead of the right one (possibly because the compiled version of unit video cannot be used for some reason). Try compiling with -vt to find out what happens there. Tomas ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Strange compile error
On Thu, May 17, 2012 11:07, dhkblas...@zeelandnet.nl wrote: > Second try. My previous email with attachement got blocked > probably. I will send the files now in two emails. Just put everything > together in one folder. First, I'd recommend renaming your main program from video.pp to something else to avoid conflict with unit video which is one of RTL units. Second, OpenCV uses unit Dialogs in its implementation. FPC provides unit Dialogs as part of the FreeVision package (fv). FreeVision uses unit Video, which is why adding OpenCV triggered your problem. However, I suspect that the original OpenCV did not intend to use FreeVision (considering the headers referring to use with Delphi) but rather some GUI support unit (assuming that a different unit with the same name may be distributed with Delphi and probably also Lazarus/LCL). I can see at least one call to a function probably provided by that unit being commented out in the provided source so it's possible that the reference to this unit (and the whole uses clause in the implementation section of OpenCV.pas - lines 1718 and 1719) may be removed. Once you fix these, there's a bunch of other problems, but these are not related to your original post. Tomas ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Handling with sources and exebutables with different names
hello all, I am compiling CGI modules with Freepascal in commandline mode. if I do: fpc test.pas the result is "test.exe". But the source name needs to be different from the executable name. For this reason: fpc test.pas -oindex.cgi This command should result in index.cgi, placed on the current folder. However, this command is ignore and I obtain "test.exe" again. My question is: how to produce a executable, compiling from the commandline in FPC 2.6.0, with a different name of its source? Regards, Luciano ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Handling with sources and exebutables with different names
On 17.05.2012 14:09, luciano de souza wrote: hello all, I am compiling CGI modules with Freepascal in commandline mode. if I do: fpc test.pas the result is "test.exe". But the source name needs to be different from the executable name. For this reason: fpc test.pas -oindex.cgi This command should result in index.cgi, placed on the current folder. However, this command is ignore and I obtain "test.exe" again. My question is: how to produce a executable, compiling from the commandline in FPC 2.6.0, with a different name of its source? The above DOES work. Maybe your shell bites you and you need to qoute the option ( => "-oindex.cgi"). Did the compiler write something like the following? Warning: Only one source file supported, changing source file to compile from ".cgi" into "test.pas" Regards, Sven ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Handling with sources and exebutables with different names
On Thu, 17 May 2012, luciano de souza wrote: hello all, I am compiling CGI modules with Freepascal in commandline mode. if I do: fpc test.pas the result is "test.exe". But the source name needs to be different from the executable name. For this reason: fpc test.pas -oindex.cgi This command should result in index.cgi, placed on the current folder. However, this command is ignore and I obtain "test.exe" again. Hm. This should work correctly. On linux, it gives the correct output. I use it on windows too, and it has always worked correctly. I use it for fcgi binaries every day. Try more verbose output, maybe you'll learn something from it. Michael. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] FSplit is deprecated
unixutil another deprecated function that has not written any hint towards its replacement right behind the 'deprecated' keyword (where it would belong). The RTL documentation also does not contain any hints. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] FSplit is deprecated
In our previous episode, Bernd said: > unixutil > > another deprecated function that has not written any hint towards its > replacement right behind the 'deprecated' keyword (where it would > belong). The RTL documentation also does not contain any hints. Unixutil is a barrel of leftovers of 1.0.x times, and mostly obsolete. Originally they were used in the implementation of the unix unit internally (then still called "linux") and mostly meant to implement the dos unit. But in general since 2.0.x it is not recommended to use the dos unit anymore unless it really is for old TP code (and even then I would consider updating). This among others because of 255 char limitations of the dos interface. So use functions from 2.0.x like sysutils.extract* ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Re: Handling with sources and exebutables with different names
Actually, there are no errors. Using cmd.exe on Windows 7 and FPC 2.6.0, I did: fpc test.pas -oindex.cgi I got test.exe and no errors are raised. We can do -d in the commandline or {$ifdef ..} in the source code. Several other options are available from the two modes. Is there a directive, placeable in code, allowing me to define a name for the executable? I am asking to myself: "Did I become crazy? Have I done the test wrongly?" Yes, it can be. However, I did it several times with the same result. I don't know what, but something misleading is wrong. 2012/5/17, luciano de souza : > hello all, > > I am compiling CGI modules with Freepascal in commandline mode. if I do: > > fpc test.pas > > the result is "test.exe". But the source name needs to be different > from the executable name. For this reason: > > fpc test.pas -oindex.cgi > > This command should result in index.cgi, placed on the current folder. > However, this command is ignore and I obtain "test.exe" again. > > My question is: how to produce a executable, compiling from the > commandline in FPC 2.6.0, with a different name of its source? > > Regards, > > Luciano > ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Re: Handling with sources and exebutables with different names
On 17.05.2012 21:09, luciano de souza wrote: Actually, there are no errors. Using cmd.exe on Windows 7 and FPC 2.6.0, I did: fpc test.pas -oindex.cgi I got test.exe and no errors are raised. But did the compiler write something else? A warning maybe (maybe you need to pass "-vw" to see it)? What if you place the "-oindex.cgi" before the "test.pas"? What if you put the "-oindex.cgi" into quotes? I tested it. It DOES work. On Windows as well as Linux. We can do -d in the commandline or {$ifdef ..} in the source code. Several other options are available from the two modes. Is there a directive, placeable in code, allowing me to define a name for the executable? No. You can only change the extension from within code by using {$EXTENSION 'cgi'}. Regards, Sven ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Strange compile error
Hi Tomas, That did the trick! I didn't notice the dialogs unit in the implementation section. After removing it everything works fine now. I got opencv running on windows and displaying the webcam feed on a opengl texture. I will put the code on the ccr as soon as I have access again. In the coming period I'll try to get it working for mac and linux as well after which the wrapper unit possibly could be added to the fpc packages hopefully. Regards, Darius On May 17, 2012, at 1:26 PM, Tomas Hajny wrote: > On Thu, May 17, 2012 11:07, dhkblas...@zeelandnet.nl wrote: > > >> Second try. My previous email with attachement got blocked >> probably. I will send the files now in two emails. Just put everything >> together in one folder. > > First, I'd recommend renaming your main program from video.pp to > something else to avoid conflict with unit video which is one of RTL > units. > > Second, OpenCV uses unit Dialogs in its implementation. FPC provides unit > Dialogs as part of the FreeVision package (fv). FreeVision uses unit > Video, which is why adding OpenCV triggered your problem. However, I > suspect that the original OpenCV did not intend to use FreeVision > (considering the headers referring to use with Delphi) but rather some > GUI support unit (assuming that a different unit with the same name may > be distributed with Delphi and probably also Lazarus/LCL). I can see at > least one call to a function probably provided by that unit being > commented out in the provided source so it's possible that the reference > to this unit (and the whole uses clause in the implementation section of > OpenCV.pas - lines 1718 and 1719) may be removed. Once you fix these, > there's a bunch of other problems, but these are not related to your > original post. > > Tomas > > > ___ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > http://lists.freepascal.org/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Unicode support
17.05.12 2:51, Andrew Brunner wrote: I wanted to ask what the present state of unicode support is now. Compiler supports AnsiStrings with codepage information and converts them between ansistrings and between other string types with implicit codepage conversion. RawByteString and UTF8String are both supported by compiler too. For 2 byte encodings compiler has WideString and UnicodeString types. RTL has only basic support for codepage aware strings and unicodestring type. Most of the code still works with AnsiString. > I'm running into problems with some various strings. Sometimes when a string contains a unicode character postgresql won't allow the insert/update. Also, some MP3 tags contain UTF16, UTF16BE and I really don't know of the best practice on how to handle multi-byte characters in code. It is difficult to say what is wrong - we don't see the code. Anyone want to comment on direction of FPC for Unicode... Ie I think the string field should be able to re-map to UTF8. Is that something that can be done? What string field? Of what class? If you are about string type itself you can use {$H+}, {$codepage UTF-8} and SetMultiByteConversionCodePage(CP_UTF8) if you want to have string type to be utf8 string in your project. What can I do to support unicode in the serving of pages/files/documents/music without having to have encoding aware code. What you want is probably UnicodeString RTL which is not available at the moment. Best regards, Paul Ishenin ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal