Re: [m-users.] Pass options to gcc compiler

"Sean Charles (emacstheviking)" <[email protected]>
Newsgroups gmane.comp.lang.mercury.general
Message-ID <[email protected]>
OK, that showed me the includes for mmc, I didn't phrase the question clearly enough, my fault. What I tried to ask for is how do I know what the final set of include paths is at compile time, and what compiler does mmc use as the default?

I wrote a simple test program, which compiles, links and runs just fine:

➜  agame cat test.c
#include <stdio.h>
#include <SDL.h>

int main(int argc, char* argv[]) {
    SDL_version v;
    SDL_GetVersion(&v);
    printf("%i.%i.%i\n", v.major, v.minor, v.patch);
    return 0;
}


➜  agame gcc test.c -o test `pkg-config --cflags sdl2` `pkg-config --libs sdl2`
➜  agame ./test
2.24.1

and

➜  agame clang test.c -o test `pkg-config --cflags sdl2` `pkg-config --libs sdl2`
➜  agame ./test
2.24.1


This must mean then that the compiler used to compile he mercury generated files is either not 'gcc' or the '-I' flag has not been passed through? I am at a loss as this Makefile and the flags worked fine on my intel mac, I must have written a dozen sdl2 programs without issue.

Sean.



> On 16 Nov 2022, at 20:35, Zoltan Somogyi <[email protected]> wrote:
> 
> 
> 2022-11-17 07:26 GMT+11:00 "Sean Charles (emacstheviking)" <[email protected]>:
>> Is there a way to ask the compiler to show what include paths it has when compiling the generated C code ?
> 
> --output-c-include-dir-flags
> 
> Zoltan.

_______________________________________________
users mailing list
[email protected]
https://lists.mercurylang.org/listinfo/users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.