473,390 Members | 1,115 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,390 software developers and data experts.

compiler and linker directives in Visual C++ 2005


Good afternoon

Is there a way to tell the compiler and linker where to look for my
header files and libraries directly on the code?
(I'm not talking about changing
project properties, linker, additional lib dirs... )

I can tell what libs I want to use, with this:
eg.
#define MATLAB_LIB_1 "C:\\Program Files\\MATLAB71\\extern\\lib\\win32
\\microsoft\\msvc70\\libeng.lib"
#pragma comment(lib, MATLAB_LIB_1)

As you see I'm telling the full pathname for libeng.lib
How do I tell the linker where to look for libs?
And how do I tell the compiler where to look for headers?

TIA
--
fade
email: fade(*AT*)forward(*dot*)to
Feb 1 '07 #1
3 2574
"fade" <do****************@mail.comwrote in message
news:Xn********************@194.65.14.158...
>
Good afternoon

Is there a way to tell the compiler and linker where to look for my
header files and libraries directly on the code?
(I'm not talking about changing
project properties, linker, additional lib dirs... )

I can tell what libs I want to use, with this:
eg.
#define MATLAB_LIB_1 "C:\\Program Files\\MATLAB71\\extern\\lib\\win32
\\microsoft\\msvc70\\libeng.lib"
#pragma comment(lib, MATLAB_LIB_1)

As you see I'm telling the full pathname for libeng.lib
How do I tell the linker where to look for libs?
And how do I tell the compiler where to look for headers?
You use the command line options and/or project settings.

Other than the use of #pragma comment that you've already discovered, there
are no other mechanisms that I'm aware of to pass absolute paths to the
linker/compiler from within the source code itself. That's a very unusual
thing to want to do that goes against most guidelines for sensible
development (imagine moving your code to another machine), so I don't expect
you're going to find exactly what you're looking for.

-cd
Feb 1 '07 #2

"fade" <do****************@mail.comwrote in message
news:Xn********************@194.65.14.158...
>
Good afternoon

Is there a way to tell the compiler and linker where to look for my
header files and libraries directly on the code?
(I'm not talking about changing
project properties, linker, additional lib dirs... )

I can tell what libs I want to use, with this:
eg.
#define MATLAB_LIB_1 "C:\\Program Files\\MATLAB71\\extern\\lib\\win32
\\microsoft\\msvc70\\libeng.lib"
#pragma comment(lib, MATLAB_LIB_1)

As you see I'm telling the full pathname for libeng.lib
How do I tell the linker where to look for libs?
Doesn't your method do that?

Remember you can use automatic concatenation of string literals to merge
paths with filenames.

And how do I tell the compiler where to look for headers?
#include accepts a relative or absolute path, as well as a bare filename.
>
TIA
--
fade
email: fade(*AT*)forward(*dot*)to

Feb 1 '07 #3
Remember you can use automatic concatenation of string literals to merge
paths with filenames.
Thank you! ;)

fade
email: fade(*AT*)forward(*dot*)to
Feb 5 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Thomas Meier | last post by:
Hi, i have a problem with Visual Studio .Net 2003. in VS 5.0 it was possible to change the Compiler and Linker with 2 settings in the windows registry: ...
6
by: ik | last post by:
Hello All, Can somebody tell, which compiler conforms C++ Standard, regarding templates better on Win32 Platform ? I was finding problems with VC++6.0 with some template code, but the same works...
4
by: Jeremy Watts | last post by:
Hi, I'm completely new to C++ and wondered if anyone has a recommendation for a C++ compiler Thanks
12
by: Baloff | last post by:
Hello I have this linker error which makes me think that the definition file is not being seen by the linker, this code is taken from "Thinking in C++, 2nd Edition, Volume 1, Annotated Solutions...
5
by: Ondrej Spanel | last post by:
I though that inline functions should be always visible only in the compilation unit where they are defined - meaning if compiler cannot inline them, they should be handled as if declared static....
3
by: Steve Baer | last post by:
I recently read your whitepaper under the "extremely long link times" post and have a question that I was hoping you could answer. My question is based on the following paragraph: Directives...
43
by: Jeremy Thomson | last post by:
I want to do some simple programming at home on my new Vista PC. Its to automate moving .AAC files to my phone's mercury card. (Nokia's application only works with USB cable or bluetooth). So the...
2
by: Oneironaut | last post by:
Hello friends, I have an issue with a linker warning. It is the warning LNK4089. I am working in MSVC6.0 I investigated and this warning tells that the import of the library to which it makes...
0
by: norseman | last post by:
I think I should have not used the 'reply' button but rather sent it back through the python-list@... So here here goes. =============== Hendrik van Rooyen wrote:...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.