Compiler : Options and parameters ...

Just starting out? Need help? Post your questions and find answers here.
freddix
Enthusiast
Enthusiast
Posts: 100
Joined: Sun Feb 08, 2004 7:22 pm
Location: South France
Contact:

Compiler : Options and parameters ...

Post 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
Last edited by freddix on Wed Oct 17, 2007 1:26 pm, edited 1 time in total.
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

No.
freddix
Enthusiast
Enthusiast
Posts: 100
Joined: Sun Feb 08, 2004 7:22 pm
Location: South France
Contact:

Post by freddix »

is it something that can be added in a future version ?
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Perhaps Purebasic's subsystems will help you achieve what you require?
I may look like a mule, but I'm not a complete ass.
freddix
Enthusiast
Enthusiast
Posts: 100
Joined: Sun Feb 08, 2004 7:22 pm
Location: South France
Contact:

Post by freddix »

can you explain me more ?
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post 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.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post 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.
I may look like a mule, but I'm not a complete ass.
freddix
Enthusiast
Enthusiast
Posts: 100
Joined: Sun Feb 08, 2004 7:22 pm
Location: South France
Contact:

Post by freddix »

ok

I'm not sure to understand exactly how it work but I'll check for that.

Thank you.
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post 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.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
freddix
Enthusiast
Enthusiast
Posts: 100
Joined: Sun Feb 08, 2004 7:22 pm
Location: South France
Contact:

Post 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.
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post 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
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
freddix
Enthusiast
Enthusiast
Posts: 100
Joined: Sun Feb 08, 2004 7:22 pm
Location: South France
Contact:

Post 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 ?
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

But PureBasic doesn't link to the C++ STL in the first place.
freddix
Enthusiast
Enthusiast
Posts: 100
Joined: Sun Feb 08, 2004 7:22 pm
Location: South France
Contact:

Post by freddix »

@Gnozal : I didn't find project properties ... only compiler options and the linker is not in.
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post 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 :oops: It is in jaPBe.
You have to use PBCompiler.exe from the command line then.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Post Reply