User forums > Help
Problem configuring Digital Mars as default compiler
Israel:
takeshimiya-san,
Thanks for the info. I don't know what to do because I want to continue to run OpenWatcom as-is (I know, the IDE is wretched, but there are some other things I like about it). If I remove it from the path then I'll break OpenWatcom?
> It is a bad idea to use the PATH when using more than one compiler.
"Can't we all just get along?"
Isn't there some way to have all this stuff (Codeblocks, OpenWatcom, Dev-CPP, etc.) coexist without using only one IDE? Can I fix OpenWatcom not to need the PATH?
Also, thanks for the note about STLPORT- I hadn't figured out how I was supposed to INCLUDE it.
Thanks to all you guys for the help, suggestions, etc.
MortenMacFly:
--- Quote from: Israel on November 01, 2005, 12:17:37 pm ---> It is a bad idea to use the PATH when using more than one compiler.
Isn't there some way to have all this stuff (Codeblocks, OpenWatcom, Dev-CPP, etc.) coexist without using only one IDE? Can I fix OpenWatcom not to need the PATH?
--- End quote ---
This is quite hard. I had the same problem some time ago when I was working on a project and had to use a QNX IDE. This conflicts with a Cygwin installation (because it relies on a specific version of the Cygwin DLL) and the other way round because QNX is required to have the PATH set (where the modified Cygwin DLL is found). I basically found out two ways that both have it's pros and cons. In both cases one is required to removed all PATH entries and other variables that may conflict from the "default" system. Then they are applied for the specific tools individually. Here is how it goes.
First way: Export the registry keys:
[HKEY_CURRENT_USER\Environment] and [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment] into a REG-file.
They include the PATH and other environment variables. Modify the file as required for the tool you want to use. You may create one REG-file for Codeblocks, one for DMC one for... Then, before using a specific tool just imports the required REG-file. In properties of your wokspace (workplace?!) of Windows open the dialog to access the environment variables and just press OK to close it again. This is required because only then Windows applies the new settings globally. Please note that running applications will still operate on the old environment so you can have several environments running in parallel.
The con: It's kind of annoying to always import the REG-files and have Windows to apply them. You may even forget it often... :lol:
Second way: Create batch-files that first sets the PATH (and other environment) variables and then runs the desigren application. Make sure you really set the PATH completely new, so do not use e.g. "PATH=%PATH%;D:\NewPath".
The con: You have to have for each tool a single batch-file. A REG-configuration may work well for several applications.
Please note that applications started via batch file (other than the REG approach) normally inherit their environment settings to tools that they are going to run (e.g. a compiler lauched by an IDE). This is OK in most cases but sometimes you may get strange effects.
Morten.
Israel:
Thanks, Morten. I guess someone at OpenWatcom needs a slap upside the head for not sharing the sandbox properly. CodeBlocks doesn't seem to be the one with the issue.
I'll have to think about this for a while.
Regards,
Israel
Israel:
This is very strange.
I decided to remove the INCLUDE system variable to see what happened. Then I rebooted.
I opened OpenWatcom and CodeBlocks IDEs and opened a Hello World project in each one. I made sure to change the source so the build would actually get invoked.
Without INCLUDE, OpenWatcom found IOSTREAM (I didn't think of it until now, I hope he found the right one), built the exe, and I was able to execute the .exe fine.
In CodeBlocks, the compile now runs (thanks to takeshimiya-san's comment about putting STLPORT ahead of INCLUDE) cleanly but I'm getting a link error from OPTLINK (DigitalMars). I think the output path is bad- but, stupidly, I don't know how to fix it.
The message log looks like this:
Project : Console application
Compiler : Digital Mars Compiler (called directly)
Directory : C:\Utilities\WXP\Dev\C++\console1\
--------------------------------------------------------------------------------
Switching to target: default
dmc.exe -mn -c -I"C:\Program Files\dm845c\dm\stlport\stlport" -I"C:\Program Files\dm845c\dm\include" -o.objs\main.obj main.cpp
link.exe /NOLOGO .objs\main.obj , "C:\Utilities\WXP\Dev\C++\console1\console.exe", ,
OPTLINK (R) for Win32 Release 7.50B1
Copyright (C) Digital Mars 1989 - 2001 All Rights Reserved
OPTLINK : Error 3: Cannot Create File \console1\console.exe
Process terminated with status 1 (0 minutes, 4 seconds)
0 errors, 0 warnings
I'm guessing the problem is OPTLINK : Error 3: Cannot Create File \console1\console.exe
What do I have to do to get this to create the executable in the folder in which the project is defined? From the link command,
link.exe /NOLOGO .objs\main.obj , "C:\Utilities\WXP\Dev\C++\console1\console.exe", , it does look like the output path was specified.
Or maybe it's because of .objs\main.obj not having the full path specified; .objs is the name of the folder which contains the object file...
I'm sorry, I looked at the DMC doc for the linker and I still can't figure it out.
Thanks guys,
Israel
MortenMacFly:
--- Quote from: Israel on November 01, 2005, 05:42:30 pm ---This is very strange.
--- End quote ---
I no, this might be no help for you, but:
I just installed DMC on my machine to give it a try. I downloaded the two ZIP archives (http://ftp.digitalmars.com/Digital_Mars_C++/Patch/dm845c.zip and http://ftp.digitalmars.com/Digital_Mars_C++/STL/stlport.zip) and extracted it into a folder. Then I run Code::Blocks and created a new console project. I setup the DMC environment under Settings->Compiler as follows: Changed the path to the include and lib folder accordiung to my installation; added the path to [DMC]\stlport\stlport to the compiler includes and setup the path to the binaries (tab "Programs") accordingly. Nothing else. Then I switched back to the console project. In it's project options now I chose the DMC compiler. Code::Blocks gave me a warning that I should better fully recompile the project due to this (very cool!!!). So I did and it just worked from scratch.
The compiler output was:
--- Code: ---Switching to target: default
dmc.exe -mn -c -I"D:\Devel\DMC\stlport\stlport" -I"D:\Devel\DMC\include" -o.objs\main.o main.cpp
link.exe /NOLOGO .objs\main.o , "D:\RemoveMe\console.exe", ,
Process terminated with status 0 (0 minutes, 0 seconds)
0 errors, 0 warnings
--- End code ---
No I have another idea for you to try: The compiler seems to work for you. That's fine. So in my opinion the only bad thing can be the linker "link.exe". Are you sure that the one from the DMC installation is called? Could you please verify this? I recommend to use "filemon" by SysInternals for that (http://www.sysinternals.com/Utilities/Filemon.html). Does this help?
Morten.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version