Anybody managed to use a Masm32 algo in G++? It throws e.g.
error: expected constructor, destructor, or type conversion before ';' token
for
extern "C" __stdcall atodw(char *szStr);
int main(void)
{
int somenumber=atodw("123");
Hello Jochen,
You need to specify the return type of the function in the declaration :
extern "C" void __stdcall StdOut(char *szStr);
int main(void)
{
char s[]="Hello world!";
StdOut(s);
return 0;
}
set PATH=%PATH%;\MinGW\bin
g++ -c hello.cpp
g++ -static-libstdc++ -static-libgcc -s hello.o -o hello.exe \masm32\lib\masm32.lib
Thanks, Erol. The hello world is working now.
Jochen/Erol,
Isn't that a violation of Hutch's masm32 library use policy?
James
Nope.
Ok,
now I remember why I could not use it; but to be fair it was several years ago and my memory fades more every day.
Item #4:
You cannot use the MASM32 Project to write software for Non-Microsoft Operating Systems
when I was tinkering with jwasm on Linux
:)
Hutch,
That was also a Microsoft restriction was it not?
Now that they are providing cross platform compiling with Visual Studio 2015 will that be relaxed?
James
Hello Jochen,
The C equivalent :
extern void __stdcall StdOut(char *szStr);
int main(void)
{
char s[]="Hello world!";
StdOut(s);
return 0;
}
set PATH=%PATH%;\MinGW\bin
gcc -c hello.c
gcc -static-libstdc++ -static-libgcc -s hello.o -o hello.exe \masm32\lib\masm32.lib
> Now that they are providing cross platform compiling with Visual Studio 2015 will that be relaxed?
Nope.
I am inclined to return back to GPL what I get from it, nothing.