NO

Author Topic: pocc fails when compiling with debug enabled and data import from DLL.  (Read 116 times)

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 1826
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.

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2122
    • http://www.smorgasbordet.com
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".
/Pelle

Online Grincheux

  • Member
  • *
  • Posts: 252
  • Never be pleased, always improve
    • Arachne

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
-------------------------
Kenavo / Bye

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 1934
Meanwhile ...
Code: [Select]
...
extern
__declspec(dllimport) int a;
...
May the source be with you

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 1826
Meanwhile ...
Code: [Select]
...
extern
__declspec(dllimport) int a;
...
Good trick Timo  ;D

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 1826

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)

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2122
    • http://www.smorgasbordet.com
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.
/Pelle

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 1826
It's finished when it's finished.
Ok, take it easy  ;)