User forums > Help

Problem compiling with DM/STLport

<< < (2/2)

tiwag:

--- Quote from: mandrav ---I haven't worked with DM much, but are you sure it's using sc.ini when invoked by C::B?

--- End quote ---
yes it does for sure! i use it this way and don't have any problems


--- Quote from: mandrav ---If I were you, I would add the above directories in the global directories option for the DM compiler...

--- End quote ---
works just as well of course,
in addition it gives more flexibility, if using other stl libraries,
but in fact, when one uses DMC, stlport is the only one which works for now with
reasonably less troubles ...  :)




--- Quote from: Prjit ---
--- Quote from: tiwag ---edit your sc.ini so that it contains the pathes to your stlport includes and libs directories.

--- End quote ---

I think i allready did that...

--- End quote ---

i use the absolute path to the stlport library and it works like a charm

here's my sc.ini:
--- Code: ---[Version]
version=7.51 Build 020

[Environment]
PATH=%PATH%;"%@P%\..\bin"
BIN="%@P%\..\bin"
INCLUDE="D:\dm\stlport\stlport";"%@P%\..\include";"%@P%\..\mfc\include";%INCLUDE%
LIB="%@P%\..\lib";"%@P%\..\mfc\lib";%LIB%
HELP="%@P%\..\help"
--- End code ---


result:

--- Code: ---Project   : Console application
Compiler  : Digital Mars Compiler (called directly)
Directory : D:\cpp\_projects\dm\hello_stlport\
--------------------------------------------------------------------------------
Switching to target: default
dmc.exe -mn -c       -I"D:\dm\include" -o.objs\hello.o hello.cpp
link.exe /NOLOGO    .objs\hello.o , "D:\cpp\_projects\dm\hello_stlport\hello_stlport.exe", ,  
Process terminated with status 0 (0 minutes, 0 seconds)
0 errors, 0 warnings
--- End code ---



codeblocks project file:

--- Code: ---<?xml version="1.0"?>
<!DOCTYPE Code::Blocks_project_file>
<Code::Blocks_project_file>
<FileVersion major="1" minor="1"/>
<Project>
<Option title="Console application"/>
<Option makefile="Makefile"/>
<Option makefile_is_custom="0"/>
<Option compiler="3"/>
<Build>
<Target title="default">
<Option output="D:\cpp\_projects\dm\hello_stlport\hello_stlport.exe"/>
<Option working_dir="."/>
<Option object_output=".objs"/>
<Option deps_output=".deps"/>
<Option external_deps=""/>
<Option additional_depfiles=""/>
<Option type="1"/>
<Option compiler="3"/>
<Option projectResourceIncludeDirsRelation="1"/>
</Target>
</Build>
<Unit filename="hello.cpp">
<Option compilerVar="CPP"/>
<Option objectName="hello.o"/>
<Option target="default"/>
</Unit>
</Project>
</Code::Blocks_project_file>
--- End code ---

you see, you dont need any include directories or anything else,
just add the module-file ( in this case "hello.cpp" ) to the project.

that's it !


HTH -tiwag

tiwag:

--- Quote from: Priit on August 01, 2005, 01:17:55 pm ---I added C:\dm\stlport\stlport directory to DM compiler global directories (Compile-Compiler Options-Digital Mars Compiler-Directories-Compiler) and it works, but C:\dm\stlport\stlport has to be before  \dm\include. Otherwise i get the same error mentioned above.

--- End quote ---

Priit, you are absolutely right ! - that's the real important thing - when using stlport, the include-path to the "dm\stlport\stlport" directory MUST BE at first position, because in the standard include directory "dm\include" another instance of "iostream.h" resides and this is referenced by "iostream". If "dm\stlport\stlport" is not the first search location for include files, the wrong "iostream.h" file is included.

killerbot:

--- Quote from: Priit on August 01, 2005, 01:17:55 pm ---I added C:\dm\stlport\stlport directory to DM compiler global directories (Compile-Compiler Options-Digital Mars Compiler-Directories-Compiler) and it works, but C:\dm\stlport\stlport has to be before  \dm\include. Otherwise i get the same error mentioned above.

Thank you

--- End quote ---

This is absolutely correct.

Yiannis,
Maybe during the check for the presence of the digital mars compiler we should also check for the presence of the stlport, since this is rather important for usin good c++/stl.

Can you pintpoint me the correct code files where the digital mars compiler is detected, maybe I can add this stl port detection.

kind regards,
Lieven

mandrav:

--- Quote ---Can you pintpoint me the correct code files where the digital mars compiler is detected, maybe I can add this stl port detection.
--- End quote ---

Sure, it's in plugins/compilergcc/compilerDMC.cpp. Check the function AutoDetectInstallationDir(). You might want to take a peek at other compilers too, since they each have a similar function...
FYI, DMC is not actually "auto-detected", just the default installation directories are used. IIRC I couldn't find a way to auto-detect it (registry, ini file, etc).

killerbot:
done ... check your ...

Navigation

[0] Message Index

[*] Previous page

Go to full version