NO

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

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2096
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.
It is better to be hated for what you are than to be loved for what you are not. - Andre Gide

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • 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

Grincheux

  • Guest

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

Offline TimoVJL

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

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2096
Meanwhile ...
Code: [Select]
...
extern
__declspec(dllimport) int a;
...
Good trick Timo  ;D
It is better to be hated for what you are than to be loved for what you are not. - Andre Gide

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2096

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)
It is better to be hated for what you are than to be loved for what you are not. - Andre Gide

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • 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: 2096
It's finished when it's finished.
Ok, take it easy  ;)
It is better to be hated for what you are than to be loved for what you are not. - Andre Gide