MiniFMOD compilation - c

I'm starting development, and yet having lots of problems coming out from the moment I 'm trying to go a little bit out of bounds.
I usually work with CodeBlocks and just tried once to compile using MinGW.
I'm just starting to do program with the GTK library, my other programs were console applications.
So I've downloaded MiniFMOD 1.70 and 1.60 on http://www.fmod.org/index.php/download.
When I compile the main.cpp on a C++ console application project
I get this message (for both MiniFMOD versions).
||=== tryfmod170, Debug ===|
C:\Documents and Settings\Vincent\Bureau\minifmod170\lib\music.h|266|error: redefinition of typedef 'FMUSIC_MODULE'|
C:\Documents and Settings\Vincent\Bureau\minifmod170\lib\minifmod.h|26|note: previous declaration of 'FMUSIC_MODULE' was here|
C:\Documents and Settings\Vincent\Bureau\minifmod170\lib\Fmusic.c|117|error: conflicting types for 'FMUSIC_LoadSong'|
C:\Documents and Settings\Vincent\Bureau\minifmod170\lib\minifmod.h|56|note: previous declaration of 'FMUSIC_LoadSong' was here|
||=== Build finished: 2 errors, 0 warnings ===|
I'm sure it is a pretty simple error but I assume I'm quickly getting confused between all the file types,variables,structures and platforms...a
If somebody could help me I would be very grateful

It looks like you are including music.h and minifmod.h both of which have typedefs for FMUSIC_MODULE. I think you just need minifmod.h as it is the interface header, music.h is an internal header.

Related

crosstool-NG ct-ng build step=libc_main issue w/GCC 11

