Error linking to external .obj file





I have a Fortran DLL project, which requires linking to an .obj file provided by a third party. With it specified in "Additional Dependencies", I get the following errors:



```
LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
libifcoremd.lib(for\_main.obj) : error LNK2019: unresolved external symbol \_MAIN\_\_ referenced in function \_main

```

Adding a main function of course solves the compilation error, but I shouldn't need to do that since I'm building a DLL. I'm wondering if there's some project property setting I'm missing, or if this is a problem with the .obj itself.


Fortran and linker command line options:



```
/nologo /module:"Release\\" /object:"Release\\" /libs:dll /threads /c
/OUT:"Release\TestProj.dll" /NOLOGO /MANIFEST /MANIFESTFILE:"C:\TestProj\TestProj\Release\TestProj.dll.intermediate.manifest" /SUBSYSTEM:WINDOWS /IMPLIB:"C:\TestProj\TestProj\Release\TestProj.lib" /DLL CV580SCAP.obj
```

I also used dumpbin /directives to check the linker directives of CV580SCAP.obj:



```
Linker Directives

-defaultlib:"IFWIN.LIB"
-defaultlib:"IFWIN.LIB"
-defaultlib:"IFWIN.LIB"
-defaultlib:"IFWIN.LIB"
-defaultlib:"IFWIN.LIB"
-defaultlib:"libifcoremt"
-defaultlib:"libifport"
-defaultlib:"ifqw\_sdi"
-defaultlib:"ifqwin"
-defaultlib:"user32"
-defaultlib:"comctl32"
-defaultlib:"gdi32"
-defaultlib:"comdlg32"
-defaultlib:"libmmt"
-defaultlib:"LIBCMT"
-defaultlib:"libirc"
-defaultlib:"svml\_dispmt"
-defaultlib:"OLDNAMES"

```

Using Visual Studio 2008 + Intel Visual Fortran 11.1.3466.2008.


Thanks in advance for any help!
The object you are linking with was built with the option to use the static run-time libraries, whereas your DLL was (properly) built to use the DLL libraries. When you mix these you'll get complaints such as this.


Since Fortran objects don't care which library set is used (this is not true of C/C++), one option could be to set the Linker>Input property "Ignore all default libraries" (/NODEFAULTLIB) in your DLL project. You will then need to name the required libraries under Additional Dependencies. (You can use the dumpbin command on your DLL's object to see a list.)


If you can rebuild the external object, do so with the Fortran > Libraries > Disable default library search rules property set to Yes. Then you should be able to link it in without further issue.




[View solution in original post](/t5/Intel-Fortran-Compiler/Error-linking-to-external-obj-file/m-p/1144075#M138021)
thanks for your comment!

i definitely should’ve used mkshell, not sure why i wasn’t. it does seem to produce a different error:

make: entering directory '/build/source/doc/manual'

xsltproc --nonet --param section.autolabel 1 --param section.label.includes.component.label 1 --param html.stylesheet … >>when I compile, there are no errors,  

Ditch the compiler and use a different one. There is a link error.



>>void print ()



Wrong. should be `void testClass::print ()` need to add 



```
services.AddEntityFrameworkSqlite().AddDbContext<ApplicationDbContext>();

```

and delete



```
services.AddIdentity<IdentityUser, IdentityRole>()
                    .AddEntityFrameworkStores<ProductContext>();

```

in startup.
the error was about bad startup configuration.
Was sending too much things.


ApplicationDbContext:



```
 public class ApplicationDbContext : IdentityDbContext
    {
        public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options)
            : base(options)
        {
        }
        public Microsoft.EntityFrameworkCore.DbSet<Product> Products { get; set; }
        public Microsoft.EntityFrameworkCore.DbSet<List> Lists { get; set; }

        public Microsoft.EntityFrameworkCore.DbSet<ProductList> ProductLists { get; set; }


        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            base.OnConfiguring(optionsBuilder);

             optionsBuilder.UseSqlite("Data Source=assistant.db");

        }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {

            base.OnModelCreating(modelBuilder);
            modelBuilder.Entity<ProductList>()
                .HasKey(pl => new { pl.ProductId, pl.ListId });

            modelBuilder.Entity<ProductList>()
                .HasOne(pl => pl.Product)
                .WithMany(p => p.ProductList)
                .HasForeignKey(pl => pl.ProductId)
                .OnDelete(DeleteBehavior.Cascade);

            modelBuilder.Entity<ProductList>()
                .HasOne(pl => pl.List)
                .WithMany(l => l.ProductList)
                .HasForeignKey(pl => pl.ListId)
                .OnDelete(DeleteBehavior.Cascade);
        }
    }

``` hey [@emartini](/u/emartini) ,

if you want to use clij2, you also need to activate the clij update site. the error should be gone then.

[[image]](https://aws1.discourse-cdn.com/business4/uploads/imagej/original/3x/0/9/095bc5fb3f3fa0db9dac6286bb16cf30ee81783d.jpeg "image")

see also the [installation instructions](https://clij.github.io/clij2-docs/installationinfiji).

let me know if this solves the issue!

cheers,

robert this is because the setting 'output when disabled' is different for the respective output ports of the enabled subsystems.

the from library browser version has the following setting:

<</matlabcentral/answers/uploaded\_files/78236/fromlibbrowse.png>>

the example version has the following setting:

<</matlabcentral/answers/uploaded\_files/78237/fromeg.png>>

because of this discrepancy, the behavior is expected. take a look at the documentation <https://www.mathworks.com/help/simulink/slref/outport.html#brqe2q3-28 here> to learn more about this setting. This error has to do with the XFree86 config file. I'm not sure about Mandrake, but in Windows it's at /etc/X11/XF86Config or /etc/X11/XF86Config-4



This file can be hand-edited or configured via a program such as Xconfigurator or xf86config (I think those are the names of the programs? if you have them installed)



What video card are you using? If you're using an Nvidia based card, go to the Linux section of [nvidia.com](http://nvidia.com/) and there is a detailed text file with everything you need to know about this file to get it to work. hi,

by default we have x11 and certain plugins are implemented for rendering frames through x11. also wayland is supported in nveglglessink plugin. in headless mode you would still need the prebuilt libs although don’t use them. please use the default libgstnveglglessink.so and include the libs:

n… seek and tell are still required.

see here: <https://docs.lvgl.io/latest/en/html/overview/file-system.html#use-drivers-for-images> resolved for now

so i think the symbolic link issues, when installing node red nodes (influxdb etc..) is due to he fact that the cifs network share is to a windows server

i tried a few things tonight but the best i came up with is this

i have set the "flows" env to a new folder and file and then … [@jbcousins92](/u/jbcousins92) i took a look at your repository and it looks like the course is expecting you to add the image in the \_includes/02-image.md file instead of the index.md file. can you try adding the same image there and letting the bot check it out?