0

First of all, I'm a begginer in C programming. I have been looking for a solution for a long time but I don't know what's going on with mi code or with Eclipse configuration. Basically, the problem occurs when I insert in the code a function from a external library. For some reason, eclipse is not able to debugg the code.

Let me explain that with a simple example:

Works incorrectly:

int main(void) {

    char        version[32];

    puts("!!!Hello World!!!"); /* prints !!!Hello World!!! */

    En2version(version);

    printf("Version %s \n", version);

    return 0;

}

Works correctly:

int main(void) {

    char        version[32];

    puts("!!!Hello World!!!"); /* prints !!!Hello World!!! */

    printf("Version %s \n", version);

    return 0;

}

En2version() is the function took from the external library, and just eliminating it from the code it makes it work correctly.

I think the library is correctly linked to the project (there is no error when .lib is linked). Could you help me with some insight about what is happening?

Thank you all.

  • What is the prototype of `En2version` and what is it supposed to do? – Paul Ogilvie Apr 09 '19 at 10:32
  • Prototype: void En2version( char * version ); It should fill "version" variable with the version number of the library – predator100283542 Apr 09 '19 at 10:36
  • What do you mean with "Works incorrectly". Does it print anything? Does it abort? – Paul Ogilvie Apr 09 '19 at 10:45
  • It shows "terminated" but nothing is printed in the console. When I supress that line it prints !!!Hello World!!! Version Ä[´tÐ@ – predator100283542 Apr 09 '19 at 10:50
  • When the line is suppressed, it prints the value of the uninitialized char variable, but that is not the real problem. – Paul Ogilvie Apr 09 '19 at 10:55
  • There is insufficient information to help you, sorry. Is it a DLL or static linked library? What does the make file look like? Where is the library from? What does compiler/make/linker say? Is 32 chars enough? Did the documentation say that? – Paul Ogilvie Apr 09 '19 at 10:57

1 Answers1

0

I don't see your #include

Whatever your are using, you need debugging symbols

  • either using the Program Database way if you have a .pdb
  • either using the Embedded Symbols way if you have a no .pdb
Guillaume D
  • 2,202
  • 2
  • 10
  • 37