|
|
LPCTSTR = Long Pointer to Const Tchar STRing
This will be const wchar_t * for Unicode builds and const char * for ANSI/multi-byte builds.
|
|
|
|
|
|
This has nothing to do with compiler options, per se. Use the _T() macro for the format string.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
ForNow wrote: mainly with CString.Format (I was using it like the C sprintf) and it looked for const wchar_t * for the format string
Please, next time show the exact error message together with a line (or a couple of lines) causing the error.
|
|
|
|
|
I have downloaded and installed ImageMagick++ from http://www.imagemagick.org/Magick++/.
I am using Windows7 32 bit and Visual Studio 2008. I want to use the ImageMagick in an existing project. I made the required/suggested changes to my project properties like adding dependencies etc. I added three libraries in the additional dependencies (CORE_RL_Magick++_.lib,CORE_RL_MagickCore_.lib and CORE_RL_MagickWand_.lib
I added
Magick++.h header file and
using namespace Magick
Then
Magick:: Image image (No error)
image.read("5.png") throws an error "ErrorMissingDelegate at memorry location ....".
I tried other image formats also, but same error.
Please help.
|
|
|
|
|
|
Thanks for the reply.
The complete message is Magick::ErrorMissingDelegate at memory location 0x0012fafc.
I can understand there are some missing delegates but I really do not understand how do I have to install them.
Regards
|
|
|
|
|
I have only used ImageMagick on Linux so far and never build it (used the distribution binaries).
You should read the provided documentation: Advanced Windows Installation[^]
Read the "ENVIRONMENT VARIABLES" section and check if your build has created the required modules. If not, check the build configuration.
To check if it works in general, use an image format that does not require a delegate like GIF or JPEG.
If you are still stuck you might get better help in one of the ImageMagick Forums[^] (or even find the solution in an existing thread or FAQ there).
|
|
|
|
|
Thanks again. I am also using the Windows Binaries. I tried with GIF and JPEG but same error message.
|
|
|
|
|
Have you initialised the library?
Note, under Windows (and possibly the Mac) it may be necessary to initialize the ImageMagick library prior to using the Magick++ library. This initialization is performed by passing the path to the ImageMagick DLLs (assumed to be in the same directory as your program) to the InitializeMagick() function call. This is commonly performed by providing the path to your program (argv[0]) as shown in the following example:
int main( int argc, char ** argv) {
InitializeMagick(*argv);
...
and copied the DLLs to the path of your executable (Debug resp. Release) or used the path to the DLLs?
|
|
|
|
|
Thanks for the reply. Yes, it is as advised by you. I am not even able to run the demo project (Button) provided with the Windows Binary Installer.
|
|
|
|
|
Then I'm not able to help anymore.
I can only suggest to check your installation (all required modules present) and the setup (e.g. all required pathes set).
|
|
|
|
|
Hi,
Sounds like you are compiling ImageMagick without any image libraries.
Rajeev Raina wrote: Magick:: Image image (No error)image.read("5.png") throws an error "ErrorMissingDelegate at memorry location ....".I tried other image formats also, but same error.
LIBPNG[^]
LIBJPEG[^]
LibTIFF[^]
Many others...
Then recompile with:
./configure
--with-png=yes
--with-jpeg=yes
--with-tiff=yes
It can be alot of work... you might be better off downloading a precompiled binary:
Install from Binary Distribution @ ImageMagick[^]
Best Wishes,
-David Delaune
|
|
|
|
|
Hi guys,
When i first started learning programming language(ofcourse C!!) in my college I used to practice it on turboc compiler, Now a days we are using visual studio and online compilers and I found myself that the program which is executed in turboc without any error will show up with an error/s or warning/s in visual studio, if I made the necessary corrections to the program in order to execute it in visual studio with out any errors, it show will show up with errors on using online compiler why is that happening??, what is the difference between them??, why couldn't they execute the same program(say C program) which is already error free in other compilers??
|
|
|
|
|
Usually because the compilers are different levels, or do not implement the full standards properly. TurboC is very old and most likely allows things that Microsoft's C compiler (not Visual Studio) does not. As to online compilers you would need to check their details.
|
|
|
|
|
Thanks a lott..I think ur answer should help me.
|
|
|
|
|
That happens most likely when using non standard functions from compiler specific libraries (defined in corresponding header files). The Turbo-C and Microsoft compilers are only available for DOS resp. Windows and provide therefore some OS specific functions. Online compilers are usually not OS specific and will therefore only support standard C.
The C standard itself has also been changed with time. So recent compilers using a newer standard may issue warnings or errors for code that was tolerable with older standards. However, these compilers usually have an option to compile code using the C89/C90 standard.
A short overview of the C standard history:
- K&R, 1978
- ANSI C / C89, 1989
- ISO C / C90, 1990; basically the same as C89
- C99
- C11
So C code conforming to the standards should compile with all compilers supporting that standard and when selecting an older standard if necessary.
But code conforming to the C standard is rather rare. Most code will use some OS specific functions like POSIX on Unix systems and the DOS specific functions with DOS/Windows compilers.
|
|
|
|
|
thank u
|
|
|
|
|
Jochen Arndt answer is almost spot on. The only thing I would add is on many compilers they have command line flags you can use to set the standard of C you want or need.
On GCC compilers for example it's the -std flag .... -std=c89 makes it compile with c89 standard etc. On visual studio it's under the compiler settings options on your project settings.
So if you have old code you know the standard it was written with you can just ask the compiler to use that standard. Really old code you can basically guess is going to be C89 and selecting that will remove many of the warnings and errors that won't be accepted by the newer standards.
The newer standards stop some old coding styles that were considered dangerous either from the programmer making a mistake or hackers exploiting with things like buffer overruns. The newer standards also have some new features in the language the old syntax won't understand.
So if you are writing new code you should write to the newest standard your compiler accepts. If you just need to compile an old code just change the compiler standard back to what you need or else you must correct the code to the newer standard. On large code libraries that can be a daunting task and so usually you take the standard change option.
In vino veritas
|
|
|
|
|
Oh Thanks....
|
|
|
|
|
Price.
(oh, and usefulness)
|
|
|
|
|
I am writing code for an embedded ARM processor and I am compiling with GNU GCC. I want to do the following:
#define PA0 GPIOA, GPIO_PIN0
#define PIN_DEF(PORT, PIN) \
GPIO_TypeDef* PORT; \
uint16_t PIN;
PIN_DEF(PA0)
However, I get an error message saying PIN_DEF requires 2 arguments but I'm only giving it 1. Does anybody know how to solve this?
|
|
|
|
|
You have defined it as PIN_DEF(PORT, PIN) , so it requires two parameters. Either change the definition, or provide the second parameter. You could try
#define PA0 (GPIOA, GPIO_PIN0)
|
|
|
|
|
The generic answer is you can use __VA_ARGS__ its used to pass variable arguments thru macros, something like this is generally how it used to feed a multi variable function
#define LOG_DEBUG(...) printf(__VA_ARGS__)
For what you are doing you pass the arguments thru two macros the first take any number of variables the second macro enforces it is using just two values.
#define PA0 GPIOA, GPIO_PIN0
#define PIN_DEF_A(A, B) \
GPIO_TypeDef* PORT; \
uint16_t PIN;
#define PIN_DEF(...) PIN_DEFA(__VA_ARGS__)
Your code doesn't make a lot of sense to me because I can't see the types. I am guessing GPIO_TypeDef* is a volatile to a 16 bit port and what you are trying to do is MACRO the output of a 16 bit value which would usually look actually like this
*((volatile uint16_t*) 0xXXXXXXXXX = 0x????;
*((volatile uint16_t*) 0x3F000000) = 0x1234;
Using the above macro form for that would be
#define PA0 0x3F000000,0x1234
#define PIN_DEFA(A, B) *((volatile uint16_t*) (A)) = (B)
#define PIN_DEF(...) PIN_DEFA(__VA_ARGS__)
PIN_DEF(PA0);
In vino veritas
modified 2-Mar-17 8:27am.
|
|
|
|