# compiling problem x86\_64

**URL:** http://forum.qcad.org/t/compiling-problem-x86-64/284
**Category:** dxflib Troubleshooting and Problems
**Created:** [May 24, 2009, 11:38am UTC](http://forum.qcad.org/t/compiling-problem-x86-64/284 "2009-05-24T11:38:50Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![johannes911](http://forum.qcad.org/letter_avatar_proxy/v4/letter/j/7cd45c/32.png) [@johannes911](http://forum.qcad.org/u/johannes911)
#### Post date: [May 24, 2009, 11:38am UTC](http://forum.qcad.org/t/compiling-problem-x86-64/284/1 "2009-05-24T11:38:50Z")

</div>

Hello to all,  
I try to compile qcad but the first part stops with error:

src/dl\_writer.h: In member function ‘void DL\_Writer::entityAttributes(const DL\_Attributes&) const’:  
src/dl\_writer.h:337: error: ‘strcasecmp’ was not declared in this scope  
src/dl\_writer\_ascii.cpp: In member function ‘virtual void DL\_WriterA::dxfReal(int, double) const’:  
src/dl\_writer\_ascii.cpp:72: error: ‘strlen’ was not declared in this scope  
src/dl\_writer\_ascii.cpp:81: error: ‘strlen’ was not declared in this scope  
src/dl\_writer\_ascii.cpp: In static member function ‘static void DL\_WriterA::strReplace(char\*, char, char)’:  
src/dl\_writer\_ascii.cpp:147: error: ‘strlen’ was not declared in this scope  
make: \*\*\* [src/dl\_writer\_ascii.o] Fehler 1  
Building libdxf.a failed  
  
  
I read the other thread in this forum, but on my opensuse 11.1 system there is no compat…

gcc++ is 4.3…  
  
  
what can I do / test?

thanks a lot  
Johannes

---

<div class="post-metadata">

### Author: ![red\_team316](http://forum.qcad.org/letter_avatar_proxy/v4/letter/r/c77e96/32.png) [@red\_team316](http://forum.qcad.org/u/red_team316)
#### Post date: [June 1, 2009, 5:31am UTC](http://forum.qcad.org/t/compiling-problem-x86-64/284/2 "2009-06-01T05:31:46Z")

</div>

EDIT:  
Do not change to \<string.h\>, or this will cause the test program to fail at make.

===========================================

Install gcc/g++ 4.2, apparently there is a bug of some sort with 4.3. Reference: [I Challenge Thee](http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=474804)

```plaintext
./configure CXX=g++-4.2
make depend
make

```

Then make the test program in the test folder:

```plaintext
make
./test demo.dxf

```

===========================================  
For a DLL/shared library:

```plaintext
./configure CXX=g++-4.2 CFLAGS=-fPIC
make depend
make

```

Then go to the src directory where the object files are and do:

```plaintext
g++-4.2 -shared -o libdxflib.so dl_dxf.o dl_writer_ascii.o

```

Then copy the .so somewhere in your system path (I put mine in /usr/lib). Then run a “make clean” so that the libdxflib.a in the /dxflib-2.2.0.0-1.src/lib folder is removed(or manually delete it). This will ensure that when you make the test program that it uses the shared library rather than the static one.

Go to the test folder and run:

```plaintext
make
./test demo.dxf

```

I did this on a Kubuntu Jaunty 9.04 x86\_64 box and it worked just fine for dxflib 2.2.0.0. I posted how to make a shared library, because apparently the documentation on dxflib is somewhat outdated(2.0.x.x) and “make shared” does not work as it says it will.

---

<div class="post-metadata">

### Author: ![Ziko](http://forum.qcad.org/letter_avatar_proxy/v4/letter/z/77aa72/32.png) [@Ziko](http://forum.qcad.org/u/Ziko)
#### Post date: [November 22, 2010, 12:26pm UTC](http://forum.qcad.org/t/compiling-problem-x86-64/284/3 "2010-11-22T12:26:20Z")

</div>

Hello,

I have the same problem. I’m on windows with cygwin, I run:

. / Configure CXX = g + + -4.2  
MinGW-make depend  
MinGW-make

The first two steps seem to go well, while “MinGW-make” generates the following error:

"$ Mingw32-make  
-I./src g + + -4.2-g-O2-DPACKAGE\_NAME = \ ""-DPACKAGE\_TARNAME = \ ""-DPACKAGE\_VER  
SION = \ ""-DPACKAGE\_STRING = \ ""-DPACKAGE\_BUGREPORT = \ ""-DUNIX = 1-DX\_DISPLAY\_MI  
SSING = 1-DSTDC\_HEADERS = 1-DHAVE\_SYS\_TYPES\_H = 1-DHAVE\_SYS\_STAT\_H = 1-DHAVE\_STDLIB\_  
H = 1-DHAVE\_STRING\_H = 1-DHAVE\_MEMORY\_H = 1-DHAVE\_STRINGS\_H = 1-DHAVE\_INTTYPES\_H = 1 -  
DHAVE\_STDINT\_H = 1-DHAVE\_UNISTD\_H = 1-DHAVE\_LIMITS\_H = 1-c src / dl\_writer\_ascii.cpp  
-O src / dl\_writer\_ascii.o  
process\_begin: CreateProcess (NULL, g + + -4.2 -I./src-g-O2-DPACKAGE\_NAME = \ ""-D  
PACKAGE\_TARNAME = \ ""-DPACKAGE\_VERSION = \ ""-DPACKAGE\_STRING = \ ""-DPACKAGE\_BUGR  
Eport = \ ""-DUNIX = 1-DX\_DISPLAY\_MISSING = 1-DSTDC\_HEADERS = 1-DHAVE\_SYS\_TYPES\_H = 1  
-DHAVE\_SYS\_STAT\_H = 1-DHAVE\_STDLIB\_H = 1-DHAVE\_STRING\_H = 1-DHAVE\_MEMORY\_H = 1-DHAVE  
\_STRINGS\_H = 1-DHAVE\_INTTYPES\_H = 1-DHAVE\_STDINT\_H = 1-DHAVE\_UNISTD\_H = 1-DHAVE\_LIMI  
TS\_H = 1-c src / dl\_writer\_ascii.cpp-o src / dl\_writer\_ascii.o, …) failed.  
make (e = 2): Can not find the file specified.  
Mingw32-make: \*\*\* [src / dl\_writer\_ascii.o] Error 2 "

Sorry for the flood.

---

<div class="post-metadata">

### Author: ![roddy](http://forum.qcad.org/letter_avatar_proxy/v4/letter/r/a5b964/32.png) [@roddy](http://forum.qcad.org/u/roddy)
#### Post date: [January 4, 2011, 12:45pm UTC](http://forum.qcad.org/t/compiling-problem-x86-64/284/4 "2011-01-04T12:45:40Z")

</div>

I have the same problem on windows 7 with cygwin and MinGW.  
I get the same make error as Ziko about the file dl\_writer\_ascii.o

Can someone please help with this?

---

<div class="post-metadata">

### Author: ![takar](http://forum.qcad.org/letter_avatar_proxy/v4/letter/t/3e96dc/32.png) [@takar](http://forum.qcad.org/u/takar)
#### Post date: [April 18, 2011, 9:22pm UTC](http://forum.qcad.org/t/compiling-problem-x86-64/284/5 "2011-04-18T21:22:07Z")

</div>

> [@red\_team316](#):
>
> EDIT:  
> Do not change to \<string.h\>, or this will cause the test program to fail at make.

I had the same issue using gcc-4.3 on debian. Nevertheless, if you add the library string.h everything works fine for me - including the test program. I think this is a better solution than installing a different compiler… correct me if I’m wrong!

file: dl\_writer\_ascii.php

```plaintext
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <stdio.h>
[b]#include <string.h>[/b]

#include "dl_writer_ascii.h"
#include "dl_exception.h"

```
