I am attempting to compile C code which accesses the[ libredwg library](https://www.gnu.org/software/libredwg/) through a header file: *#include "dwg.h"* When I attempt to compile my code using *gcc -o ldwg load_dwg.c*, I get the following error: *undefined reference to `dwg_read_file'*. However, if I load the file in Kdevelop, I get no such error message. If I change `dwg_read_file' to 'foo' (which is obviously not defined), then I get an error *Implicit declaration of function 'foo' is invalid in C99 [-Wimplicit-function-declaration]* so I know that the function is being read. How can I make gcc see the function definition?

Member Avatar
Member Avatar
+0 forum 6

Hi, while I was looking at a program in my textbook, i encountered this *program to reverse a string using recursive procedure*- #include <stdio.h> int main(void) { void rev(); printf("Enter a line of text:\n"); rev(); } void rev() { char c[20]; if((c==getchar())!='\n') rev(); putchar(c); } I couldn't quite understand the logic the author used, so I went to check the program on my pc which gave the error- > Runtime error(Exit status:139(Invalid memory reference)) What's this error about? and Is the program in textbook wrong?

Member Avatar
Member Avatar
+0 forum 2

I have a function pointer to calculate addition, substraction, etc for 2 inputed arguments and 1 inputed operation. It works fine when the code return the indexed function pointer (with the inputed index) function pointer with both inputed arguments. but when I initialize a variable with as value this indexed f.p. i. , the result is an address, when I try to dereference this i.f.p. the result is `-11`. I don't understand why. Can someone explain me why? #include <stdio.h> //Compiler version gcc 6.3.0 /*On declare 4 fonctions*/ int ad (int num1, int num2); int sub (int num1, int num2); …

Member Avatar
Member Avatar
+0 forum 3

I dont understand the appearent discrepency in the treatment of the variabe x, y, and z. Why y isn't treated as x and z? #include <stdio.h> #include <string.h> int main() { char result[100] = "Philippe Dupont 30"; char x[50]; char y[50]; int z; /*We use sscanf to give a value to the three variables x, y and z. the two first are strings and don't need &.*/ sscanf(result, "%s%s%d", x, y, &z); /*Printing the value of the variables works fine.*/ printf("%s\n", x); printf("%s\n", y); printf("%d\n", z); /*But when I want to print a string in which the variables are, the …

Member Avatar
Member Avatar
+0 forum 2

Hello Everyone, I have an FPGA application that has some function (i.e: Matrix Multiplication) now I want to create the memory interface for FPGA communication based on the model pushed into the FPGA? For example, If we have the size of 1024 and the size of data is 10 bit how we can create memory interface a/c to the actual size? 1. What are the possibilities which can achieve this mechanism? 2. Can you help me to make pseudo-code or c-code? I am trying to used sds_lib.h (**same as #include <stdlib.h>**) functions but I have no idea how to that …

Member Avatar
Member Avatar
+0 forum 1

i'm creating a program using Code Blocks with GNU\GCC compiler. i'm using Windows 10 with Windows Defender. my program create a txt files(instead a text files, we can speak binary files too), but the Windows Defender can delete the file(and i have sure), for avoid these problem i must disable the Windows Defender. my question is: can i compile my program(even using a compiler\linker flag) for avoid the Windows Defender problems? ok.... i can disable the Windows Defender and make an exception.... but if i share my program, the new user will get the same problem :( can anyone advice …

Member Avatar
Member Avatar
+0 forum 16

The End.