LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-14-2018, 04:35 AM   #1
Jerry Mcguire
Member
 
Registered: Jul 2009
Location: Hong Kong SAR
Distribution: RedHat, Fedora
Posts: 201

Rep: Reputation: 31
MS Visual Studio /nodefault option


Hi, sorry if this is not an appropriate forum to ask about MS Visual Studio question.

I am given a prebuilt static library (XXX.lib) and the vendor has included a particular version of C runtime in the lib by mistake. By further mistake I have officially accepted the lib, so I'm stuck.



Do you know how can I ignore the included C runtime and link with the one on my system rather?

The vendor told me I could explore the /nodefault option https://docs.microsoft.com/en-us/cpp...s?view=vs-2017 but it says it will ignore external references. I want to ignore the "internal" references however.

Last edited by Jerry Mcguire; 11-14-2018 at 04:36 AM.
 
Old 11-14-2018, 05:51 AM   #2
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,869
Blog Entries: 1

Rep: Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870
Maybe you could extract the object modules from the *.lib fájl, and build a new, smaller *.lib
https://docs.microsoft.com/hu-hu/cpp...b?view=vs-2017
 
Old 11-14-2018, 07:19 AM   #3
Jerry Mcguire
Member
 
Registered: Jul 2009
Location: Hong Kong SAR
Distribution: RedHat, Fedora
Posts: 201

Original Poster
Rep: Reputation: 31
The lib works by all means.

I could have asked the vendor for another one but which implies cost.
If I strip it as suggested, the vendor will not support my remade version.

So, these are not options in this cruel business world, my cruel reality.

This is output before linker option is added. What does this mean?
Code:
1>------ Build started: Project: TestXXX, Configuration: Release x64 ------
1>  xxx.c
1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>  Generating code
1>  All 222 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
1>  Finished generating code
1>  TestXXX.vcxproj -> C:\Users\xxxxx\Projects\TestXXX\x64\Release\TestXXX.exe
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
This is what I get by adding /nodefaultlib:libcmt
Code:
1>------ Build started: Project: TestXXX, Configuration: Release x64 ------
1>  xxx.c
1>  Generating code
1>  All 222 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
1>  Finished generating code
1>  TestXXX.vcxproj -> C:\Users\xxxxx\Projects\TestXXX\x64\Release\TestXXX.exe
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
What did I do by that option?

Last edited by Jerry Mcguire; 11-14-2018 at 08:32 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Visual Studio + Visual Micro in Debian? hellvetica Linux - Software 5 04-04-2017 10:24 AM
[SOLVED] Video - Studio 13.37 vs KXStudio, AV Linux, Dream Studio, and Ubuntu Studio l0wt3ch Studio 13.37 1 12-05-2012 07:45 PM
Studio to studio or studio to transmitter stable open source solution MATRIX_q Linux - Server 0 08-25-2011 03:44 AM
Stupid Question: Microsoft Visual Studio 6.0 (A.K.A. Visual Basic 6) Will it run? S0RD3N Linux - Software 8 05-07-2008 08:42 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:59 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration