Page 1 of 2
Compiler : Options and parameters ...
Posted: Wed Oct 17, 2007 1:24 pm
by freddix
I've heard that under VS2003+ a project is always linked to STL except if we use the compiler option /NODEFAULTLIB.
I'd like to know if PureBASIC Compiler have options, settings, parameters like /NODEFAULTLIB this one that can be used ?
does /NODEFAULTLIB can be used with PureBASIC compiler ?
I created this post because I have a problem with specific external links, not resolved that can be fixed under C++ by using /NODEFAULTLIB in the compilers options/parameters.
Regards,
Fred
Posted: Wed Oct 17, 2007 1:25 pm
by Trond
No.
Posted: Wed Oct 17, 2007 1:26 pm
by freddix
is it something that can be added in a future version ?
Posted: Wed Oct 17, 2007 1:41 pm
by srod
Perhaps Purebasic's subsystems will help you achieve what you require?
Posted: Wed Oct 17, 2007 1:42 pm
by freddix
can you explain me more ?
Posted: Wed Oct 17, 2007 1:55 pm
by Trond
I created this post because I have a problem with specific external links, not resolved that can be fixed under C++ by using /NODEFAULTLIB in the compilers options/parameters.
That happens when you compile a source file to an object file and then link it without linking in the standard library. PureBasic can't compile to object files, so the problem simply isn't there.
Posted: Wed Oct 17, 2007 2:00 pm
by srod
Well, a subsystem is basically a subfolder of the SubSystems subfolder of your Purebasic installation and into which you can place libraries which take priority over libraries found elsewhere in the system.
For example, if you look in your SubSytems folder you will find an NT4 subfolder. In here there are various libraries; e.g. there is a joystick library. If in your application you set a compiler option to use this particular subsytem, then if your application makes use of the joystick library, Purebasic will use the library within this subsystem and not the usual library which resides in the Purelibraries folder of the PB installation.
Subsystems give you a means of having different versions of the same library in your PB installation and being able to choose which one you use etc.
Indeed, a lot of people (myself included) use the unicode and threadsafe subsystems in order to automatically use the correct versions of various user libaries etc.
Posted: Wed Oct 17, 2007 2:18 pm
by freddix
ok
I'm not sure to understand exactly how it work but I'll check for that.
Thank you.
Posted: Wed Oct 17, 2007 2:32 pm
by gnozal
Iirc NODEFAULTLIB is a linker option.
You can set extra linker arguments in the project options [PB4.10 only : new compiler message LINKER]. Or you can use the /LINKER commandline switch.
Posted: Wed Oct 17, 2007 2:53 pm
by freddix
@gnozal: I use 4.10b3 so I think I can add this to the linker

Cool news

so, I should simply add NODEFAULTLIB in the linker option and it should accept it?
thank you all.
Posted: Wed Oct 17, 2007 3:09 pm
by gnozal
freddix wrote:so, I should simply add NODEFAULTLIB in the linker option and it should accept it?
The linker should accept the option (I tested it with some other options) but it may not solve your specific problem
Posted: Wed Oct 17, 2007 3:22 pm
by freddix
on a C++ forum, they said that problem with Xran/Xlen functions is linked to the fact that the compiler is automatically linked to STL system. by disabling lib with /NODEFAULTLIB (and then disabling the auto include ot STL), it should solve the problem ...
Maybe it's the same with PureBASIC ?
Posted: Wed Oct 17, 2007 3:38 pm
by Trond
But PureBasic doesn't link to the C++ STL in the first place.
Posted: Wed Oct 17, 2007 9:44 pm
by freddix
@Gnozal : I didn't find project properties ... only compiler options and the linker is not in.
Posted: Thu Oct 18, 2007 7:47 am
by gnozal
freddix wrote:@Gnozal : I didn't find project properties ... only compiler options and the linker is not in.
Sorry, I did not check PB IDE

It is in jaPBe.
You have to use PBCompiler.exe from the command line then.