Pelles C forum

Pelles C => Bug reports => Topic started by: frankie on June 07, 2021, 04:16:51 PM

Title: pocc fails when compiling with debug enabled and data import from DLL.
Post by: frankie on June 07, 2021, 04:16:51 PM
Compiling with pocc the following snippet:
Code: [Select]
#include <stdio.h>
#include <windows.h>

__declspec(dllimport) int a;

int main(int argc, char *argv[])
{
printf("%d\n", a);
return 0;
}
Fails when debug is enabled with the following error:
Code: [Select]
D:\test\data_export_bug.c(9): error #3120: [asm] Symbol 'a' is undefined.It compiles ok without debug enabled.
Title: Re: pocc fails when compiling with debug enabled and data import from DLL.
Post by: Pelle on June 07, 2021, 07:05:55 PM
Confirmed.

The good news (for me) is that I seem to have fixed this already in the upcoming version.
The bad news (for you) is that the only workaround I can think of is to produce an assembly file from the compiler, hand-edit this file, and the feed it back into the compiler. This is... um... "a bit complicated".
Title: Re: pocc fails when compiling with debug enabled and data import from DLL.
Post by: Grincheux on June 07, 2021, 10:08:27 PM

Quote
The good news (for me) is that I seem to have fixed this already in the upcoming version.
A good news for us would be to know when
Title: Re: pocc fails when compiling with debug enabled and data import from DLL.
Post by: TimoVJL on June 08, 2021, 07:03:37 AM
Meanwhile ...
Code: [Select]
...
extern
__declspec(dllimport) int a;
...
Title: Re: pocc fails when compiling with debug enabled and data import from DLL.
Post by: frankie on June 08, 2021, 02:58:14 PM
Meanwhile ...
Code: [Select]
...
extern
__declspec(dllimport) int a;
...
Good trick Timo  ;D
Title: Re: pocc fails when compiling with debug enabled and data import from DLL.
Post by: frankie on June 08, 2021, 02:59:39 PM

Quote
The good news (for me) is that I seem to have fixed this already in the upcoming version.
A good news for us would be to know when
I Agree...  8)
Title: Re: pocc fails when compiling with debug enabled and data import from DLL.
Post by: Pelle on June 08, 2021, 07:15:24 PM
It's finished when it's finished. I'm not going to speculate, and I'm not going to be rushed.

I always start with the C compiler, which is mostly done for now, and then continue with other tools and tasks. The C runtime needs some updates, other things need to be researched, which always takes time, the documentation needs to be updated, which is boring as hell so it will take double time, and so on.
Title: Re: pocc fails when compiling with debug enabled and data import from DLL.
Post by: frankie on June 08, 2021, 11:10:07 PM
It's finished when it's finished.
Ok, take it easy  ;)