Thanks to anyone who may be able to help sort out an issue I am having building the toolchain. I am in a Docker container (provisioned w/Ubuntu 'jammy' and am at the build phase.
My .config set to armv6-rpi-linux-gnueabihf and makes it to libc_main before failing with the following:
[EXTRA] Building C library localedef
[ERROR] ../sysdeps/nptl/pthread.h:744:47: error: argument 1 of type 'struct __jmp_buf_tag *' declared as a pointer [-Werror=array-parameter=]
Reading up on the issue, it seems gcc added some additional sanity check(s) for mis-matched array declarations - gcc.
I have tried a couple of times to change the extern declaration in ../sysdeps/nptl/pthread.h alas this seems to cause other issues in setjmp.h or it gets reverted by ct-ng.
I am wondering if I need to go to an older 8.x revision of gcc, to remove this issue.
Any insights greatly appreciated!

Unable to compile SDL2 for obscure reasons

I don't know if the current SDL code source is reliable (normally it is), but here is what I got when I try to compile it by myself.
/usr/include/spa-0.2/spa/utils/string.h: In "spa_strtod" function:
/usr/include/spa-0.2/spa/utils/string.h:325:9: error: ISO C90 prohibits mixing declarations and code [-Werror=declaration-after-statement]
325 | locale_t prev = uselocale(locale);
| ^~~~~~~~
cc1: some warnings are treated as errors
make: *** [Makefile:627:build/SDL_pipewire.lo] Error 1
I'm on Arch, I'm using gcc as C/C++ compiler. Please help me because I need to recompile SDL myself to maybe solve another problem I got with the library.

ld error while building GD library for Haskell on Windows

When installing the Haskell GD package through cabal, on Windows (using MinGW), I get the following warnings:
Warning: resolving _gdImagePtrDestroyIfNotNull by linking to _gdImagePtrDestroyIfNotNull#4
Warning: resolving _gdImageCopyRotated90 by linking to _gdImageCopyRotated#36
Use --enable-stdcall-fixup to disable these warnings
Use --disable-stdcall-fixup to disable these fixups
Note that these are precisely the functions defined in gd-extras.
Then, when actually compiling a Haskell program which uses gd, I get the following errors:
Linking Main.exe ...
[...]\cabal\gd-3000.7.3\ghc-7.4.1/libHSgd-3000.7.3.a(Internal.o):fake:(.text+0x2211):undefined reference to 'gdImageCopyRotated90'
[...]\cabal\gd-3000.7.3\ghc-7.4.1/libHSgd-3000.7.3.a(Internal.o):fake:(.text+0x500a):undefined reference to 'gdImagePtrDestroyIfNotNull'
[...]
collect2: ld returned 1 exit status
I'm unable to figure out how to fix this — it's already taken me ages to get to this point, as I've had many more issues trying to get it working, but this seems like the final hurdle. I have tried enabling/disabling stdcall fixup, and also changing in which file these functions are defined (as gd-extras seemed to be a potential issue), but that hasn't adressed the issues.
Thanks for any help.
You need to pass explicit linker flags to ghc, pointing to the library. The Haskell GD library is automatically linked, but the dll will not be linked as well unless you tell ghc about it. The stdcall-fixup errors are a red herring here.

Compilation error in visual C++

I am using Visual studio 2010 for building C project. My project contains a number of header files,source file and parsers. It uses lex and bason files. I am getting a single error during the compilation and íé the following
abc.y:error C2065: 'INPUT' : undeclared identifier
I tried the solutions I am getting like including
#define WIN32_WINNT >= 0x0501
in my main.c file before the inclusion of any of the header files.I am not able to get rid of this error. Could you please let me know what Can be the reasons for this error?
EDIT
The snippet of code that is showing error is:
list_Cons(0, list_List((POINTER)INPUT)
The surprising thing is that If i alter INPUT into INPUT1, I get the same error. It is stoic to change.
Presumably you read this and this.
#define WIN32_WINNT >= 0x0501 wont work. You should try using #define WIN32_WINNT 0x0501 instead.
Also, check that you are actually #including winuser.h
A C++ compiler cannot process a *.y file. For that you need a yacc / bison program, which does not come included with Visual Studio 2010.
For myself I use CMake which can generate MSVC projects along with other build types. You can tell it that a .y needs to be processed outwith the C/C++ files and it will instruct MSVC to invoke whatever external tools are necessary to preprocess the non-C/C++ parts.

zlib on z/OS USS

Im trying to compile z/lib on z/OS USS(thats right a mainframe). ive got gmake and the c89 compiler (which im assuming is c89 standards compliant) and USS is supposed to be POSIX compliant.
But zlib seems to be tripping up on
struct internal_state FAR *state; /* not visible by applications */
with the following error(s)
c89 -O3 -DUSE_MMAP -D_XOPEN_SOURCE_EXTENDED=1 -D_POSIX_SOURCE -c -o example.o example.c
ERROR CCN3277 ./zlib.h:92 Syntax error: possible missing ';' or ','?
ERROR CCN3007 ./zlib.h:92 "struct internal_state" is undefined.
ERROR CCN3166 ./zlib.h:103 Definition of function FAR requires parentheses.
ERROR CCN3276 ./zlib.h:103 Syntax error: possible missing '{'?
ERROR CCN3273 ./zlib.h:124 Missing type in declaration of gz_header.
ERROR CCN3166 ./zlib.h:126 Definition of function gz_header requires parentheses.
ERROR CCN3276 ./zlib.h:126 Syntax error: possible missing '{'?
WARNING CCN3137 ./zlib.h:1346 Declaration must declare at least one declarator, tag, or the members of an enumeration.
ERROR CCN3275 ./zlib.h:1350 Unexpected text z encountered.
ERROR CCN3282 ./zlib.h:1350 The type of the parameters must be specified in a prototype.
ERROR CCN3275 ./example.c:95 Unexpected text file encountered.
ERROR CCN3045 ./example.c:95 Undeclared identifier gzFile.
ERROR CCN3046 ./example.c:96 Syntax error.
ERROR CCN3045 ./example.c:98 Undeclared identifier file.
ERROR CCN3019 ./example.c:523 Expecting an array or a pointer to object type.
ERROR CCN3280 ./example.c:527 Function argument assignment between types "const char*" and "int" is not allowed.
CCN0793(I) Compilation failed for file ./example.c. Object file not created.
FSUM3065 The COMPILE step ended with return code 12.
FSUM3017 Could not compile example.c. Correct the errors and try again.
gmake: *** [example.o] Error 3
when i progressively take out the FAR * (i think its a far pointer but im really not that sure) the errors go away. But as this is a library, im not sure what other artifacts are going to be produced by removing this.
has anybody got any ideas?
any old mainframe heads out there?
it turns out there is a previous version of zlib that compiles on USS, version 1.1.4 or close to that. Its a back level, but i presume this works because it is before the implementation of the FAR pointer in the latest code. So atm i think ive got it to work.
thanks for all your help.
Regards
Mark.
FAR is not a C89 keyword, it is a Microsoft/Intelism and is probably #defined somewhere. If not, you need to define it as nothing:
#define FAR
However, this will probably only fix one of many problems. I would guess that the library uses some form of conditional compilation to handle things like FAR pointers - you need to read the docs to find which configuration is most suitabkle for your platform.
I'd use xlc instead of c89 since xlc is your system default compiler but you'll still probably have issues. I'd subscribe to the MVS-OE email list, the people on it are quite helpful. The link to info about the list appears to be down now so send email to
LISTSERV#VM.MARIST.EDU
with the message: INFO MVS-OE
FWIW, IBM provides a prebuilt version of zlib that includes support for the compression hardware (so-called zEDC) available on recent-vintage mainframes. See zlib for zEnterprise Data Compression

Resources