compiling problem x86_64

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

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

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

Then make the test program in the test folder:

make
./test demo.dxf

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

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

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

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:

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.

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.

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?

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

#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"